installing play framework 2.4 on windows 7 - java

some questions:
i unzipped the full offline distribution (400+ mb) to C:\Program Files\Play2.4
Unzipping created a directory "activator-dist-1.3.5" within which are bin, lib, repository, templates, etc.
i assume i put the contents of activator-dist-1.3.5 into C:\Program Files\Play2.4?
i setup an user environment variable name: PLAY_HOME, value: C:\Program Files\Play2.4 and then added ;%PLAY_HOME% to the end of the system variable "Path"
i've tried calling "play" from dos both with and without "activator-dist-1.3.5" directory and both return "play is not recognized as an internal or external command"
some other answers to this question mention the root play dir should have "play.bat" but all i see is "activator.bat"
i read readme.html and opened activator.bat, it launched a dos window, which promptly closed.
http://localhost:8888/home goes nowhere.
For those who don't yet speak "play", what is Activator UI?

Since play 2.3, the play command was replaced with the activator command. Take a look to this.
If you put the folder activator-dist-1.3.5 into C:\Program Files\Play2.4 then your enviroment variable must be set to C:\Program Files\Play2.4\activator-dist-1.3.5\bin. You can also put that path directly into the PATH environment variable.
Activator UI is a web aplication that helps you create play applications. You can think of it as the graphical version of the activator command line tool. Here is the documentation

ok, here is what ive figured out:
the environment variable has to point to the bin directory (thx Victor)
from w/in dos window (the "console"), cd to the the root play dir (not bin) and type "activator" not "play"
all other documentation and stackoverflow answers refer to the pre 2.3 versions of play and will not help you.
then a bunch of stuff happens: online maven call (even though i downloaded the offline dist) and a bunch of calls to the play root dir/repository for jars.
of course localhost:9000 and localhost:8888 still get connection refused.
now if you manually open activator.bat in root play dir it launches another dos window, makes a network call (firewall allow) and opens a browser win to: http://127.0.0.1:8888/home which is some sort of "welcome to activator" screen with sample apps .. sort of like the tomcat mngt page.
i hope to only define and start/stop apps from w/in my IDE, so eventually i'll be looking for how to disable this default activator behavior
next up.. how to setup intelliJ:
i went here: https://www.playframework.com/documentation/2.4.x/IDE and defined an SBt task instead of a play task in run/debug configurations of my new project.
now project start makes maven calls for jars but then dies on:
[error] Server access Error: Connection timed out: connect url=...repo.typesafe.com/typesafe/ivy-releases/org.apache/apache/14/jars/apache.jar
stopping and restarting did a bunch more maven calls (really slow) but eventually "done updating" and localhost:9000/ now shows welcome screen :)
not completely painless but certainly simpler than a spring app
onEdit:
sorry play, but i've moved to spring boot because:
i create new projects by copying existing and making changes. its much faster than creating a new proj from scratch. Thus the activator thing (which does not work) is not useful to me and just represents a security prob (like apache web management screen) that need be disabled
no where is there a clear, concise and complete list of settings to get play running correctly in intelliJ (the 2nd most popular IDE avail)
asynchronous, non-blocking and micro services are not unique to play and spring (or others) can be made to work in a similar fashion
We have so many technologies to learn and it does'nt make sense to invest a lot of time mastering one with limited corporate buy in
i want to stop/start from w/in my IDE and not have to have a bunch of dos windows open. i know this is possible in play, but documentation makes it feel as though its not the preferred method
although i appreciate that the play directory structure is less flexible, its still not the command/controller/manager/dao/model world that is the most often seen for java apps
i investigated play because spring was getting to the point of having too many ways to configure too many things in too many places that were documented differently across versions. Also, large sub-projects in spring (like security) garnered their own books on the subject because they were so complex to figure out. At the end of the day, the level of security (for example) needed (or the manner in was implemented) went beyond what avail via simple configuration and after all the customization we were left wondering whether spring security just got in the way instead of providing real time saving and usefulness.
Spring boot hopes to help in that its an opinionated configuration where a collection of configuration basic best practices are encouraged/enforced.
and lets re real.. time saving on a slightly more concise language or a slightly different proj structure or dynamic class loading is not whats important.
The majority of time spent on projects, by far, is the time spent researching, thinking and investigating architectures, technologies, databases and presentation schemes.
I prob only spend 20% of my time coding and 80% trying to figure out the strategic vision needed to create software that has maximum usefulness and is "future friendly" (not needing to be re-coded every 3 years)

