Axis 1.4 log4j-1.2.8.jar incompatible with XPages? - java

I'm trying to add some of the JARs from Apache Axis 1.4 into the WebContent/WEB-INF/lib directory. One of the JARs is log4j-1.2.8.jar.
As soon as this JAR is added to the lib directory, all XPages in the NSF stop working. I just get an error 500 with the following message:
"HTTP Web Server: Command Not Handled Exception".
The following message is written to the error log:
java.lang.RuntimeException: com.ibm.xsp.FacesExceptionEx: org.apache.commons.logging.LogConfigurationException: java.lang.reflect.InvocationTargetException
.
.
.
.
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:102)
Link to full stack trace
Does anyone have any ideas?

edited
The AXIS jars are included in Domino install because Domino Web Services use them. That's why there is a conflict if you include them also.
I would recommend using JAX-WS which is newer than Axis. Here is how to use it for Web Service client. No need to add any JARs. You could also use JAX-WS wsdl2java instead of Apache one.
These two permissions need to be granted in java.policy file for this to work:
permission java.lang.RuntimePermission "setContextClassLoader";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
Note that any kind of server update (f.e. fixpack install) will reset the java.policy file to default.

Related

How to debug java.lang.ClassNotFoundException during Tomcat startup?

When Tomcat loads my war, I get this error:
Exception in thread "ClientMessageReceptor0" java.lang.NoClassDefFoundError: java/net/Inet6Address
at org.jacorb.orb.iiop.IIOPAddress.getNetworkInetAddresses(IIOPAddress.java:675)
at org.jacorb.orb.iiop.IIOPAddress.getLocalHost(IIOPAddress.java:591)
at org.jacorb.orb.iiop.IIOPAddress.getLocalHostAddress(IIOPAddress.java:574)
at org.jacorb.orb.listener.SSLListenerUtil.processException(SSLListenerUtil.java:73)
at org.jacorb.orb.iiop.IIOPConnection.handleCommFailure(IIOPConnection.java:77)
at org.jacorb.orb.etf.StreamConnectionBase.read(StreamConnectionBase.java:139)
at org.jacorb.orb.giop.GIOPConnection.getMessage(GIOPConnection.java:389)
at org.jacorb.orb.giop.GIOPConnection.receiveMessagesLoop(GIOPConnection.java:541)
at org.jacorb.orb.giop.GIOPConnection.receiveMessages(GIOPConnection.java:533)
at org.jacorb.orb.giop.MessageReceptor.doWork(MessageReceptor.java:69)
at org.jacorb.util.threadpool.ConsumerTie.run(ConsumerTie.java:60)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: Illegal access: this web application instance has been stopped already. Could not load [java.net.Inet6Address]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1375)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1226)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
Our application uses Tomcat v9.0.41 and JDK 1.8.0_111 . This same combination works for others in my team and also it worked for me sometime back. I'm not sure what changed now. I have looked at other similar posts and they suggest mismatch between Tomcat and JDK version. But above combination of Tomcat and JDK works for others.
I have removed all other JDK and JRE version on my system.
Ensured JAVA_HOME points to JDK 1.8.0_111 and PATH points to correct JRE.
Any pointers on how to debug this further? Can I turn on some logging during Tomcat startup to see what paths are being used by Tomcat? Any suggestions are highly appreciated :).

POI 3.17 is not working on weblogic server

Good day,
I tried to use POI in my application to load excel sheet.
everything is working fine on local tomcat but when I move it to server WebLogic 12.2 that run on Java 8, I got an error as follow.
I tried all versions from POI 3.8 to 3.17(latest) but none of them is working correctly on the server.
Error checking for java lib
java.lang.ExceptionInInitializerError
at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:161)
at org.apache.poi.openxml4j.opc.OPCPackage.(OPCPackage.java:141)
at org.apache.poi.openxml4j.opc.ZipPackage.(ZipPackage.java:97)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:324)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:37)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassCastException:
com.ctc.wstx.stax.WstxEventFactory cannot be cast to
javax.xml.stream.XMLEventFactory
at javax.xml.stream.XMLEventFactory.newInstance(XMLEventFactory.java:30)
at org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller.(PackagePropertiesMarshaller.java:41)
at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:161)
at org.apache.poi.openxml4j.opc.OPCPackage.(OPCPackage.java:141)
at org.apache.poi.openxml4j.opc.ZipPackage.(ZipPackage.java:97)
Truncated. see log file for complete stacktrace
commons-codec-1.11
commons-collections4-4.1
commons-logging-1.2
junit-4.12
poi-3.17
poi-excelant-3.17
poi-ooxml-3.17
poi-ooxml-schemas-3.17
poi-scratchpad-3.17
xmlbeans-2.6.0
what could be missed?
Note: I cannot use Maven or similer technologies.
thanks
We found one jar file causes the issue. the name is jsr173_api.jar. once this is deleted, all works fine.

