Error: Tomcat 7 Configuration as Windows Service via tomcat7.exe - windows

I am attempting to run tomcat as a service. I am able to run it succesfully when I specify just a startpath or just jvmoptions. However, if I have both I am receiving the following error:
2013-04-25 11:34:01 Commons Daemon procrun stderr initialized
java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
at java.net.URLClassLoader$1.run(Unknown Source)
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 java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:236)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:426)
The commands I am running are as follows:
service.bat install WebServices
tomcat7 //US//WebServices --Startup=auto --DisplayName="Web Services"
tomcat7 //US//WebServices --StartPath="C:\Program Files\engine"
tomcat7 //US//WebServices --JvmOptions="-Xmx4g;-XX:PermSize=2048m;-XX:MaxPermSize=2048m"
As I stated, the service starts fine if I don't run the JvmOptions line, and it successfully writes log files to my startpath directory. Then if I don't include startpath it will also run correctly, and it just won't output to the startpath. The error only occurs when both variables are set.

The issue was that when I was changing the start path and assigning variables it was losing track of catalina home. So I added
-Dcatalina.home=apacheInstallLoc;-Dcatalina.base=apacheInstallLoc
to my JvmOptions and everything worked.

Related

Failed to start application WAS 8.5.5.10

My application failed to start with the below error on WebSphere Application Server 8.5.5.10 which was working on 8.5.5.5
[1/2/17 17:54:20:842 IST] 0000006f ecs W com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource org/reflections/scanners/MemberUsageScanner$1.class in archive WEB-INF/lib/reflections-0.9.10.jar
java.lang.RuntimeException
at org.objectweb.asm.MethodVisitor.visitParameter(Unknown Source)
at org.objectweb.asm.ClassReader.b(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
The application failes to start after deployment
The application failes to start when JVM starts
The same application is getting started manually from console.
When i put reflections-0.9.10.jar in shared library i am getting Failed to load webapp
Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: null
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:177)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:901)
... 73 more
Caused by: java.lang.RuntimeException
at org.objectweb.asm.MethodVisitor.visitParameter(Unknown Source)
at org.objectweb.asm.ClassReader.b(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
5.The application started when i move all the third party jars to shared libraries.
upgrade to 8.5.5.11, issue fixed in latest fixpack
http://www-01.ibm.com/support/docview.wss?uid=swg1PI60902
If you find any other solution in 8.5.5.10, please do let me know
The SystemOut.log file for the application server will indicate which version of the Java (JVM) is in-use. Verify whether the version of the class files in reflections-0.9.10.jar is greater than the version of the server JVM. The error you posted will occur whenever this condition is true.

Tomcat 7 : Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

I have installed tomcat7 in my windows xp pc and on starting the service, i cannot access localhost:8080 in my browser and found the following in tomcat7 log files.
2013-05-15 15:00:30 Commons Daemon procrun stderr initialized
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number
in class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Tomcat 7 requires a minimum of Java 6. The most likely cause is that you are trying to run Tomcat on Java 5 or earlier.
The alternative is that you have added something to your Tomcat install that has been compiled with a later version of Java that you are running. In this case, get a clean Tomcat install running first and then deal with the class version problem (either by running Tomcat with a later version of Java or by recompiling whatever it is you have added for Java 6 or earlier).

How to run WLST in windows?

I tried to run WLST (on Windows XP) but i always get java.lang.NoClassDefFoundError:
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/wlst
Caused by: java.lang.ClassNotFoundException: weblogic.wlst
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)
Could not find the main class: weblogic.wlst. Program will exit.
I tried to run *user_projects/domains/my_domain/bin/setDomainEnv.cmd* and *wlserver_10.3/server/bin/setWLSEnv.cmd* but without any success, i always get this NoClassDefFoundError when i run java weblogic.wlst myscript.py. What should i do?
To invoke WLST:
<WL_HOME>/common/bin/wlst.cmd myscript.py
Example:
C:/Oracle/Middleware/wlserver_10.3/common/bin/wlst.cmd myscript.py
The reason for your error is, weblogic.jar is not present in your CLASSPATH environment variable.
You don't need to do that every time you run the batch file.
From "My Computer" or "Computer" (depending on your version of Windows)
Click "Properties" or "System Properties"
Click "Advanced System Settings"
Add these user Environment Variables
WL_HOME=C:/Oracle/Middleware/wlserver_10.3
and
CLASSPATH=.;%WL_HOME%/server/lib/weblogic.jar

Maven infinispan quickstart

I compiled Infinispan quickstart and when I am trying to run I am getting following error
Exception in thread "main" java.lang.NoClassDefFoundError: Quickstart (wrong nam
e: org/infinispan/quickstart/embeddedcache/Quickstart)
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 java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
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)
Could not find the main class: Quickstart. Program will exit.
I am following this tutorial.
https://github.com/infinispan/infinispan-quickstart/tree/master/embedded-cache
Though I am not using any IDE so that I can learn how maven works with infinispan. From command prompt prompt I am using this command To compile,
mvn clean compile dependency:copy-dependencies -DstripVersion
and then, to run,
java -cp target/classes:target/dependency/* Quickstart
It is compiling successfully.
I have tried to compile and then run the quickstart from within target directory where the class file is kept. But I am getting the same error class found .....
Thanks
Meena
Anyhelp will be appreciated.
Try running with
java -cp target/classes:target/dependency/* org.infinispan.quickstart.embeddedcache.Quickstart

Starting teamcity 6.5 manually results in java.lang.NoClassDefFoundError

I try to start teamcity manually but I get an error:
*Exception in thread "main" java.lang.NoClassDefFoundError: jetbrains/buildServer
/agent/Check*
First I stop the windows service:
C:\>net stop tcbuildagent
The TeamCity Build Agent Service service is stopping..
The TeamCity Build Agent Service service was stopped successfully.
Then I start the agent:
C:\>C:\TeamCity\buildAgent\bin\agent.bat start
Exception in thread "main" java.lang.NoClassDefFoundError: jetbrains/buildServer
/agent/Check
Caused by: java.lang.ClassNotFoundException: jetbrains.buildServer.agent.Check
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)
Could not find the main class: jetbrains.buildServer.agent.Check. Program will
exit.
What is causing this issue?
It looks like your installation is broken, reinstalling TeamCity and the build agent should help.

Resources