so far i've deleted my project and recreated about 10 times.. trying diff settings, still w/ no luck.
checking google play mailing group, i tried to create via activator ui.. but could not launch activator until i deleted the RUNNING_PID file in the play root dir
now i'm back at: http://127.0.0.1:8888/home to create a new app
at create new proj i get error: "cannot find project/build.properties".
lets try adding a blank build.properties where its expected.. nope, error: "destination already has files in it"
not that it really matters, sample templates have no knowledge of IDE and thus provide no insight into how to configure IJ. New\Import project does not list IJ as an option in choosing an external model
...whatever...
"Mr McKitrick.. after careful consideration ..."

trying to get working in IJ 14 ultimate:
jamesward.com has a tutorial and video, but its for older versions of IJ and play and only covers a small % of necc. configurations.
jetbrains has a tutorial but it also only covers play 2 and older IJ which does not translate to 14 and 2.4
https://www.playframework.com/documentation/2.4.x/IDE helps, but just w/ setting up an SBT Task
all the other project settings are a mystery for example:
project source need be defined to even show your project directories in proj tree
facet setup add does not list scala as option
why is scala lib pointing to users[me].ivy2\cache..? (i would think all necc libs are w/in play root\lib
should i setup a global lib pointed to play\lib?
run/debug config need env var pointed to PLAY_HOME?
basically all classes are not being resolved in IJ editor.
project structure lists 109 problems like:
Library SBT: joda-time:joda-time:2.3:jar is not used [Fix]
seems like i'm missing a global lib definition.
i'm able to get my app running, but i dont know how useful its going to be when the 2nd most popular IDE throws red bars at every import: "play."

Related

Eclipse Oxygen: How to automatically upload php files on remote server

I'm coming from NetBeans and evaluating others and more flexible IDEs supporting more languages (i.e. Python) than just php and related.
I kept an eye on Eclipse that seems to be the best choice; at the time I was not able to find an easy solution to keep the original project on my machine and automatically send / syncronize the files on the remove server via sftp.
All solutions seems to be outdated or stupid (like mounting a smb partition or manually send the file via an ftp client!
I'm not going to believe that an IDE like Eclipse doesn't have a smart solution of what I consider a basic feature of an IDE, so I think I missed something... On Eclipse forums I've seen the same question asked lots of time but without any answer!
Some suggestions about is strongly apreciated otherwise I think the only solution is stick on one IDE each language I use that seem to be incredible on 2018.
I'm developing on MacOS and the most interesting solution (kDevelop) fails on building with MacPorts.
Thank you very much.
RSE is a very poor solution, as you noted it's a one-shot sync and is useless if you want to develop locally and only deploy occasionally. For many years I used the Aptana Studio suite of plugins which included excellent upload/sync tools for individual files or whole projects, let you diff everything against a remote file structure over SFTP when you wanted and exclude whatever you wanted.
Unfortunately, Aptana is no longer supported and causes some major problems in Eclipse Neon and later. Specifically, its editors are completely broken, and they override the native Eclipse editors, opening new windows that are blank with no title. However, it is still by far the best solution for casual SFTP deployment...there is literally nothing else even close. With some work it is possible to install Aptana and get use of its publishing tools while preventing it from destroying the rest of your workspace.
Install Aptana from the marketplace.
Go to Window > Preferences > Install/Update, then click "Uninstall or update".
Uninstall everything to do with Aptana except for Aptana Studio 3 Core and the Aptana SecureFTP Library inside that.
This gets rid of most, but not all of Aptana's editors, and the worst one is the HTML editor which creates a second HTML content type in Eclipse that cannot be removed and causes all kinds of chaos. But there is a workaround.
Exit Eclipse. Go into the eclipse/plugins/ directory and remove all plugins beginning with com.aptana.editor.* EXCEPT FOR THE FOLLOWING which seem to be required:
com.aptana.editor.common.override_1.0.0.1351531287.jar
com.aptana.editor.common_3.0.3.1400201987.jar
com.aptana.editor.diff_3.0.0.1365788962.jar
com.aptana.editor.dtd_3.0.0.1354746625.jar
com.aptana.editor.epl_3.0.0.1398883419.jar
com.aptana.editor.erb_3.0.3.1380237252.jar
com.aptana.editor.findbar_3.0.0.jar
com.aptana.editor.idl_3.0.0.1365788962.jar
com.aptana.editor.text_3.0.0.1339173764.jar
Go back into Eclipse. Right-clicking a project folder should now expose a 'Publish' option that lets you run Aptana's deployment wizard and sync to a remote filesystem over SFTP.
Hope this helps...took me hours of trial and error, but finally everything works. For the record I am using Neon, not Oxygen, so I can't say definitively whether it will work in later versions.

Export Processing Project as aWeb App

I've made a cool processing project that I would like to embed on the web; however, it uses 3rd party Java libraries to access an sqlite database. For this reason, the normal export-to-javascript which has worked well for me in the past is just not capable enough here. How can I make my Processing project into a Java applet that will allow it to be run remotely?
This depends upon what version of Processing you are using...
It was only in the final move to 2.0 that they got rid of the 'Export to Applet' option, so if you can make do with a 2.x-beta version, you're golden.
Of course, that's just through the PDE - so failing the ability to move to an earlier version, the library itself should be able to handle it still, from a different IDE, say Eclipse or NetBeans...
I guess the other option would be to see if you can port your library to a JavaScript library ?

sipdroid - Another incoming call is not display while one is continue

I have installed SIPDROID. I made three account at sip2sip.
After that I have configured application using one of that account. Application works fine.
Question is: If I make multiple call to the same phone using SIP is there anyway to handle all calls at a same time?
Another incoming call is not displaying on mobile screen while first call is continue.
The first call getting picked up but what about the second call which is coming during first call.
Even second call is not displaying on the screen. Confused !!
Sipdroid that I what started with but after researching on it and from developers reviews I found that application has some missing functionality like multiple call and transferring calls etc...
I don't know but may who is expert in sip stack or have time to do can implement missing functionality but I am neither one of them so my desire to get an application that have all this functionality and by modifying it I can integrate into my application and csipsimple is the answer.
However its not easy job to build csipsimple into windows environment but there is hack how to do it. so carefully read its wiki about building project into window environment.
According to wiki you can build native library or you can go ahead without building the native library. I suggest for windows user to go with without building the native library.
If you have read wiki then in "without building the native library" section last line is like
"To get the .so files, download latest nightly build from nightly
build website and unpack the apk file (apk files are just zip files).
Then get lib/ARCH/.so files and copy it into CSipSimple
libs/ARCH/.so"
I have to clarify one important thing about that:
First get .apk file of csipsimple. The version of .apk file must same to download version of your csipsimple source code..
Here, you can see the source code version. Download the same version .apk and do further as described in wiki.
SipDroid supports only one line at all times. This means you cannot have conference calls. So to the question:
If I make multiple call to the same phone using SIP is there anyway to
handle all calls at a same time?
Nope, you cannot handle simultaneous calls at the same time. Fortunately there's another open source SIP Client that supports multiple lines - IMSDroid.
Though you can extend SipDroid to support multiple lines, that's a lot of effort. The main objects you have to pay attention to in order to support multiple lines are:
UserAgent, SipProvider (note that it's designed to support multiplexing/demultiplexing of SIP messages), JAudioLauncher and the Call object.
The bug you're describing with the second call not showing is not something I have witnessed. This could be due to your device setup, or due to customizations performed on the original code...
you can build the csipsimple easily in linux OS... All you have to do is just paste the download source link in linux commanpropmt and for windows you must have latest cygwin software to download or to build native library... Better option is to go for linux OS only...

Demo Java application runnable from a DVD

I wish to give some demo copies of a Java application on a DVD to a client. Does it make sense to have a preinstalled JRE and Java application on a DVD so that they can just click and run it?
Also, if anyone has done this what are your views on this?
I would suggest you skip the DVD and go for a flash drive instead. This way you can use portable Java and run your app from the flash drive without having to install anything on your client's computer. With the low costs of flash drives these days you should easily earn back what you spend in money in convenience and time.
Here is a tutorial that shows you how to set this up.
Indeed you can simply put a JRE into a directory of the DVD.
Then you start the application with a .bat file that runs a command such as :
jre\bin\java.exe -jar Main.jar
(If your jar and the jre folder are in the same directory)
Be careful about one thing : you can't know in advance what the DVD's drive letter will be, so in your .bat file you must give relative paths to the JRE and to your jar (or starting class).
If you are dealing with a one or two people then just throw a JRE on the DVD and explain how to install it or even just include a link to the page where they can install Java themselves. In the past when dealing with a large set of recipients that needed to install a JRE and run an application, I have used tools like InstallAnywhere, to create a simple setup to walk the user through a wizard for setup.
I've in the past copied a windows JRE directory to a USB flash drive, and run a java app off that.
If:
The users have an internet connection
The demos. have a GUI
You can deliver them off a site
..I would recommend using deployJava.js to ensure a suitable minimum JRE, & Java Web Start to download/install & launch the demos.
JWS has a number of advantages in this situation:
Server hits for the resources will reveal what proportion of the people to whom the demo. was delivered, are actually trying it.
JWS offers 'lazy downloads' so that if a potential user is only interested in one small section of a large application, they do not have to download the entire binary.
If the user turns a demo. into a registered version, (at least parts of) the app. will be already installed.
But in the event that it is a constantly changing app., JWS will automatically update any new parts of the app.
All this is part of the 'one click' installation experience for JWS. It is more tricky for a developer to set up, but once done well, is a breeze for the end-user.
You might include an HTML page on the CD (DVD would be a waste for a single HTML, a couple of images & some CSS based style sheets) that links to the demos. But since the hardest thing about getting a user to try a demo. is getting them to put the disk in the drive, I would side-step the disk entirely & send the 'Here are some free demos.' HTML to the user as email.
This was included as a comment a couple of days ago. Since the thread was resurrected, I decided to include it as an answer & expand on it.

Java web development using Eclipse - Tutorial

I need some step by step tutorials/documents on developing Java web applications using Eclipse/apache.
appreciate directions/help.
I recommend you read a book instead:
This is probably the simplest way to get started. It really helped me with getting a grasp on how the directory structure and web.xml go together and make a web app. Eclipse is only a partner in your development, you really need to understand the underlying infrastructure no matter what framework you are using, and this book gives you a solid start.
There are some video tutorials available at http://eclipsetutorial.sourceforge.net/
The first tutorial begins with the absolute basics of setting up a workspace and getting started. It also shows the Welcome screen available under the help menu which has links to an overview, samples, and tutorials
As you've already installed Apache Tomcat. I assume you've not installed Java EE tools for Eclipse. If not, then First download Eclipse Java EE tools from Help > Software Updates > Available Software > Java EE developer Tools.
First way : is using Tomcat plugin with eclipse,for that you've to check this tutorial
Second way: If the Tomcat Plugin is not working with you then other alternative as follow Click on Click Window in menu> Preferences then click Server pane. Open Runtime Requirement pane. Add path for the tomcat directory. Click Ok. You're done with the settings.
Now you can create new projects from File >New >Projects. And start building servlets/jsp projects. Try learning from good books like "Head first: Servlets & JSP".
Hope this helps.
When you first start Eclipse there is a screen with tutorials right in the program. They are also accessible from the Help menu
Reminds me of that old joke:
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
Sounds like you have several things that you don't know: Eclipse, Tomcat, Java EE development, maybe JSPs, JSTL, WAR files, the list goes on.
My advice would be to strip things down to the bare bones and decompose the problem a bit.
Start by doing a simple servlet/JSP app talking to a database, without using Eclipse. See if you can compile on the command line, create the WAR file, package it properly, and deploy it on Tomcat.
If you can manage that, then work Eclipse into the mix. Don't worry about running Tomcat inside Eclipse at first. You can go back and forth until the IDE is comfortable.
But you're asking a lot when you say you'd like step by step instructions. You're tackling a very big problem.
DZone REFCARZ might be helpful, there's one for eclipse:
Getting Started with Eclipse

Categories

Resources