I need Vecmath, so I went to Oracle to get the latest version of Java 3D. I didn't see a place to download a JAR, but it had an installer. I downloaded and ran it. I assume that the installer added the JAR as a JDK extension
I restarted Eclipse, and it sees that VecMath is present. However, it still complains:
Access restriction: The type Vector3f
is not accessible due to restriction
on required library C:\Program
Files\Java\jre6\lib\ext\vecmath.jar
Bummer. I am able to change it from a compiler error to a warning, but it crashes as soon as I try to run it. Although, I'm using this in conjunction with OpenGL, and the crash could have nothing to do with vecmath. I'm not sure. Here is the exception:
Exception in thread "Timer-0" javax.media.opengl.GLException: java.lang.RuntimeException: javax.imageio.IIOException: Can't read input file!
at com.jogamp.opengl.impl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:101)
at com.jogamp.opengl.impl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:192)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:164)
at javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:591)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:301)
at com.jogamp.opengl.util.AnimatorImpl.display(AnimatorImpl.java:50)
at com.jogamp.opengl.util.Animator.display(Animator.java:154)
at com.jogamp.opengl.util.FPSAnimator$1.run(FPSAnimator.java:95)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Caused by: java.lang.RuntimeException: javax.imageio.IIOException: Can't read input file!
at cs4620.nth23.assignment1.GraphicsApp.loadTextures(GraphicsApp.java:98)
at cs4620.nth23.assignment1.GraphicsApp.init(GraphicsApp.java:65)
at com.jogamp.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:111)
at com.jogamp.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:124)
at javax.media.opengl.awt.GLCanvas$InitAction.run(GLCanvas.java:643)
at com.jogamp.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:273)
at javax.media.opengl.awt.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:674)
at java.awt.event.InvocationEvent.dispatch(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)
Caused by: javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(Unknown Source)
at cs4620.nth23.assignment1.GraphicsApp.loadTextures(GraphicsApp.java:95)
... 14 more
I'm using:
x84 Windows 7
Eclipse Helios
JavaSE-1.6
JDK 1.6
What am I doing wrong here?
The exception was caused by being unable to find a file referenced in the code - it has nothing to do with VecMath.
The app runs fine, despite the access restrictions. I don't know if it'll come back to bite me later or what.
Related
My actual problem is a derivation of the title, but the title is the root cause of my issue:
I am developing a java web application at work. The server my application is to be deployed on, only accepts java 6 or lower (WebLogic 10.3.2)
I need to call a web service in my application. My experience in this area is limited. I have been able to make it work, but when I integrated my code into the web application, compiled and tested it, I got this error:
Exception in thread "main" java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl cannot be cast to java.lang.Class
at com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.createArrayInfo(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.createArrayInfo(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.getTypeInfo(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.ElementInfoImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.RuntimeElementInfoImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.createElementInfo(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.createElementInfo(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.RegistryInfoImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.addRegistry(Unknown Source)
at com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.getTypeInfo(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
at com.sun.xml.internal.bind.api.JAXBRIContext.newInstance(Unknown Source)
at com.sun.xml.internal.ws.developer.JAXBContextFactory$1.createJAXBContext(Unknown Source)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(Unknown Source)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(Unknown Source)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.postProcess(Unknown Source)
at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at javax.xml.ws.Service.getPort(Unknown Source)
at com.example.mypackage.MyClient.invokeService(MyClient.java:64)
at Test.main(Test.java:7)
I have traced this error back to being a java version issue. It works in 7, but the Exception is thrown on method execution, if I compile in 6, which I have to do for the web app. The line where my exception is thrown, is the one with NotificationRecieverSoapInterface.class below:
NotifikationRecieverSoap service = null;
try {
service = new NotifikationRecieverSoap(new URL("[myURL].svc?wsdl"));
} catch (MalformedURLException e) {
e.printStackTrace();
}
NotificationRecieverSoapInterface notificationService = service.getPort(NotificationRecieverSoapInterface.class);
notifikationService.createNotificationRequest(logHeader, loginModule, parmV, priority, recipients);
The Service.getPort()-method seems identical in the two java versions, so I'm at a loss there. the sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl are also identical in 6 and 7.
The closest thing I found to a similar problem online, was this: http://forum.spring.io/forum/spring-projects/container/26020-classcastexception-genericarraytypeimpl-cannot-be-cast-to-class. Unfortunately, the solution here was that there is a bug in Spring, which I am not using...
Does anyone know more specifically what my problem is, and if it can be worked around, using only Java 6?
I do have a lot more code to show. I have chosen the parts I think is most relevant to the problem. I can provide jax-ws-generated classes for data structure, or sample xml's as well, on request.
Ok... I used this method to generate the web service classes: http://www.mkyong.com/webservices/jax-ws/jax-ws-wsimport-tool-example/
I realized that I had used a 1.7 JDK when calling the wsimport.exe. This was incompatible with my 1.6 project. After regenerating the classes with the wsimport.exe found in the correct JDK 1.6, the java classes were slightly different, and compatible with my project's setup.
I looked at the demos and built my own zombie simulator as described in the documentation, but an error keeps coming up and I'm pretty sure its not to do with my code since I just copied it from the docs for the zombie simulator and opened the demos repast provides.
when I run the simulator it gives me this error
2014/10/03 16:05:19,354: Scenario Load Error
repast.simphony.scenario.ScenarioLoadException: ParseError at [row,col]:[5,21]
Message: Open quote is expected for attribute "{1}" associated with an element type "type".
at repast.simphony.scenario.ScenarioLoader.load(ScenarioLoader.java:220)
at repast.simphony.ui.RSApplication.open(RSApplication.java:353)
at repast.simphony.ui.RSAppConfigurator.postWindowOpen(RSAppConfigurator.java:39)
at saf.core.ui.GUICreatorDelegate.runDisplay(GUICreatorDelegate.java:188)
at saf.core.ui.GUICreator$1.run(GUICreator.java:18)
at simphony.util.ThreadUtilities$Runner.run(ThreadUtilities.java:33)
at simphony.util.ThreadUtilities.runInEventThread(ThreadUtilities.java:47)
at saf.core.ui.GUICreator.runDisplay(GUICreator.java:16)
at repast.simphony.ui.RSUIPlugin$1.run(RSUIPlugin.java:104)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(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.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)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[5,21]
Message: Open quote is expected for attribute "{1}" associated with an element type "type".
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(Unknown Source)
at com.sun.xml.internal.stream.XMLEventReaderImpl.nextEvent(Unknown Source)
at repast.simphony.scenario.data.ContextFileReader.read(ContextFileReader.java:40)
at repast.simphony.scenario.ScenarioLoader.load(ScenarioLoader.java:126)
... 22 more
Also on the eclipse console it gives me this error before repast starts
Oct 03, 2014 4:05:01 PM java.util.prefs.WindowsPreferences
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
I just can't figure out what is going on but I need to solve the problem soon because I need to work with repast for a uni project.
Thank you for any help :)
The first error is not a coding error but a parsing error - it is likely a typo in your context.xml file (the error message indicates line 5, column 21). Did you edit it as advised on pages 18-20 of the repast getting started guide? Without seeing your context.xml file, I can't say exactly what the error is in it - if you want to add the first 5 lines of it then we can probably diagnose.
The second message (warning, not error) on the console window is common and is not associated with the first error. This answer might help if you want to get rid of it - however I have not experienced any problems with leaving it there.
I am using Netbeans 7.3, JRE 1.7.0_11, Java SE 7 update 40, on Mac 10.8.5.
I have created a JApplet GUI form which I have embedded in a applet tag within a HTML doc,
which I have created in a Java Wed application.
When I try to run in Safari I get the following error:
java.lang.NoClassDefFoundError org/jdesktop/layout/GroupLayout$Group
I have searched the net, it seems a common issue, ive found that some people resolved this error by changing :
Preferences-Java-GUI Builder - Layout Generation Style from Automatic to Swing Layout Extension Library. (from Automatic) & also tried importing swing.groupLayout but netbeans flags as a unused import.
But I am still getting the same error.
Any feedback appreciated.
I have also posted this same question on code ranch and submitted it to netbeans forum but have had no luck to date.
Update:
So scratched that for now idea for now and tried a basic app with a simple paint method that paints 'Hello', did not load on a Mac OS 10.8 and on windows 7 got the following error:
Exception in thread "AWT-EventQueue-2"
java.lang.IllegalStateException: Applet's parent container not set up
at sun.plugin2.applet.Plugin2Manager.start(Unknown Source)
at sun.plugin2.main.client.PluginMain$StartAppletRunner.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(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.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)
Update:
Confirmed these basic applets are working on other PCs on all browsers so it has to be the settings of my own Mac 10.8, i have already check the security settings for java and they are set a medium, any ideas?
As the other post indicated, AjaxSwing supports all layouts (because it simply reads components coordinates).
If you get NoClassDefFoundError that means you haven't copied the .jar files to the right directory. You can either copy it to a directory on AjaxSwing CLASSPATH or specify them via agent.classPath. See documentation for more information.
Any fix to avoid this exception while starting WLDF Console? Thanks.
java.lang.ClassFormatError: Incompatible magic value 218762506 in class file com/bea/diagnostics/dashboard/ChartPanelApplet
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassFormatError: Incompatible magic value 218762506 in class file com/bea/diagnostics/dashboard/ChartPanelApplet
There is an earlier Sun bug report on this issue, with JDK 1.4
you are mostly running JDK 1.6 but take a look at the bug report.
Short Summary (gleaned from this forum) :
The Java plug-in of your browser tries
to get some .class file from the
current location (your server) and
fails because your server returns some
custom 404 page. Let's try to check
the Java console to see what really is
requested. Please, run the Java
console, set the trace level to 5
(highest level).
Enable the Java console on Windows for IE browser and see if it gives a detail on which URL is giving the 404 or some other error.
Further Reading
Oracle forum question
I want to create an excutable file for my java project, previous time I do it by Jbuilder or netbean as I remember but I dont know how I should do it in JDeveloper to make Excutable file(EXE file)
please advice me, please describe clearly...
EDIT:
It's simple desktop application.it is not web application....
EDIT2:
I remove that part for checking argument and run my program I face with this problem:
what should I do?
Executing: C:\JDeveloper\mywork\SourceManagmentTools\Client\deploy\SMT.exe
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: oracle/jdeveloper/layout/VerticalFlowLayout
at Main.GUI.SmMainFrame.<init>(SmMainFrame.java:134)
at Main.GUI.SmRun.<init>(SmRun.java:25)
at Main.GUI.SmRun$1.run(SmRun.java:82)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$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)
Caused by: java.lang.ClassNotFoundException: oracle.jdeveloper.layout.VerticalFlowLayout
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
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)
... 17 more
Have you considered Launch4j?
Regarding your configuration problem, the Launch4J documetation says:
Additional JVM options at runtime
When you create a wrapper or launcher
all configuration details are compiled
into the executable and cannot be
changed without recreating it or
hacking with a resource editor.
Launch4j 2.1.2 introduces a new
feature that allows to pass additional
JVM options at runtime from an
.l4j.ini file. Now you can specify the
options in the configuration file, ini
file or in both, but you cannot
override them. The ini file's name
must correspond to the executable's
(myapp.exe : myapp.l4j.ini). The
arguments should be separated with
spaces or new lines, environment
variable expansion is supported, for
example:
# Launch4j runtime config
-Dswing.aatext=true
-Dsomevar="%SOMEVAR%"
-Xms16m
Other alternatives that you may consider are JSmooth,WinRun4J.
If your desktop application has a GUI, and you can distribute it from a site, look to Java Web Start.
JWS provides a 'one-click' installation option for the end user, automatic updates, desktop integration, splash screens and much more. It is part of the standard Java(1) distribution (since 1.4.2) & is supported by Oracle.
(1) JWS works with standard Jar files - no exe needed, which means it will work on *nix & Mac.
it so simple guys...
I solved my problem in this way...simplest way....
first of all check the version of java that installed in your client computer, you check by this command in CMD:
java -version
after you make sure about java version you need to make a bat file. [conflict in version maybe cause null except] after that you should know which external package u used in this project... for example I used 1 file for connecting to oracle database "ojdbc14" and the other for GUI, after that you can simply run your program or even pass parameter to them by just mention them at end of name of runable of your class:
java -client -classpath ojdbc14.jar;lipstikLF-1.1.jar;swing-layout.jar;smt.jar Main.GUI.SmRun rimrim
I guess those library we used in our project need also run, but I am not sure, I just suggest this work
java -client -classpath <name of you library>;<name of you library>;<name of your jar file> nameOfPackage.nameOfRunClass parameter[if any]
I will so appreciate if anybody add some useful info to this post