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
Related
I am a new programmer trying to deploy my Java web application to a web host for the first time. I started trying to do it with Jelastic but I need file storage, not just a .jar file, and it looks like you have to pay a LOT to upgrade.
If you know of a way I can upload my application and also store a single .png (image) file so my application can overwrite it by accessing the URL please let me know. I don't mind paying X money for a host but $150 or whatever is crazy.
In the meantime I found that Google App Engine lets you upload a Java application. I have been trying to do this for maybe 3 hours.
I am stuck with the error:
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=animelist1&version=1&
404 Not Found
This application does not exist (app_id=u'animelist1').
I have checked that I am logged in under the correct Google account (no others, and rebooted and used CCleaner to clear my browser cache), that I have an empty project in Google App Engine called "animelist1" and have checked that my application is called "animelist1" with the appengine-web.xml with "animelist".
I am using the netbeans plugin to deploy to Google. I have the correct email set there.
There are many people with this issue who fixed it the same way. However as I am a beginner I am unable to figure out how to do this method. The method is
This application does not exist (app_id=xxx)
Google App Engine : this application does not exist
(and many others with similar answers)
The method is "appcfg.py update --no_cookies MyProjectDirectory/" or "appcfg.py update . --no_cookies"
Can you please assist me in doing this?
I have located appcfg.py at
C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine
there is another one at
C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools
there is also a appcfg_java.py here but we can come to that later if need be.
I have tried using the Google Cloud SDK Shell (which looks like the cmd console) to navigate to the directory and type those commands. This opens the file in a text file and doesn't seem to do anything else.
I believe I may have to find the appcfg relevant to my application/project (but I'm not sure). When I do a computer search for the file I get 8 files with that name returned:
image
All I want to do really is upload my Java Glassfish web application, then upload a .png file so I can point my application to it (it will overwrite the file).
I thought about changing my application to run on Tomcat because I thought I saw there was a free Java host that allows tomcat. That was several hours ago now because I have been headbutting this thing so maybe I should just abort and try that instead. Or if you know of a host that doesn't cost $150+ let me know. I don't know why they said they cost that, I thought you could host really cheaply.
Please help, thankyou!!!!
The full code of my error is below. I don't know why there is an error about System Java Compiler, I just checked my environment after messing it up, saw it hadn't saved, then rebooted, and now it is saved. I have a JAVA_HOME system variable set to C:\Program Files\Java\jdk1.8.0_40 and my Path system variable is
C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Java\jdk1.8.0_40
(maybe I don't need both, not sure). I have nothing else set there, nothing in User Variables though I will double check if that is needed.
Here is my full error log:
********************************************************
There is a new version of the SDK available.
-----------
Latest SDK:
Release: 1.9.19
Timestamp: Thu Feb 19 23:57:40 GMT 2015
API versions: [1.0]
-----------
Your SDK:
Release: 1.9.18
Timestamp: Thu Feb 12 19:30:16 GMT 2015
API versions: [1.0]
-----------
Please visit https://developers.google.com/appengine/downloads for the latest SDK.
********************************************************
Reading application configuration data...
Apr 20, 2015 6:51:40 AM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:/Users/J/Documents/NetBeansProjects/g5/target/animelist1-1.0-SNAPSHOT\WEB-INF/appengine-web.xml
Apr 20, 2015 6:51:40 AM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:/Users/J/Documents/NetBeansProjects/g5/target/animelist1-1.0-SNAPSHOT\WEB-INF/web.xml
Beginning interaction for module default...
Apr 20, 2015 6:51:40 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=animelist1&version=1&
404 Not Found
This application does not exist (app_id=u'animelist1').
This is try #0
Apr 20, 2015 6:51:40 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=animelist1&version=1&
404 Not Found
This application does not exist (app_id=u'animelist1').
This is try #1
Apr 20, 2015 6:51:41 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=animelist1&version=1&
404 Not Found
This application does not exist (app_id=u'animelist1').
This is try #2
Apr 20, 2015 6:51:41 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=animelist1&version=1&
404 Not Found
This application does not exist (app_id=u'animelist1').
This is try #3
0% Created staging directory at: 'C:\Users\J\AppData\Local\Temp\appcfg8900677438454325367.tmp'
5% Scanning for jsp files.
8% Compiling jsp files.
Error Details:
Apr 20, 2015 6:51:42 AM org.apache.jasper.JspC processFile
INFO: Built File: \index.jsp
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
Unable to update app: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
Please see the logs [C:\Users\J\AppData\Local\Temp\appcfg6599854602413633444.log] for further information.
I have an empty project in Google App Engine called "animelist1"
If you mean that you've used the SDK set up a local project, then you might have missed a step. When you visit http://appengine.google.com/ , does "animelist1" appear in the list of your applications? If not, you'll need to click the Create Application button (and hope that someone else hasn't already used that appid).
No project with ID 'animelist1' currently exists, but this ID is not available (it could exist in the past, but was deleted). If you already created the project your App ID is the same as Project ID, not Project name. If you didn't yet create the project, create one either in the old App Engine console as suggested by Dave or as per manual.
This is an credentials issue in most cases when you download code from already exsit project.
Make sure you have only one google account login your default browser.
Go to your lib/appengine-java-sdk-<version>/bin/ and run:
appcfg --no_cookies update <project-dir>
Note: early appcfg version command may like :appcfg update --no_cookies <project-dir>
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.
I'm new in Jade and study Jade Primer. I'm using the latest version Jade v4.2.
I'm trying to set up two behaviours, each coded to receive messages. I should run them in two separated windows, but it doesn't work for me.
I'm using Eclipse on WinXp. I have entered classpath to Jade
c:\jade\lib\jade.jar;C:\jade\lib\commons-codec\commons-codec-1.3.jar;C:\Program Files\Java\jre7\bin
and to folder containing my projects
C:\Users\me\workspace\jadeProject\src
There is folder primer4 (package added to Java code), where I put my Java files.
I compiled Java files by javac from console.
Then I tried to run from the console (from primar4 folder):
%java jade.Boot -agents a1:primer4.Responder;a2:primer4.Responder
The First command is working. Then I run second console window and put:
%java jade.Boot -container main:primer4.Template
INFO: Service jade.core.event.Notification initialized
pač 19, 2012 4:35:57 PM jade.core.AgentContainerImpl startBootstrapAgents
SEVERE: Cannot create agent main: Class primer4.Template for agent ( agent identifier
:name main#10.0.2.15:1099/JADE ) not found [nested java.lang.ClassNotFoundException: primer4.Template]
pač 19, 2012 4:35:57 PM jade.core.AgentContainerImpl joinPlatform
INFO: Agent container Container-2#10.0.2.15 is ready.
I got this error, can somebody tell me:
How can I fix it?
Is possible to run agents in two containers from one line in console (in one console, the same time)?
Try the -agents option in the second command:
java jade.Boot -container -agents main:primer4.Template
This is by the Classpath problem. So please make sure the directory which is having your .class files in the classpath.
you can create one agent per container by the
-container option.
or you can create the agents by
jade.core.Runtime runtime = jade.core.Runtime.instance();
jade.wrapper.AgentContainer home = runtime.createAgentContainer(new ProfileImpl());
home.createNewAgent(getName(), Agent.class.getName(), args);
Like this you can create the agents and add dynamically.
I have my war running on tomcat in a context path - say /path1.
I've made some more changes to my codebase, added more classes, jars etc, and now without disturbing the first war that is running on /path1, i want to add this war to /path2.
Can this be done?
Because when I tried this the second war is failing to start when spring loads -
SEVERE: Error listenerStart
Feb 7, 2011 4:46:44 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/path2] startup failed due to previous errors
And there is no stack trace or anything though i've set log level to debug.
I think there is no problem with the code because when I run this on my local machine and on a server where the first one is not running it works fine. When i try to run this on the server with /path1 active then it fails.
Thanks!
The 'listenerStart' bit suggests that the error is in a ServletContextListener, so if you have any of those in your code, take a hard look, and see what they're doing; are they accessing any resources that the other instance might then try to share?
Tomcat fails to start even if i remove all my applications from the WEBAPPS directory leaving everything just like after the OS installation.
The log (catalina.out) says:
Using CATALINA_BASE: /usr/share/tomcat5
Using CATALINA_HOME: /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
Using JRE_HOME:
Created MBeanServer with ID: -dpv07y:fl4s82vl.0:hydrogenium.timberlinecolorado.com:1
java.lang.NoClassDefFoundError: org.apache.catalina.core.StandardService
at java.lang.Class.initializeClass(libgcj.so.7rh)
at java.lang.Class.initializeClass(libgcj.so.7rh)
at java.lang.Class.initializeClass(libgcj.so.7rh)
at java.lang.Class.newInstance(libgcj.so.7rh)
at org.apache.catalina.startup.Bootstrap.init(bootstrap.jar.so)
at org.apache.catalina.startup.Bootstrap.main(bootstrap.jar.so)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.modeler.Registry not found in org.apache.catalina.loader.StandardClassLoader{urls=[file:/var/lib/tomcat5/server/classes/,file:/usr/share/java/tomcat5/catalina-cluster-5.5.23.jar,file:/usr/share/java/tomcat5/catalina-storeconfig-5.5.23.jar,file:/usr/share/java/tomcat5/catalina-optional-5.5.23.jar,file:/usr/share/java/tomcat5/tomcat-coyote-5.5.23.jar,file:/usr/share/java/tomcat5/tomcat-jkstatus-ant-5.5.23.jar,file:/usr/share/java/tomcat5/tomcat-ajp-5.5.23.jar,file:/usr/share/java/tomcat5/servlets-default-5.5.23.jar,file:/usr/share/java/tomcat5/servlets-invoker-5.5.23.jar,file:/usr/share/java/tomcat5/catalina-ant-jmx-5.5.23.jar,file:/usr/share/java/tomcat5/tomcat-http-5.5.23.jar,file:/usr/share/java/tomcat5/tomcat-util-5.5.23.jar,file:/usr/share/java/tomcat5/tomcat-apr-5.5.23.jar,file:/usr/share/eclipse/plugins/org.eclipse.jdt.core_3.2.1.v_677_R32x.jar,file:/usr/share/java/tomcat5/servlets-webdav-5.5.23.jar,file:/usr/share/java/tomcat5/catalina-5.5.23.jar], parent=org.apache.catalina.loader.StandardClassLoader{urls=[file:/var/lib/tomcat5/common/classes/,file:/var/lib/tomcat5/common/i18n/tomcat-i18n-ja.jar,file:/var/lib/tomcat5/common/i18n/tomcat-i18n-fr.jar,file:/var/lib/tomcat5/common/i18n/tomcat-i18n-en.jar,file:/var/lib/tomcat5/common/i18n/tomcat-i18n-es.jar,file:/usr/share/java/tomcat5/naming-resources-5.5.23.jar,file:/usr/share/eclipse/plugins/org.eclipse.jdt.core_3.2.1.v_677_R32x.jar,file:/usr/share/java/tomcat5/naming-factory-5.5.23.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/lib/jvm/java/lib/tools.jar,file:/usr/share/tomcat5/bin/bootstrap.jar,file:/usr/share/tomcat5/bin/commons-logging-api.jar,file:/usr/share/java/mx4j/mx4j-impl.jar,file:/usr/share/java/mx4j/mx4j-jmx.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 java.lang.Class.initializeClass(libgcj.so.7rh)
...5 more
Seems like you've implemented a JMX service and tried to install it on your server.xml file but forgot to add the apache commons modeler jar to the server/lib directory (therefore the ClassNotFoundException for org.apache.commons.modeler.Registry). Check your server.xml file for anything you might have added, and try to add the proper jar file to your server classpath.
This screams class path issue, to me. Where exactly is your tomcat installed? (Give us command line printouts of where the home directory is.) Also, how are you starting it?
Seems like you need to have the jar for commons-modeler into $CATALINA_HOME/common/lib. You get the same kind of error when trying to setup JDBC datasources if you didn't put the driver's jar file into tomcat's server classpath.
Check your JAVA_HOME/JRE_HOME setting. You might want to use a different JVM rather than the one that is installed with the OS