Get full stack trace message of Axis2 - java

I am writing a Java EE web application using Tomcat and Axis2 on Eclipse EE.
There is an error in the code, and I can't get the full stack trace to debug it.
I am doing a JDBC connection, and something fails. When I do this using a normal main function it works, but through the Tomcat/Axis2 it does not work.
Caused by: java.lang.NullPointerException
at merge.Test.testQuery(Test.java:36)
... 35 more
How can I expand these 35 lines?
I have set to true the following options in axis2.xml:
true
true
Also I enabled the following option in log4j.properties:
log4j.rootCategory=INFO, CONSOLE, LOGFILE
but I haven't found any log files in the apache directory, or in the axis2 directory, or in the projects directory.
Any help would be greatly appreciated.
Thanks.

You should be able to see the log on the standard output as well.
On Eclipse, just click the following button:
It will switch to the Tomcat's output.

Related

When i try to debug my project it throws no such file error

So the problem is that my project do not debug correctly, it is pretty big so i can not figure out when it started throw this error:
error image
java.nio.file.NoSuchFileException: /Users/similization/Library/Java/JavaVirtualMachines/openjdk-18.0.1.1/Contents/Home/conf/jndi.properties
P.S. I tried to use another versions of tomcat and tried to reinstall everything, but nothing changed and also none of my JVM version have such file (jndi.properties). When i just run my project - everything works fine but i'd like to have debug ability. After i stopped debugging my project i got this message from IntelliJ Idea:
Application Server was not connected before run configuration stop, reason:
javax.management.InstanceNotFoundException: Catalina:type=Server
UPDATE 1
Here is a full
stack trace
"java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)"
"java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)"
"java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)"
"java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)"
"java.base/java.nio.file.Files.newByteChannel(Files.java:380)"
"java.base/java.nio.file.Files.newByteChannel(Files.java:432)"
"java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422)"
"java.base/java.nio.file.Files.newInputStream(Files.java:160)"
"java.naming/com.sun.naming.internal.VersionHelper.lambda$getJavaHomeConfStream$4(VersionHelper.java:228)"
"java.base/java.security.AccessController.doPrivileged(AccessController.java:318)" "java.naming/com.sun.naming.internal.VersionHelper.getJavaHomeConfStream(VersionHelper.java:233)"
"java.naming/com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:530)"
"java.naming/com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:188)"
"java.naming/javax.naming.InitialContext.init(InitialContext.java:232)"
"java.naming/javax.naming.InitialContext.<init>(InitialContext.java:184)"
"org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:99)"
"org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:82)"
"org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)"
"org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)"
"org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)"
"org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:923)"
"org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)"
"org.apache.catalina.startup.Catalina.start(Catalina.java:772)"
"java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)"
"java.base/java.lang.reflect.Method.invoke(Method.java:577)"
"org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)"
"org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)"
there maybe 2 diffrent posssblity
1.there should be run time error
2.your file name has mis matched javac MyFirstJavaProgram. java'
or can you just share image of your code

How to disable AspectJ dump files "ajcore.txt"

