By following instruction from:
Create Google App Engine Project in Eclipse with Modules
I'm able create 1 Enterprise app and 2 associated dynamic web app (default and task). They work fine but every time running the local server (using Google plugin for Eclipse), console always display below error:
WARNING: Your working directory, (D:\Workspaces\GAE\MyProject\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\MyProject) is not equal to your
web application root (D:\Workspaces\GAE\MyProject\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\MyProject\MyProject_default.war)
...
WARNING: Your working directory, (D:\Workspaces\GAE\MyProject\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\MyProject) is not equal to your
web application root (D:\Workspaces\GAE\MyProject\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\MyProject\MyProject_tasks.war)
You will not be able to access files from your working directory on the production server.
Understand that it complain the working folder (which is belong to Enterprise App) is not same for both web root.
If I change the argument for working folder to root folder for default web app:
D:\Workspaces\GAE\MyProject.metadata.plugins\org.eclipse.wst.server.core\tmp1\MyProject\MyProject_default.war
First warning is no longer display but it still display second warning.
And I don't think that is right to change the working folder to default web app root folder.
In summary, because of multi modules, I have 2 root folders but only can set one working folder in argument. Is that a way to solve this problem?
Thanks
Rgds
SJ
App Engine modules have been renamed to services, in large part (I suspect) to avoid confusion with web modules. A limitation of the local development app server is that it hosts services within a single process, and a process can only have a single working directory.
This limitation only affects accessing files directly (e.g., new File("path/to/my/file")). But there are better ways to access files from within a servlet.
Related
I am working on a Java servlet project using NetBeans.
I am looking for a way to use NetBeans’s “deploy on save” on another browser of my device within LAN (locally its working fine) so that I don’t have to manually reload my browser during my development.
Recently I have decided to use proxy feature of Browsersync, but the problem of the Browsersync is, it auto reloads browser early before NetBeans completes deployment on save.
I am using GlassFish(4.1) with NetBeans.
Any help is greatly appreciated.
I had to something different in order to achieve the solution.
I am watching “glassfish/domains/domain1/config/” folder using Browsersync. Looks like after building the project, few files modified here during hot reload (so I have used watchEvents from Browsersync).
The proxy site instantly reload after NetBeans completes deployment on save.
Following is the Browsersync command.
These directory names have to be the full path with drive letter.
browser-sync start --proxy "http://localhost:8080/test" --files "src/java/com/test/, glassfish/domains/domain1/config/" --watchEvents add change " src/java/com/test/, glassfish/domains/domain1/config/" --no-notify --host 192.168.X.X --port 5000
What i mean by this question is that can people start a .jar application embedded on web or they have to download it ? I made a simple online game and people nowadays will not want to individually download the game instead of directly accessing it through the browser. I developed the game on desktop, which steps should i take to make it a web application, or can it directly be converted to a web application ?
If you don't want the user to download the entire application then you must recode it using web technologies.
If you want your answers be able to launch the application via their browse (which involve the download of the application "transparently") you can just make an Applet like #huseyin tugrul buyukisik said or you can use Java Web Start : http://docs.oracle.com/javase/tutorial/deployment/webstart/
You can wrap your classes in an applet, just add a button to launch the class.
init() method will be overloaded to load the classes, start() method is to launch things. Applet is single thread so if you launch expensive loop in one of the overloaded methods, applet can stuck. You can need threads.
There is no direct conversion from jar to web application. Web servers wouldn't understand this. what you need is to
create a web application folder structure, copy jar to web-inf\lib folder
prepare web.xml as required for your application
bundle web application folder into a war file or deploy it exploded
Typical web application folder looks like:
webapp
|-*.html,*.images, *.js, *.css
|-WEB-INF
|-WEB-INF/web.xml
|-WEB-INF/lib/*.jar
|-WEB-INF/classes/*.class, *.properties
The major change in this scenario IMO would be change in routing of request to web-server instead of approach taken by your desktop app i.e. single JVM, calls directly routed to handler class instance.
Say a hypothetical case, upon save from a GUI the desktop app might be serializing data to local disk, now in case of web application it might be required to send this data to web-server (say specific SaveServlet) which takes care of this logic at server machine instead of clients.
If you provide specific usecase of your desktop app functionality, we might be able to help better.
you can do this using jnlp (java native language plugin), which will be download automatically when user visits your page (even by providing link for the same).
After that it will ask user permission to execute that jnlp (same as a jar) & your jar will be executed at the client side.
http://www.mkyong.com/java/java-web-start-jnlp-tutorial-unofficial-guide/
I have a swing application that is installed in the server, and to access it, I have created a short-cut in every computer in the network, and it's working just fine. The application uses jrxml files to generate documents, and they are packaged in a folder called Cycloplan and its working fine, but I still have some technical issues, in which every time I make some updates in the configuration files, I have to go to every computer and paste the Cycloplan folder to it, so I am looking for a method to avoid this operation when an update shows up. please help.
Package the .jrxml files into Jars and deploy the lot using Java Web Start. They will be updated automatically when the Jar is updated.
I've been doing some research into how to make Apple flat packages from a Java webapp. There doesn't seem to be much out on the subject. I found a website that details the contents of a flat package but it seems like a bit of a project to start from scratch. Anyone have any experience building PKGs? Does anyone know of any libraries to aid in the process?
EDIT:
It seems I may not have been clear in my request. My goal is to have users go to a website that requires them to enter some information. After they've entered their information my code would create a PKG for them that contains some information about them. For example, maybe the postinsall script would run the command "say 'Hello USERNAME_THEY_ENTERED'". Silly example but it's the general idea. The user would then be able to run the PKG and the install that takes place would be customized with their information.
Why would you want a web application in a pkg file? What servlet container accepts pkg files?
Web applications are meant to be packaged as WAR or EAR files (since we are talking about Java) and to be deployed on a servlet container like tomcat, jetty, websphere, glassfish, jboss, ... running on a server. The client computer then uses a browser to access to web application on the server.
PKG files can be compared to MSI files. These are meant to facilitate the installation of software (or libraries) on a client. For that the website you linked seems to have valid information.
I am not sure why you want to do that for a webapp but we have done it for a standalone Java App (which actually was a collection of webapps including the server).
If this works for you, try to prepare your application.app folder using jarBundler. It provides an Ant task that will make things much easier.
If this does not work for you (as unfortunately was the case for us), then you have to prepare the application.app folder by hand and script adding the java resources. Start from an existing app, generated with Jar Bundler for instance, and adjust accordingly.
Then you need to install XCode and get PackageMaker. This app has a GUI but you really need to read the doc. The biggest issue we have met is that you cannot script the package build process.
I need to add that, unless you need to run some post-install scripts, building a DMG is probably much easier.
after lots of investigations for calling a web service from silverlight:
Calling a Java Web service from silverlight throws an exception
I found out that I should I have to create a clientaccesspolicy.xml file and put it in the root folder of the application. I copied it in the root folder of my ASPX (web page) but it didn't help. I'm guessing the root folder should be the root folder of the server for my Java service. I have apache server on my Win7 x64 system but after stopping it the Java still worked so I'm guessing that the server for Eclipse IDE is different from Apache.
So the main question here is: Where is the root folder of Java Eclipse server? Where should I put that xml file?
Thanks.
If you are using a self-hosted Java webservice with Endpoint.publish(String) then I think it is not possible to add further files for delivery, e.g. a crossdomain.xml
Instead you need to switch from a self-hosted webservice to a server-hosted webservice as described here (the tutorial is using Netbeans, but a similar approach should be possible with Eclipse, too, even if it might be slightly easier to use Netbeans for this example). As Tomcat is used as a server, it is also possible to deliver the corresponding Silverlight project files as well, in which case you do not need a crossdomain.xml