im getting this error when starting my tomcat 7
can someone help me?
Mar 03, 2014 5:07:31 PM org.apache.catalina.startup.Bootstrap initClassLoaders
SEVERE: Class loader creation threw exception
java.io.IOException: Invalid argument
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.Win32FileSystem.canonicalize(Unknown Source)
at java.io.File.getCanonicalPath(Unknown Source)
at java.io.File.getCanonicalFile(Unknown Source)
at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:171)
at org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:176)
at org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:103)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:208)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:406)
not sure if this is your problem but I received a similar error trying to starup Tomcat 6.
The problem was caused by this line in the catalina.properties file:
shared.loader=${catalina.base}/lib/*.jar,${catalina.base}/shared/classes,${catalina.home}/shared/lib/*.jar
You cant see it but there is an unprintable character following the *.jar which was being read as an invalid argument.
After I deleted that character Tomcat came up sucessefully.
I had a similar issue and it was a ending back slash issue \ in CATALINA_HOME environment variable.
https://stackoverflow.com/a/22209500/1383538
Maybe a bit late; but for anyone else who may have this problem; it
turned out i had put a backslash \ at the end on my CATALINA_HOME
environment variable (I was using windows). When i removed it, i could
start using catalina run command.
https://stackoverflow.com/a/28261336/1383538
Had a similar issue with Tomcat 8 and Java 8 on Windows 8, and after
little bit of playing around, I noticed that CATALINA_HOME was set as
"CATA_HOME=c:\mydir\tomcat.8.0\"
I just changed it to CATA_HOME=c:\mydir\tomcat.8.0" and it fixed all
the issues. I never thought ending back slash would cause the issue
but there you are...it did!!!
Related
I am unable to start Tomcat 8.0 64-bit server. I have catalina.bat run also. I am getting the below message.
01-Oct-2014 10:22:11.415 SEVERE [main] org.apache.catalina.startup.Bootstrap.ini
tClassLoaders Class loader creation threw exception
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:428)
at java.io.File.getCanonicalPath(File.java:618)
at java.io.File.getCanonicalFile(File.java:643)
at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:165)
at org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:201)
at org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:146)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:256)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Could you please advise?
Had a similar issue with Tomcat 8 and Java 8 on Windows 8, and after little bit of playing around, I noticed that CATALINA_HOME was set as "CATA_HOME=c:\mydir\tomcat.8.0\"
I just changed it to CATA_HOME=c:\mydir\tomcat.8.0" and it fixed all the issues. I never thought ending back slash would cause the issue but there you are...it did!!!
I managed to solve this problem by deleting the server and creating a new one. Much simpler than trying to diagnose what went wrong.
Check if you didn't miss any quotation mark(s) around commas in catalina.properties. In my case it was: ...,"${catalina.home}/lib/*.jar,${catalina.base}/../lib/*.jar" instead of ...,"${catalina.home}/lib/*.jar","${catalina.base}/../lib/*.jar".
Faced similar issue.
Modified my CATALINA_HOME path as below:
Previous:
CATALINA_HOME=D:\Personal\Projects\Apache\apache-tomcat-7.0.37-windows-x64\apache-tomcat-7.0.37\
Changed to:
CATALINA_HOME=D:\Personal\Projects\Apache\apache-tomcat-7.0.37-windows-x64\apache-tomcat-7.0.37
VOILA!
It worked.
Today I have faced the same issue. I have defined my sources files in catalina.properties near server.loader=C:\aaconfigs\appconfigs,C:\aaconfigs\appParams.
this caused the issue. When i changed it to following server.loader=C:/aaconfigs/appconfigs,C:/aaconfigs/appParams. error got resolved.
I hope this will be helpful.
I had the exact same issue and just deleted the server from my workspace and added a new one, didnt get the error again. Its working fine for now.
It seems like this must have been answered, but I just spent an hour going through old questions, some of which sound just like mine, but my issue isn't solvable by the methods given.
Basically, I've got a default installation of Apache Tomcat 7.0.50 and when I go to localhost:8080, all I get is a blank page. In fact, if I try to go anywhere on localhost:8080 (not just the default start page), I get a blank page. When I shut Tomcat down, netstat -anf inet shows nothing connected to port 8080, so only Tomcat is using that port.
catalina.2014-01-16.log contains the following at any point at which I tried to load a page:
Jan 16, 2014 1:28:18 PM org.apache.coyote.http11.AbstractHttp11Processor process SEVERE: Error processing request
java.lang.NoSuchFieldError: IS_ERROR
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:456)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
At the exact same time, localhost.2014-01.16.log contains this stack trace (which I shortened because you don't need the whole thing):
Jan 16, 2014 1:28:18 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception
[javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.tomcat.util.http.parser.HttpParser.parseMediaType(Ljava/io/StringReader;)Lorg/apache/tomcat/util/http/parser/MediaType;] with root cause
java.lang.NoSuchMethodError: org.apache.tomcat.util.http.parser.HttpParser.parseMediaType(Ljava/io/StringReader;)Lorg/apache/tomcat/util/http/parser/MediaType;
at org.apache.tomcat.util.http.parser.MediaTypeCache.parse(MediaTypeCache.java:54)
at org.apache.catalina.connector.Response.setContentType(Response.java:805)
at org.apache.catalina.connector.ResponseFacade.setContentType(ResponseFacade.java:245)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:51)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at ...
I note it's a NoSuchMethodError. It seems like I must have a strange mix of libraries, but it's a default installation. I'm at a complete loss.
What version of jdk did you use to run tomcat? Was it OpenJDK, Oracle JDK? Try running tomcat using Oracle JDK 1.6 or 1.7
What OSX user did you use to run tomcat? Have you made sure it has all sufficient permission to read/write files into the directory?
Resolved. It turned out that someone had copied some other libraries into the Tomcat lib directory and I didn't realize it when upgrading. These other libraries are not compatible with Tomcat 7. Removing the offending jars fixed the issue.
We are getting the following error in catalina.out file when we restart our application with newrelic java agent configured.
We have followed the steps specified in newrelic installation guide and following is the entry created in catalina.sh by newrelic installer:
# ---- New Relic switch automatically added to start command on 2013 Dec 09, 20:24:35
NR_JAR=/usr/share/fk-ops-tomcat6-base/newrelic/newrelic.jar; export NR_JAR
JAVA_OPTS="$JAVA_OPTS -javaagent:$NR_JAR"; export JAVA_OPTS
Exception on app restart in catalina.out:
Error bootstrapping New Relic agent: java.lang.RuntimeException: java.io.IOException: No such file or directory
java.lang.RuntimeException: java.io.IOException: No such file or directory
at com.newrelic.bootstrap.BootstrapLoader.load(BootstrapLoader.java:95)
at com.newrelic.bootstrap.BootstrapAgent.premain(BootstrapAgent.java:93)
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 sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
Caused by: java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1704)
at java.io.File.createTempFile(File.java:1792)
at java.io.File.createTempFile(File.java:1828)
at com.newrelic.bootstrap.BootstrapLoader.getJarFileInAgent(BootstrapLoader.java:81)
at com.newrelic.bootstrap.BootstrapLoader.addBridgeJarToClassPath(BootstrapLoader.java:47)
at com.newrelic.bootstrap.BootstrapLoader.load(BootstrapLoader.java:92)
... 7 more
I just encountered the same problem. The not very helpful error message alluded to the fact that the newrelic agent (or rather the user under which my server is running) wasn't able to write into /tmp. Maybe that helps!
I hit that exception with that stack trace recently, and in my case it was caused by the temporary directory not existing at all.
In particular: by default tomcat uses $CATALINA_BASE/temp as value for the java.io.tmpdir property, and seems to create that when needed. At the time the newrelic agent boots up however it may not yet exist, and so newrelic agent fails with that exception.
After restarting things are fine (now the directory exists!), but I solved in my startup scripts:
1. set the value of CATALINA_TMPDIR explicitly to something I control
2. ensure that directory exists before starting tomcat.
Make sure the newrelic.yml placed and marked readable in the same directory as the .jar
I work for New Relic.
As you've seen from the answers above, there can be multiple causes for this kind of message - some of which are pretty unexpected. Since this forum is not intended for back-and-forth messaging about incidents, in case neither of the previous two answers solved the problem for you, your best bet will be to open a ticket for support at http://support.newrelic.com where we can ask to look at your logfile and gather debug logs as necessary.
I had the same problem using apache version 6.0.33. Once I upgraded to 7.0.53 everything worked.
save problem.
But I found this:
Sep 09, 2015 11:19:48 AM org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /mnt/apache-tomcat-7.0.56/temp
then doing this:
mkdir /mnt/apache-tomcat-7.0.56/temp
cp /mnt/apache-tomcat-7.0.56/newrelic/* /mnt/apache-tomcat-7.0.56/temp
Everything works.
You may not need cp.
If you look at very early of Tomcat log (catalina.out) after NewRelic exception, you can see what folder is required that are missing. Here is mine:
May 29, 2017 5:04:31 PM org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /var/log/tomcat/tomcat7/temp
May 29, 2017 5:04:32 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.59
Hope this help
I am getting this Exception when i tried to run a java Application with the help of a Script
Caused by: java.lang.ClassNotFoundException: com.tata.topListQuoteSamples.TOPLISTSample not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/home/sai/NewgdpapiToplist1/lib/commons-logging-1.0.4.jar,file:/home/sai/NewgdpapiToplist1/lib/log4j-1.2.8.jar,file:/home/sai/NewgdpapiToplist1/lib/mail.jar,file:/home/sai/NewgdpapiToplist1/lib/marketdata-b1.1.jar,file:/home/sai/NewgdpapiToplist1/lib/middleware.jar,file:/home/sai/NewgdpapiToplist1/lib/gdpapi-all.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.7rh)
at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
at gnu.java.lang.MainThread.run(libgcj.so.7rh)
End time: Fri Mar 9 09:15:55 EST 2012
Basically you need to set the class path straight inside your script.
if you're executing java with "java.exe" (or whatever the linux equivalent) make sure you specify the class path (or if you're running that from the command line, make sure you either do that or are in the right folder)
I want to play around with glassfish on a Mac, but I'm having trouble getting it to start.
I've followed the installation instructions and created a default domain, which seemed to go fine, but when I try to start it (asadmin start-domain domain1) it just sits there:
[kris#Macintosh-2:~/glassfish] ./bin/asadmin start-domain domain1
Starting Domain domain1, please wait.
Default Log location is /Users/kris/glassfish/domains/domain1/logs/server.log.
Redirecting output to /Users/kris/glassfish/domains/domain1/logs/server.log
The log contains nothing but the command to launch the server:
Mar 12, 2009 7:09:40 PM com.sun.enterprise.admin.servermgmt.launch.ASLauncher buildCommand
INFO:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java
<crapload of system properties>
-client
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-Xmx512m
-XX:NewRatio=2
-XX:+LogVMOutput
-XX:LogFile=/Users/kris/glassfish/domains/domain1/logs/jvm.log
-cp
/Users/kris/glassfish/lib/jhall.jar:/Users/kris/glassfish/lib/appserv-launch.jar
com.sun.enterprise.server.PELaunch
start
Eventually, asadmin gives up waiting:
Timeout waiting for domain domain1 to go to starting state.
CLI156 Could not start the domain domain1.
This is using glassfish v2.1, but I get similar behaviour on v3 prelude. I've also tried both java 5 and 6. I'm at a loss as to what sort of debugging to do as it doesn't seem to be even getting off the ground.
I was able to start my glassfish for the first time, but the second time, it just gives me that weird error message that it could not start the domain.
Googling around, there was mention of a lock file in the imq.
Check if you have a file 'lock' in "/glassfish/domains/domain1/imq/instances/imqbroker/". If there is one, delete it, and then try to start glassfish again.
Also on the JMS front, have you tried changing your broker from EMBED to LOCAL in your domain.xml? I seem to remember that help on OS X.
Have you perhaps moved the glassfish installation dir since you first started it up? GF gets very confused about caching when you do this. Solution here.