I am running a java application on Apache Tomact 6.0.32 and rrunning successfully and same thing I am running on Test Server with same Apache Tomact 6.0.32 config and getting following exception, any help will be highly appreciated.
Caused by: java.lang.ClassNotFoundException: org.JSON.JSONException
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
I am already using JSON Parser.jar
JSON lib requires commons-lang and other libraries as mentioned below as mentioned here.
Json-lib requires (at least) the following dependencies in your class
path:
jakarta commons-lang 2.5
jakarta commons-beanutils 1.8.0
jakarta commons-collections 3.2.1
jakarta commons-logging 1.1.1
ezmorph 1.0.6
Are you sure you have added the above libraries.
#Vardan Gupta,You think the tomcat is the same ,but things would not be like the same.
If I were you,I would do like this:
Choice I):copy test server's tomcat 6.0.32 to the environment you run successfully, then test the war in this copy.
Choice II):Or you can try to copy the tomcat you run successfully to the test server and do the new test.
Thus,you would found out things.
In my experience,I would copy tomcat(run successfully copy) to the test server...
Related
I've written a simple javaagent that basically injects some logging in classes that are part of the JDK, such as javax/imageio/spi/ServiceRegistry, using javassist.
It works fine in a simple standalone application, but I cannot get it to work in WildFly 10. What I have tried:
Added the agent JAR as a module to WildFly along with the corresponding module.xml which declares <module name="org.javassist"/> as dependency
Appended the agent package and org.javassist to JBOSS_MODULES_SYSTEM_PKGS
Appended -javaagent:/full/path/to/agent/jar/in/module to JAVA_OPTS
WildFly starts but in server.log I get:
java.lang.NoClassDefFoundError: javassist/ClassPool
at net.luniks.agent.LoggerChanger.transform(LoggerChanger.java:48)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:1015)
at java.lang.ClassLoader.loadClass(ClassLoader.java:413)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.jboss.modules.ClassLoaderLocalLoader.loadClassLocal(ClassLoaderLocalLoader.java:74)
at org.jboss.modules.Module.loadModuleClass(Module.java:606)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
It seems the module class loader is used but even though the agent module has a dependency to org.javassist, it still cannot load its classes.
What am I missing?
Eventually I got it to work by adding only the package of the agent to JBOSS_MODULES_SYSTEM_PKGS (not "javassist") and adding the org.javassist module JAR to the boot classpath:
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:/path/to/wildfly/modules/system/layers/base/org/javassist/main/javassist-3.18.1-GA.jar"
Now the agent works, it can load the Javassist classes. Certainly not the clean way but it is just for debugging purposes...
I have built and deployed a war file in websphere 8.5 server. All axis 1.4 related jars are placed in WEB-INF/lib folder. However when I run the application and try to access the code that calls the webservice I get below error. Same war file works fine in TOMCAT 7 server. I do see that axis.jar exist and contains axisfault.class. Please help.
Caused by: java.lang.NoClassDefFoundError: org.apache.axis.AxisFault
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:93)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:170)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:179)
at org.uddi4j.transport.TransportFactory.getTransport(TransportFactory.java:61)
at org.uddi4j.client.UDDIProxy.send(UDDIProxy.java:1940)
at org.uddi4j.client.UDDIProxy.find_service(UDDIProxy.java:888)
at bofasecurity.UDDIHelper.getEndPoint(UDDIHelper.java:70)
at bofasecurity.xxxxSecurityWrapper.buildBofASecurityWrapper(BofASecurityWrapper.java:273)
at bofasecurity.xxxxSecurityWrapper.<init>(BofASecurityWrapper.java:212)
at bofasecurity.xxxxSecurityWrapper$Builder.build(BofASecurityWrapper.java:179)
at com.ml.grci.service.impl.SearchACCLServiceImpl.buildSecWrapper(SearchACCLServiceImpl.java:721)
at com.ml.grci.service.impl.SearchACCLServiceImpl.searchACCL(SearchACCLServiceImpl.java:160)
at com.ml.grci.webapp.action.ACCLSearchAction.execute(ACCLSearchAction.java:233)
... 83 more
Caused by: java.lang.ClassNotFoundException: org.apache.axis.AxisFault
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:650)
This is likely due to a classloader issue. WebSphere 8.5 loads axis.jar (see /deploytool/itp/plugins/org.apache.axis_1.4.0.v201005080400/lib). Would recommend either removing the conflicting jar or changing the class loader policy (PARENT LAST). See how to set java class loader PARENT_LAST
Also not sure if this would help, but if you're trying to do web services using a third party framework there's a very good article on how to do this: http://www.ibm.com/developerworks/websphere/library/techarticles/1001_thaker/1001_thaker.html
The tutorial code from
http://doc.akka.io/docs/akka/2.0.2/intro/getting-started-first-java.html
Will not run. I have imported the required libraries but get the error:
Exception in thread "main" java.lang.NoClassDefFoundError: com/typesafe/config/ConfigFactory
at akka.actor.ActorSystem$.apply(ActorSystem.scala:93)
at akka.actor.ActorSystem$.create(ActorSystem.scala:56)
at akka.actor.ActorSystem.create(ActorSystem.scala)
at Pi.calculate(Pi.java:152)
at Pi.main(Pi.java:15)
Caused by: java.lang.ClassNotFoundException: com.typesafe.config.ConfigFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 5 more
Anyone know how to get this working? I'm trying to run it in Eclipse.
Note: I'm running akka 2.1.2
The problem is that you are not actually using Akka 2.0.2: the Config library only became an external dependency in 2.0.3. Since you are getting started with Akka, may I suggest you look at the latest stable version 2.1.2 instead?
Concerning the problem at hand: you will need to add the artifact "com.typesafe"/"config" to your classpath (the exact version depends on which Akka version you are using, I suggest using a dependency management tool like Maven or SBT).
Here's a link to the documentation (including required Scala versions etc) for each major version of Akka: http://akka.io/docs/
I upgraded AE to 1.7.2 and now get the following error when first trying to access a page:
What can I do to get 1.7.2 working???
Could not initialize class com.google.appengine.tools.appstats.RecordingData
Caused by:
java.lang.NoClassDefFoundError: Could not initialize class
com.google.appengine.tools.appstats.RecordingData
at com.google.appengine.tools.appstats.Recorder.makeAsyncCall(Recorder.java:300)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:115)
at com.google.appengine.tools.appstats.AppstatsFilter.call(AppstatsFilter.java:231)
Note: the "RecordingData" class that could not be initialized is in the appengine-api-labs.jar is definately in my build path only now it is not working. I guess though that the Could not initialize class error means it's being found but not working. the NoClassDefFoundError is misleading I suspect.
I had the same issue recently, I started working on an existing AppEngine project which had been using the 1.7.1 API. I had a new eclipse setup using the newest plugin (1.7.2.1 at the time of writing).
In my case there was an older copy of the labs jar (appengine-api-labs.jar) in the build path. Deleting this and replacing it with the version from the AppEngine SDK in current use resolved the issue.
You'll find the labs jar in your eclipse plugins directory under: appengine-java-sdk-[X.X.X.X]\lib\impl).
Once you have replaced the jar do a clean build and you should be laughing.
On Weblogic 10.3 my enterprise application includes a webservice that runs ant scripts inside. My problem is that I cannot get my custom tasks running due to java.lang.ClassNotFoundExceptions.
(All this works well on Tomcat 5.5)
My task implementation can be found in 4 different locations:
something.ear/APP-INF/lib/antaddon.jar!/foo/bar/MyTask.class
something.ear/Webservice.war/WEB-INF/lib/antaddon.jar!/foo/bar/MyTask.class
something.ear/Webservice.war/WEB-INF/classes/foo/bar/MyTask.class
server/lib/antaddon.jar!/foo/bar/MyTask.class
I see that the Weblogic 10.3 integrated Ant 1.6.5 module might cause problems
as I have an Ant 1.8.0 bundled, so I added
<prefer-application-packages>
<package-name>antlr.*</package-name>
<package-name>org.apache.ant.*</package-name>
<package-name>org.apache.zip.*</package-name>
</prefer-application-packages>
to my weblogic-application.xml to overcome this. (This solved some NoSuchMethodErrors..)
However my Task is still not found:
java.lang.ClassNotFoundException: foo.bar.MyTask.class
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:457)
at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:183)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
can you help me how to solve this?
The problem was that my prefer-application-packages directive was wrong, ant classes are not in org.apache.ant.* but in org.apache.tools.ant.*. After repairing this my custom class gets loaded and works well from APP-INF/lib/antaddon.jar