All,
I am having some trouble running a java web start application that has been generated by Netbeans 7.
I have migrated my existing java 6.9.1 application to Netbeans 7 and attempted to make it a web start application.
To do this I have checked the Enable Web Start option from the project properties.
For the codebase option I have Web Application Deployment selected.
The Application descriptor is selected option which will point the JNLP application-desc element to my applications main class.
For signing, I have generated a key and pointed the Signing properties at this. I have the Mixed Code set to Trusted Only as my application will only used signed JARs.
When I compile, all referenced JAR files and the application JAR file are signed which is output in the console (for each one) as:
Signing JAR: D:\MyCode\dist\lib\somejarfile.jar to D:\MyCode\dist\lib\somejarfile.jar as signFiles
Enter Passphrase for keystore: Enter key password for signFiles:
NOTE: signFiles is the alias I have used in the Signing properties in Netbeans.
The following files are created in my dist folder:
lib
jnlpcomponent1.jnlp
launch.html
launch.jnlp
README.TXT
My App.jar
I have copied these to my web folder that is hosted under tomcat which is C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\mywebapp.
I am running from the following URL in IE and Firefox:
http://mylaptop:8080/mywebapp/launch.html
The following exception is thrown when I click the button in launch.html to launch the JNLP file:
com.sun.deploy.net.FailedDownloadException: Unable to load resource: file:/C:/Users/panderson/AppData/Local/Microsoft/Windows/Temporary Internet Files/Content.IE5/B3UCQV8C/$$codebase/launch.jnlp
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.javaws.Launcher.updateFinalLaunchDesc(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
My launch.jnlp file has the following:
<jnlp codebase="$$codebase" href="launch.jnlp" spec="1.0+">
...
<resources>
<j2se version="1.6+"/>
<jar href="My App.jar" main="true"/>
...
I am not too sure why it is looking under the temp folders in internet explorer for it...
... But I have tried putting the full url in the jnlp href to the launch.JNLP file http://mylaptop:8080/mywebapp/launch.jnlp then it throws the following exception:
com.sun.deploy.net.FailedDownloadException: Unable to load resource: file:/C:/Users/panderson/AppData/Local/Microsoft/Windows/Temporary Internet Files/Content.IE5/DR2O6URQ/$$codebase/My App.jar
If I then change the jar href to http://mylaptop:8080/mywebapp/My App.jar, the following exception is thrown when I click the button in the launch.html to run the launch.JNLP file.
BadFieldException[ The field <jnlp>codebase has an invalid value: $$codebase,$$codebase]
Any help or thoughts?
Cheers,
Andez
<jnlp codebase="$$codebase" href="launch.jnlp" spec="1.0+">
These $$ place-holder values are usually translated to something sensible by a servlet or similar functionality.
This was suggested as a useful tool in the following question.
Try using JaNeLA and see if it finds any problems with your JNLP file.
Further double check and make sure the codebase url matches the url of your server/application.
Related
I asked a question earlier here: NoClassDefFoundError with bluecove's javax.microedition
but got no responses.
I am trying to run some java code (Server.java) that requires bluetooth, so I installed the bluecove-2.1.0.jar file in C:\Program Files\Java.
I compile my code with javac -cp "C:\Program Files\Java\bluecove-2.1.0.jar";. Server.java and run it with java Server -cp "C:\Program Files\Java\bluecove-2.1.0.jar"
It compiles successfully, but when I run it, I get the error:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: javax/microedition/io/Connection
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.microedition.io.Connection
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
Any ideas where i've gone wrong?
EDIT: Following Minus' answer, to fix the error that followed, I also needed to use a different .jar file which I downloaded from http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.63/
The problem is that the .dll is not loaded correctly.
The library should contain a .dll that will be saved on disk and loaded, maybe the program cannot save the .dll to disk or cannot read it.
Extract the .dll and follow bluecove installation instructions on Native Library location.
For example:
Create a directory c:\blue, and a directory blue\lib.
Put the files like this:
C:\blue\Sever.java
C:\blue\Sever.class
C:\blue\[bluecove_native_library].dll
C:\blue\lib\bluecove-2.1.0.jar
Open a cmd (Command Prompt) on c:\blue
Try to run the app like this:
java -cp .;lib\bluecove-2.1.0.jar -Dbluecove.native.resource=false Server
This way you will have both Server.class and bluecove-2.1.0.jar in classpath and the DLL in path (since on Windows the current dir is in path).
Add a current folder to a classpath (.;) and make sure that your code is in a package-name folder.
So if your server has a package name :
mypackage
make sure that your class code is in a /mypackage directory
than go to a parent folder to /mypackage and call:
java -cp ".;C:\Program Files\Java\bluecove-2.1.0.jar" mypackage.Server
We have a secured server (RSL) where my applet gets some errors (it worked well on other, less restrictive servers). I found java security signing so complicated; from version to version, from PC to PC etc. In one word, after researching for almost a week+ I came to a point where I cant seam I can move forward anymore.
What this applet does is simply uploads a local file to application FTP site. My users hate default INPUT control to browse a file, location of which is defined so, I made this applet simply to upload that defined file to this FTP site (this original project was done w/ classic asp some years ago; this is an upgrade per client request).
This java project uses apache FTPClient library and my package includes commons-net-3.3.jar (also few dependencies: ant-apache-oro.jar, ant-commons-net.jar and jakarta-oro-2.0.8.jar). There is absolutely no issue when I run this applet on my PC (eclipse). However problems start when I run the applet on production site (on that restrictive server). Here is how I sign and compile my jar.
START
My MANIFEST.MF file content:
Manifest-Version: 1.0
Class-Path: commons-net-3.3.jar
Permissions: all-permissions
Trusted-Library: true
Created-By: 1.8.0_31 (company)
My .java.policy file content:
/* AUTOMATICALLY GENERATED ON Thu Feb 19 13:51:28 PST 2015*/
/* DO NOT EDIT */
keystore "JavaFileUploader.keystore";
grant {
permission java.security.AllPermission;
};
...and this is how I sign and compile my classes:
keytool -genkey -alias JavaFileUploader -validity 1500 -keystore JavaFileUploader.ks
keytool -selfcert -keystore JavaFileUploader.ks -alias JavaFileUploader -validity 1500
javac JavaFileUploader.java
javac LinLyn.java
javac FTPUpload.java
jar cvfm JavaFileUploader.jar MANIFEST.MF *.class .java.policy JavaFileUploader.ks JavaFileUploader.txt
jarsigner -keystore JavaFileUploader.ks JavaFileUploader.jar JavaFileUploader
END
At the end I collect all my jar files (total of five: 4 already listed above and one-mine; JavaFileUploader.jar) and placed on the same directory where my asp pages are.
Right now this is what I'm getting from java console that bothers me and I think this is where all errors are hidden.
A. When my applet appears - java console shows this suspicious messages (ips are changed):
...
cache: Read manifest for http://11.11.111.11/APPNAME/JavaFileUploader.jar: read=423 full=423
Missing Permissions manifest attribute in main jar: http://11.11.111.11/APPNAME/JavaFileUploader.jar
security: Missing Codebase manifest attribute for: http://11.11.111.11/APPNAME/JavaFileUploader.jar
security: Missing Application-Library-Allowable-Codebase manifest attribute for: http://11.11.111.11/APPNAME/JavaFileUploader.jar
...
B. ...then, after I attempt to upload the file java console show this:
...
network: Connecting http://11.11.111.11:21/crossdomain.xml with proxy=DIRECT
network: Connecting http://11.11.111.11:21/ with proxy=DIRECT
network: Connecting http://11.11.111.11:21/crossdomain.xml with cookie "ABCDEFGHIJKLMN=QRSTUVWXYZ; LAID=1"
java.io.IOException: Invalid Http response
...
C. ...then few lines below, this:
...
java.security.AccessControlException: access denied ("java.net.SocketPermission" "11.11.111.11:21" "connect,resolve")
...
I have no clue why java reports "Missing Permissions manifest attribute in main jar" in the first place when I have "Permissions: all-permissions" set on my MANIFEST.MF file. Same for other "missing" attributes...(section A)
On my second section of errors (section B) I'm guessing that crossdomain.xml file not found. Otherwise I don't see anything that clould generate IOException. "Invalid Http response" is the further result from IOException error I guess.
On my third section of errors (section C) I have no clue whatsoever, because other errors above could drain and end up errors to complete irrelevant point.
Please let me know if you had this kind of problem and have a solution.
Thanks.
Here is the full content of the java console right after the applet appears:
Java Plug-in 11.45.2.15
Using JRE version 1.8.0_45-b15 Java HotSpot(TM) Client VM
User home directory = C:\Users\MY_USER_NAME
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter#1b1e125
security: Expected Main URL: http://11.11.111.11/APPNAME/JavaFileUploader.jar
basic: Plugin2ClassLoader.addURL parent called for http://11.11.111.11/APPNAME/JavaFileUploader.jar
Missing Permissions manifest attribute in main jar: http://11.11.111.11/APPNAME/JavaFileUploader.jar
security: Missing Codebase manifest attribute for: http://11.11.111.11/APPNAME/JavaFileUploader.jar
security: Missing Application-Library-Allowable-Codebase manifest attribute for: http://11.11.111.11/APPNAME/JavaFileUploader.jar
security: Validate the certificate chain using CertPath API
security: SSV validation:
running: 1.8.0_45
requested: null
range: null
javaVersionParam: null
Rule Set version: null
network: Created version ID: 1.8.0.45
network: Created version ID: 1.8.0.45
security: continue with running version
network: Created version ID: 1.8.0.45
network: Created version ID: 1.8
network: Created version ID: 8.0.45
security: Missing Codebase manifest attribute for:
http://11.11.111.11/APPNAME/JavaFileUploader.jar
security: Missing Application-Library-Allowable-Codebase manifest attribute for: http://11.11.111.11/APPNAME/JavaFileUploader.jar
security: Validate the certificate chain using CertPath API
basic: Applet loaded.
basic: Applet resized and added to parent container
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 549750 us, pluginInit dt 7116411154 us, TotalTime: 7116960904 us
basic: Applet initialized
basic: Starting applet
basic: completed perf rollup
basic: Applet made visible
basic: Applet started
basic: Told clients applet is started
Here are addition messages on java console right after I apply my upload method:
java.security.AccessControlException: access denied ("java.net.SocketPermission" "11.11.111.11:21" "connect,resolve")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin2.applet.SecurityManagerHelper.checkConnectHelper(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:182)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:203)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:296)
at FTPUpload.<init>(FTPUpload.java:21)
at JavaFileUploader.uploadWithFlexibleConnection(JavaFileUploader.java:311)
at JavaFileUploader.saveFileContent(JavaFileUploader.java:339)
at JavaFileUploader.actionPerformed(JavaFileUploader.java:531)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
OK. One error is gone. I've created an xml file, called 'crossdomain.xml' with following content:`
<?xml version="1.0" ?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
Error described on section B is gone.
Posted full content of java console messages are the most recent error messages. You can see my "suspected errors;" described as A (line 4 on the 1st part) and C (very 1st line in the 2nd part).
It's a good practice to sign all the .JARs (depedencies as well)
Try to include all the information below in your manifest:
<codebase>http://location.of.your.jar/</codebase>
<permissions>all-permissions</permissions>
<Application-Library-Allowable-Codebase>http://location.of.your.jar/</Application-Library-Allowable-Codebase>
<Manifest-Version>1.0</Manifest-Version>
<Implementation-Title>App Name</Implementation-Title>
<Implementation-Version>0.1.0</Implementation-Version>
<Application-Name></Application-Name>
<Created-By>1.8.0_45</Created-By>
<Main-Class>package.YourClass</Main-Class>
<mode>development (or production)</mode>
<url>url of the application</url>
Sorry to answer this as an 'answer' but I can't put comments. I'm currently working on an applet and this approach has worked fine.
I just installed a new version of Android Studio and am trying to create a project using the built in templates.
My environment is:
Windows 7, SP1, 64 bit
In a secure domain environment and I am a domain administrator on my machine.
Here is what I am seeing:
C:\Users\stuz\AndroidStudioProjects\test>gradlew compileDebug --stacktrace
Downloading file://C:/Users/stuz/.gradle/wrapper/dists/gradle-1.10-all.zip
Exception in thread "main" java.lang.RuntimeException: java.net.UnknownHostExcep
tion: C
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.net.UnknownHostException: C
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.ftp.impl.FtpClient.doConnect(Unknown Source)
at sun.net.ftp.impl.FtpClient.tryConnect(Unknown Source)
at sun.net.ftp.impl.FtpClient.connect(Unknown Source)
at sun.net.ftp.impl.FtpClient.connect(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Sour
ce)
at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
at org.gradle.wrapper.Download.download(Download.java:45)
at org.gradle.wrapper.Install$1.call(Install.java:60)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:65)
The problem is in your gradle/wrapper/gradle_wrapper.properties file. I'm not sure how it happened, but you have an improper URL in there for the downloadable distribution of Gradle. Change that line from this:
distributionUrl=file://C:/Users/stuz/.gradle/wrapper/dists/gradle-1.10-all.zip
to this:
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
This solution worked for me...
Find the file gradlew.bat on your project directory, in that file change DEFAULT_JVM_OPTS variable as below:
set DEFAULT_JVM_OPTS=-Dhttp.proxyHost=YOUR_HOST -Dhttp.proxyPort=PORT -Dhttp.proxyUser=USERNAME -Dhttp.proxyPassword=PASSWORD -Dhttps.proxyHost=YOUR_HOST -Dhttps.proxyPort=PORT -Dhttps.proxyUser=USERNAME -Dhttps.proxyPassword=PASSWORD
then run gradlew clean build.
Check if you are on secure network - if that is the case than in your gradle/wrapper/gradle_wrapper.properties file
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
this line have https in it which is refused by secure network.
I changed to unsecure network and it started working for me.
under you project folder go to : platforms/android/cordova/lib/builders/GradleBuilder.js
find distributionUrl and Remove https with http and replace "services" with "downloads".
distributionUrl=http\://downloads.gradle.org/distributions/gradle-2.4-all.zip
you need to use the windows style file URI to make it valid
Windows Reference for File URI
distributionUrl=file\:///C\:/Users/<your_path_separated_by_/_chars>/gradle-2.4-all.zip
After changing the distribution url to http://services.gradle.org/distributions/gradle-1.10-all.zip .
If you still get unknown host exception for services.gradle.org, try setting the HTTP / HTTPS proxy to your environmental variables . See the below post
https://stackoverflow.com/a/59045565/4468693
I'm dealing with a problem that I know where the problem is, but I don't know how to fix it. When I try to run the development server using Run As -> Web Application, I get the following error on the console:
Initializing App Engine server
Feb 07, 2014 8:39:07 AM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
SEVERE: Received exception processing C:\Users\JOSR\Last Hope\WEB-INF/appengine-web.xml
com.google.apphosting.utils.config.AppEngineConfigException: Could not locate C:\Users\JOSR\Last Hope\WEB-INF\appengine-web.xml
at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:140)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.readAppEngineWebXml(AppEngineWebXmlReader.java:75)
at com.google.apphosting.utils.config.EarHelper.readWebModule(EarHelper.java:166)
at com.google.appengine.tools.development.ApplicationConfigurationManager$WarModuleConfigurationHandle.readConfiguration(ApplicationConfigurationManager.java:399)
at com.google.appengine.tools.development.ApplicationConfigurationManager.<init>(ApplicationConfigurationManager.java:146)
at com.google.appengine.tools.development.ApplicationConfigurationManager.newWarConfigurationManager(ApplicationConfigurationManager.java:88)
at com.google.appengine.tools.development.DevAppServerImpl.<init>(DevAppServerImpl.java:139)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:258)
at com.google.appengine.tools.development.DevAppServerFactory.access$000(DevAppServerFactory.java:36)
at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:226)
at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:224)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:224)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:76)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:60)
at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:84)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)
Caused by: java.io.FileNotFoundException: C:\Users\JOSR\Last Hope\WEB-INF\appengine-web.xml (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:137)
... 23 more
I know that the path "C:\Users\JOSR\Last Hope\WEB-INF/appengine-web.xml" is wrong, should be "C:\Users\JOSR\Last Hope\war/WEB-INF/appengine-web.xml", but I don't know where to change it or how to force GWT to use the proper war path. Any ideas?
Thanks for reading!
from context-menu
Run As/Run Configuration and select your html ,choose Arguments tab
-war option is that.
I faced the same problem when I started using Maven in a GWT-GAE project.
In my case this problem happened because the eclipse launch file tries to load the appengine-web.xml from target/myproject/WEB-INF/appengine-web.xml but the files are in src/main/webapp/WEB-INF.
The solution is to uncheck the option "Launch and deploy from this directory (disabled because this is a Maven project)" from your project properties in Eclipse, even if this is really a maven project, like in the picture the option "WAR directory:" should point src/main/webapp
Important! Keep in mind, you have to build the project using maven before running the launch file, otherwise the folder target/myproject/WEB-INF/ will be empty.
Hi managed to create the jar and .jnlp files for my Java application but running into trouble when it runs. Launches okay with Java Web Start but I think I need to do something
extra as normally when I run it it doesn't ask for permission to access the HD for file I/O.
Would appreciate some help and advise to know what to do to get the permission rights i.e. what do I have to do is it something I have to do to all my classes not sure. The error
message I get in Java Web Start is as below.
Exception in thread "AWT-EventQueue-0" java.security.AccessControlException:
access denied (java.io.FilePermission StockDatabase;Stocks.dat read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.File.exists(Unknown Source)
at StockCodeDatabase.<init>(OptraderSA.java:782)
at OptraderSA.actionPerformed(OptraderSA.java:136)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unkno
You need to sign your JNLP file and configure the <security> element, as discussed here.
Add the following to your JNLP:
<security>
<all-permissions/>
</security>
This will pop a dialogue asking the user the give the necessary permission to your app.
If you want access to the file system you need to change your JNLP file to include:
<security><all-permissions/></security>
This requires you to also sign your jar files.
Another option is to package the file inside the jar as a resource and you don't have to do all that.