Tomcat not running for a JAR file

I am using Postman alongside a JAR file that runs a REST service that holds some contacts. However when I try to run the JAR file by using: java -jar ContactListRESTService.jar in Powershell, I am seeing a bunch of errors that Apache Tomcat could not run. Postman also doesn't recognize the localhost.
Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:159)
Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletCntainer.java:159) ~[spring-boot 1.3.7.RELEASE.jar!/:1.3.7.RELEASE]
I have tried uninstalling and reinstalling JAVA SE per some guidance from a mentor with no results.
If anyone can point me in the right direction please.

Where to deploy jars for a Domino Agent

I've an agent that use Axis jars.
Which are the alternatives for these jars deploying?
If I put them into lib/ext folder on server, everything works fine, but I wouldn't deploy "by hand" all jars in every production server.
If I put them into Archive agent section, also into WEB-INF/lib project folder, I always have a java.lang.ClassNotFoundException error.
UPDATE 1
I tried to deploy a jar into notesdata/domino/java folder and modified notes.ini JavaUserClasses variable to point to this jar, but same error!
UPDATE 2
As suggested, I put the jar (axiom-api-1.2.8.jar) into agent Archive, but still the same error
HTTP JVM: java.lang.NoClassDefFoundError: org.apache.axiom.om.OMNode
HTTP JVM: at java.lang.J9VMInternals.verifyImpl(Native Method)
HTTP JVM: at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
HTTP JVM: at java.lang.J9VMInternals.verify(J9VMInternals.java:70)
HTTP JVM: at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
HTTP JVM: at org.apache.axis2.context.ConfigurationContextFactory.createBasicConfigurationContext(ConfigurationContextFactory.java:337)
HTTP JVM: at org.apache.axis2.context.ConfigurationContextFactory.createDefaultConfigurationContext(ConfigurationContextFactory.java:326)
HTTP JVM: at JavaAgent.NotesMain(JavaAgent.java:499)
HTTP JVM: at lotus.domino.AgentBase.runNotes(Unknown Source)
HTTP JVM: at lotus.domino.NotesThread.run(Unknown Source)
The right place to put jar is into agent's Archive section.
The problem experienced during my test following
HTTP JVM: java.lang.NoClassDefFoundError: org.apache.axiom.om.OMNode
doesn't depend on the axiom-api-1.2.8.jar absence, but on the absence of the whole jar dependencies.
Infact, including all jars needed, everything work's fine.
Thanks Knut for your suggestion.

Deploying java project to remote glassfish server

We have a project made in netbeans 7.3 and are about to deploying this to a remote glassfish server, everything is configured and set up properly and the connection pools for our project are also generated in glassfish.
Currently we are getting this error when deploying to the remote server:
deploy?DEFAULT=D:\SVN\PTS62\Applicaties\Rekeningrijderwebsite\RekeningRijder\dist\RekeningRijder.war&name=RekeningRijder&contextroot=/RekeningRijder&force=true
failed on GlassFish Server 3+
Error occurred during deployment: Exception while preparing the app :
Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a
connection. Cause: Class name is wrong or classpath is not set for :
com.mysql.jdbc.jdbc2.optional.MysqlDataSource
Error Code: 0. Please see server.log for more details.
And the message the server generates:
Caused by: javax.resource.ResourceException: Class name is wrong or
classpath is not set for :
com.mysql.jdbc.jdbc2.optional.MysqlDataSource
at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:292)
at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:114)
at com.sun.gjc.spi.ManagedConnectionFactory.getDataSource(ManagedConnectionFactory.java:1307)
at com.sun.gjc.spi.DSManagedConnectionFactory.getDataSource(DSManagedConnectionFactory.java:163)
at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:102)
at com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:87)
... 62 more
Google wasn't very helpfull before, so hopefully you guys/girls can help me
Thanks in advance!
You may need a mysql / java connector.
You can find it there. Extract the mysql-connector-java .jar from the archive. Then place it into the glassfish external lib directory {INSTALL DIR}/glassfish/domains/domain1/lib/ext.
Restart your glassfish server.
There are more details on this answer. If that's not what you are looking for, or if it doesn't work, tell us. #+
Right, you just lack mysql lib, just find and download mysql-connector-java-5.x.x-bin.jar copy to E:\Projects\glassfish3.1.1\glassfish\lib then restart server and enjoy !!!

Categories

Resources