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.
Related
I have a Java program that reads and processes HDF5 files. I got the below error when I ran it on Eclipse (windows OS), and had to add a run configuration VM argument (-Dncsa.hdf.hdf5lib.H5.hdf5lib=\jhdf5.dll) to add the library and run properly. Now I'm exporting a runnable Jar file I get the error again, likely because it doesn't inherit the VM argument.
java.lang.UnsatisfiedLinkError: no jhdf5 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at ncsa.hdf.hdf5lib.H5.loadH5Lib(H5.java:347)
at ncsa.hdf.hdf5lib.H5.<clinit>(H5.java:274)
at ncsa.hdf.hdf5lib.HDF5Constants.<clinit>(HDF5Constants.java:28)
at ncsa.hdf.object.h5.H5File.<init>(H5File.java:99)
at ncsa.hdf.object.h5.H5File.<init>(H5File.java:132)
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 java.lang.Class.newInstance(Unknown Source)
at ncsa.hdf.object.FileFormat.<clinit>(FileFormat.java:229)
at hdf5Tool.HDF5Interface.readNodeStructureH5(HDF5Interface.java:73)
at wizardPages.DREAMWizard$STORMData$1.run(DREAMWizard.java:340)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Based on this post, I see that two possible options are to create a shell script or application bundle to incorporate the VM argument.
However, I'm curious is there is a more simple way to identify the library for the runnable JAR file. Any suggestions?
Not sure if you have specific needs, but maybe check out jhdf.io it's a pure Java HDF5 library so doesn't require native libraries to be loaded. It should be simple to add to a Maven or Gradle project with standard dependencies.
It's quite an early stage but should support reading data from most HDF5 file, if it doesn't work open an issue.
Disclaimer: I am the author of jhdf so might be biased.
I am using ImageMagick to crop image file. I am deploying packed WAR with ImageMagick inside. searchForCmd() function of ProcessStarted class is unable to find the files of ImageMagick from WEB-INF/classes i.e.
file:/D:/Project/build/libs/proj-0.0.1-SNAPSHOT.war!/WEB-INF/classes!/ImageMagick-6.6.1-5
how can I access the convert.exe in packed war .
Below is the stacktrace.
org.im4java.core.CommandException: java.io.FileNotFoundException: convert
at org.im4java.core.ImageCommand.run(ImageCommand.java:219)
at com.os.util.helper.ImageCropHelper.cropImageByImageMagic(ImageCropHelper.java:316)
at com.os.util.helper.ImageCropHelper.cropImage(ImageCropHelper.java:375)
at com.os.action.UserAction.mntnUserAvatar(UserAction.java:2566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:899)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1544)
at ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:96)
at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:88)
at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1620)
at ognl.ASTMethod.getValueBody(ASTMethod.java:91)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at ognl.SimpleNode.getValue(SimpleNode.java:258)
at ognl.Ognl.getValue(Ognl.java:470)
at ognl.Ognl.getValue(Ognl.java:434)
WARs normally do no contain EXEs. If you have dependencies on external applications, they must be installed on the server (or in the container) where the WAR is deployed. Also consider that your Springboot can normally run on a Linux or a Windows server and the IM executable would be different for each...
Hello so I'm new with libraries and i followed a Youtube tutorial
https://www.youtube.com/watch?v=HRaJXVuZjRM
and he imports the libraries there and it works, i did too as he did and it works (when in eclipse), however the problem comes later, when i export the app (i always click package but have tried extract and doesn't work either), i cannot open the .jar file.
I have seen already countless threads with this problem, i searched on google and found this:
http://wiki.lwjgl.org/index.php?title=Setting_Up_LWJGL_with_Eclipse
which is basically what he did in the video, i open my manifest file inside of the jar file with 7zip and i get this:
``
Manifest-Version: 1.0
Rsrc-Class-Path: ./ jinput.jar jogg-0.0.7.jar jorbis-0.0.15.jar lwjgl.
jar slick.jar
Class-Path: .
Rsrc-Main-Class: com.tutorial.main.Game
Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader"
And if i run the application with the console i get this error:
Sun Dec 06 16:42:40 COT 2015 INFO:Initialising sounds..
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in
java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:95)
at org.lwjgl.Sys.<clinit>(Sys.java:112)
at org.lwjgl.openal.AL.<clinit>(AL.java:59)
at org.newdawn.slick.openal.SoundStore$1.run(SoundStore.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.openal.SoundStore.init(SoundStore.java:292)
at org.newdawn.slick.Sound.<init>(Sound.java:54)
at com.tutorial.main.AudioPlayer.load(AudioPlayer.java:17)
at com.tutorial.main.Game.<init>(Game.java:41)
at com.tutorial.main.Game.main(Game.java:159)
... 5 more
``
I suppose it means that it cannot find the libraries and stuff but i have already tried creating a lib folder and a natives folder inside, placing the stuff there and changing the manifest into this:
"
Manifest-Version: 1.0
Class-Path: lib/jinput.jar lib/jogg-0.0.7.jar lib/jorbis-0.0.15.jar
lib/lwjgl.jar lib/slick.jar
Main-Class: com.tutorial.main.Game
"
But it doesn't run it either, i really don't know what I'm doing wrong...
I found a temporal fix for anyone with this problem, remove the natives from eclipse (the native link) and then export and use JarSplice to generate the .jar, if you are using music and cannot open it just open the .jar create the folder you used for your files in your workplace (mine was res) and then drag the music files in there instead of outside... this is temporal since I'm sure there's better ways to do it.
I been working on this Servlet project all morning and now suddenly I cannot get eclipse to export the project to a war file. I tried restarting eclipse and cleaning the project but I just get the same result. Any ideas?
org.eclipse.core.runtime.CoreException: Extended Operation failure:
org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentExportOperation
at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard.performFinish(DataModelWizard.java:182)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:618)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.eclipse.ui.actions.ExportResourcesAction.run(ExportResourcesAction.java:180)
at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:546)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
org.eclipse.core.runtime.CoreException[0]: org.eclipse.core.commands.ExecutionException: Error exportingWar File
at org.eclipse.jst.j2ee.internal.archive.operations.J2EEArtifactExportOperation.execute(J2EEArtifactExportOperation.java:103)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl$1.run(DataModelPausibleOperationImpl.java:376)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:401)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:352)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.doExecute(DataModelPausibleOperationImpl.java:242)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.executeImpl(DataModelPausibleOperationImpl.java:214)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.cacheThreadAndContinue(DataModelPausibleOperationImpl.java:89)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.execute(DataModelPausibleOperationImpl.java:202)
at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard$1$CatchThrowableRunnableWithProgress.run(DataModelWizard.java:211)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException: IWAE0017E Unable to replace original archive: C:\Users\mark\uploads\myfirstjsp.war
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.cleanupAfterTempSave(ArchiveImpl.java:322)
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.saveAsNoReopen(ArchiveImpl.java:1182)
at org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentExportOperation.export(WebComponentExportOperation.java:54)
at org.eclipse.jst.j2ee.internal.archive.operations.J2EEArtifactExportOperation.execute(J2EEArtifactExportOperation.java:95)
... 10 more
Well I guess I should have read the whole error as it does say that the problem is it can't write to the file. The interesting part was what was causing the file to be locked. Firefox had the file open so eclipse couldn't write to the file. I have no idea why firefox had the file open though I was using it to upload the war file to the server.
I was trying to export a test of a game I am working on(that uses the Slick library), to send to my partners who lack any IDE, all went well with the export in eclipse, but when I try to run it from command prompt, this is what I get in return.
C:\Users\Noah\Desktop>java -jar test.jar
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:95)
at org.lwjgl.Sys.<clinit>(Sys.java:112)
at org.lwjgl.opengl.Display.<clinit>(Display.java:141)
at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
at org.nor.Main.main(Main.java:16)
... 5 more
C:\Users\Noah\Desktop>
Any idea what is going wrong?
NOTE: The project runs perfectly fine in eclipse.
You should read up on a "get started" guide on slick if you are going to use it. Slick has several dependencies who use dll's to communicate with opengl. You need to specify where those dll's are kept so these dependencies can load the dll's. I found this link that might help you do that..
You also need the native lwjgl library and point to it. The Export Jar functionality do not handle this.
Read up on the lwjgl manual for how to do this.
You have to add your jars either to:
the classpath in your java invocation
the Manifest.mf of your main jar
Java won't automatically load your jars until they are in one of these locations.
Try with File -> Properties -> Java Build Path -> Order and Export