I've got a Tomcat webapp where I'm using AspectJ for logging and metrics, everything seems fine, but it keep creating several files like ajcore.20150310.113255.780.txt in the root folder. There is no exception in this files, so they are completely useless.
I've found this: https://eclipse.org/aspectj/doc/released/pdguide/ajcore.html
That states that using org.aspectj.weaver.Dump.exception="false" should disable this behavior, yet the files are still appearing. Is there any other way to completely disable the creation of this files? The other option mentioned: org.aspectj.dump.directory would also solve the problem, but it doesn't seem to work either.
This is the content of the file in case it helps for anything:
---- AspectJ Properties ---
AspectJ Compiler 1.7.1 built on Thursday Sep 6, 2012 at 16:39:22 GMT
---- Dump Properties ---
Dump file: ajcore.20150310.113255.780.txt
Dump reason: org.aspectj.weaver.BCException
Dump on exception: true
Dump at exit condition: abort
---- Exception Information ---
---- System Properties ---
... My system properties here
---- Command Line --- Empty
---- Full Classpath --- Empty
---- Compiler Messages --- Empty
Either of the following options may help:
Executing this code before any AspectJ weaving occurs (if possible): org.aspectj.weaver.Dump.setDumpOnExit(org.aspectj.bridge.IMessage.ABORT)
Adding this system property definition to your java command-line: -Dorg.aspectj.weaver.Dump.condition=abort
I think it is good that the AJ core dump happens because something seems to go wrong during LTW compilation:
Dump file: ajcore.20150310.113255.780.txt
Dump reason: org.aspectj.weaver.BCException
So there is an exception and you should investigate and fix it. Maybe some of your classes are woven with the logging code correctly and some are not. Run the weaver in verbose mode and check your console output, maybe you see something strange there. An AJ core file means that the weaver/compiler was shut down completely (abnormal termination).
As for the actual problem, I think that this
---- Command Line --- Empty
looks strange, as if no command line parameters were passed to the weaver. Also that no exception is actually logged is really unusual.
Which Java version are you on? I assume Java 7 because 1.6 is really old and Java 8 needs AspectJ 1.8. Anyway, can you try to use the latest AspectJ version 1.8.5 or at least the latest 1.7.4 from the old release and see if the problem still occurs?
Add this argument to your JVM run: -Dorg.aspectj.weaver.Dump.exception=false
And also see official docs

Starting tomcat Error code 4 : Failed

I'm creating multiple instances of tomcat using opscode chef cookbook. I see that tomcat.conf was not written into my instance of tomcat but is only in the base instance. I created a softlink to the base instance tomcat.conf file. When I tried to start the server, I get the following error with no logs. There are no logs in /var/log or tomcat folder. Please provide hints on how to debug.
[root#centosclient2 ~]# service tomcat6-obi_sandbox_tomcat start
Starting tomcat6-obi_sandbox_tomcat: Error code 4 [FAILED]
I saw below in /var/log/tomcat6-obi_sandbox_tomcat-initd.log
-sh: /usr/sbin/tomcat6-obi_sandbox_tomcat: No such file or directory
Apparently there is no such file or directory.
I have run into error code 4 a few times, and the problem was that disk was full.

Bug in debugging Red5 server as Java Application inside eclipse

I am following
Red5 Media Server - Workspace Setup Guide - r4737!
I am able to build Red5 distribution and rename distribution jar files i.e completed upto step 6.But when I followed step 7 - Run inside of eclipse failed to debug it as java application -
Red5 root: /home/yuvraj/Documents/RED5/red5 java code all/java/server/trunk
Configuation root: /home/yuvraj/Documents/RED5/red5 java code all/java/server/trunk/conf
Red5 server jar was not found, using fallback.
URL list: [file:/home/yuvraj/Documents/RED5/red5%20java%20code%20all/java/server/trunk/red5.jar]
Bootstrap exception: null
Bootstrap exit
java.lang.NullPointerException
at org.red5.classloading.ClassLoaderBuilder.build(ClassLoaderBuilder.java:172)
at org.red5.classloading.ClassLoaderBuilder.build(ClassLoaderBuilder.java:96)
at org.red5.server.Bootstrap.bootStrap(Bootstrap.java:117)
at org.red5.server.Bootstrap.main(Bootstrap.java:48)
I couldn't find conf directory neither in /home/yuvraj/Documents/RED5/red5 java code all/java/server/trunk/ nor in /Red5_server/bin while setting classpath in java debug.
If you followed step by step the guide, you are probably using the 1.0.2 RC4.
Try this now:
Extract the red5-server-1.0.2-RC4.zip from the target folder to a custom folder
(I have it in c:\red5-server-1.0.2-RC4 )
Copy red5.jar and bootstrap.jar in the place you extracted red5. (In my case c:\red5-server-1.0.2-RC4\ )
Repeat the step 7 in the Guide and be carefull at point L.
conf directory is in \red5-server-1.0.2-RC4\
From the output you've shown, I'd assume you're missing the lib directory and its contents. This wiki link should help: https://code.google.com/p/red5/wiki/ServerWontStart#Bootstrap_exception

UnableToCompleteException with no log

Trying to run my GWT app, I get
EntryPoint initialization exception
Exception while loading module ch.swisstph.mortqual.mqui.client.MqInput. See Development Mode for details.
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:513)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:385)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Thread.java:722)
in the web browser, and just
/usr/lib/jvm/java-6-openjdk/bin/java -Xmx256m -Didea.launcher.port=7537 -Didea.launcher.bin.path=/home/dhardy/code/download/idea-IU-129.239/bin -Dfile.encoding=UTF-8 -classpath /home/install/gwt/gwt-dev.jar:/home/dhardy/p/mortqual/mqui/src:/usr/lib/jvm/java-6-openjdk/jre/lib/compilefontconfig.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/jsse.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/jce.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/management-agent.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/javazic.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/resources.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/charsets.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/java-atk-wrapper.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/pulse-java.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/dnsns.jar:/home/dhardy/p/mortqual/mqui/out/test/mqui:/home/dhardy/p/mortqual/mqui/out/production/mqui:/home/install/appengine-java-sdk/lib/shared/jsp-api.jar:/home/install/appengine-java-sdk/lib/shared/appengine-local-runtime-shared.jar:/home/install/appengine-java-sdk/lib/shared/el-api.jar:/home/install/appengine-java-sdk/lib/shared/servlet-api.jar:/home/install/appengine-java-sdk/lib/user/appengine-api-1.0-sdk-1.7.5.jar:/home/install/gwt/gwt-user.jar:/home/dhardy/p/mortqual/anacod/target/test-classes:/home/dhardy/p/mortqual/anacod/target/classes:/home/dhardy/.m2/repository/net/sourceforge/jexcelapi/jxl/2.6.12/jxl-2.6.12.jar:/home/dhardy/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar:/home/dhardy/.m2/repository/com/beust/jcommander/1.30/jcommander-1.30.jar:/home/dhardy/.m2/repository/org/apache/poi/poi/3.9-20130311/poi-3.9-20130311.jar:/home/dhardy/.m2/repository/org/apache/poi/poi-ooxml/3.9/poi-ooxml-3.9.jar:/home/dhardy/.m2/repository/org/apache/poi/poi-ooxml-schemas/3.9/poi-ooxml-schemas-3.9.jar:/home/dhardy/.m2/repository/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar:/home/dhardy/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar:/home/dhardy/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/home/dhardy/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/home/install/gwt/validation-api-1.0.0.GA-sources.jar:/home/install/gwt/validation-api-1.0.0.GA.jar:/home/dhardy/code/download/idea-IU-129.239/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain com.google.gwt.dev.DevMode -war /home/dhardy/.IntelliJIdea12/system/gwt/mqui.5589a251/mqui.33ff3210/run/www -remoteUI 7901:IntelliJIdea -startupUrl mqInput.html ch.swisstph.mortqual.mqui.mqui
log4j:WARN No appenders could be found for logger (org.apache.jasper.compiler.JspRuntimeContext).
log4j:WARN Please initialize the log4j system properly.
Dev Mode initialized. Startup URL:
http://127.0.0.1:8888/mqInput.html?gwt.codesvr=127.0.0.1:9997
on the command line. There are no logs I can find (I tried configuring log4j via a .properties file, which removed its warnings but still didn't give me any logs).
So how do I solve this?
The two most likely causes are renaming of my start-up page and pushing some code out to a library.
try putting -logLevel SPAM in your command line arguments, this will print detailed logs, also you can put explicit GWT.log("message") in your entry point code, that will tell your how far it is going (normal logging doesn't work directly with gwt).
This page describes how to debug GWT in general, how ever my suggestion would be run debug this directly in eclipse with gwt plugin, GWT support in eclipse is amazing.

Categories

Resources