weblogic tapestry issues - weblogic

My application using tapestry 4.1.6 jar files deploys correctly in weblogic 10.3.3.0. But at runtime, I am getting NoSuchMethodException from tapestry files.Same application works fine in weblogic 9. Any ideas?
Error Log
java.lang.NoSuchMethodError: org.apache.commons.pool.impl.TapestryKeyedObjectPool.assertOpen()V
at org.apache.commons.pool.impl.TapestryKeyedObjectPool.borrowObject(TapestryKeyedObjectPool.java:941)
at org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:176)
at $IPageSource_12bf9e5c33a.getPage($IPageSource_12bf9e5c33a.java)
at org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:241)
at org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:228)
at org.apache.tapestry.engine.DirectService.service(DirectService.java:107)
at $IEngineService_12bf9e5c3ad.service($IEngineService_12bf9e5c3ad.java)
at org.apache.tapestry.services.impl.EngineServiceInnerProxy.service(EngineServiceInnerProxy.java:77)
at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:241)
at org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
at $WebRequestServicer_12bf9e5c384.service($WebRequestServicer_12bf9e5c384.java)
at $WebRequestServicer_12bf9e5c380.service($WebRequestServicer_12bf9e5c380.java)
at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
at $ServletRequestServicer_12bf9e5c366.service($ServletRequestServicer_12bf9e5c366.java)
at org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
at $ServletRequestServicerFilter_12bf9e5c362.service($ServletRequestServicerFilter_12bf9e5c362.java)
at $ServletRequestServicer_12bf9e5c368.service($ServletRequestServicer_12bf9e5c368.java)
at org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
at $ServletRequestServicerFilter_12bf9e5c360.service($ServletRequestServicerFilter_12bf9e5c360.java)
at $ServletRequestServicer_12bf9e5c368.service($ServletRequestServicer_12bf9e5c368.java)
at org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)

I'd check to see if WebLogic 10.3 has a conflicting Tapestry JAR at the server class loader level. If yes, you'll want to tell WebLogic to prefer the version of Tapestry that it finds using your application class loader.
See <prefer-web-inf-classes> in weblogic.xml:
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/programming/classloading.html

Note: Weblogic is often configured by default, it filters javax.* package. (X Add J2EE libraries to buildpath)

Related

Converting from JBoss AS7 to Wildfly

My project references the following Jar's and I am wondering whether these are the correct Jars for my version of WWildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final).
jboss-servlet-api_3.1_spec-1.0.0.Final.jar
jboss-ejb3-ext-api-2.2.0.Final.jar
jboss-ejb-api_3.2_spec-1.0.0.Final.jar
jboss-jsp-api_2.3_spec-1.0.1.Final.jar
Are these needed for Wildfly or are these the correct ones for WWildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)?
These version of jar will work with WildFly-10 release without any issue.

Spring boot application.version is null

I'm using spring boot and was trying to retrieve the current application version. (basically the version in the pom.xml)
On the spring boot ref site I can see there is a ${application.version} that is meant to have the version present in the MANIFEST file. (I have checked in the jar, and the I indeed can see this line
Implementation-Version: 0.1.1-SNAPSHOT
but in the code when I try to retrieve ${application.version}
(using #Value throws an error saying the prop cannot be found) and using env.getProperty("application.version") returns null.
Is there anything I need to setup in order to be able to use this prop ?
I found the application.version property only works in banner.txt. I read the Implementation-Version from manifest file directly, see How to read my META-INF/MANIFEST.MF file in a Spring Boot app?
The application.version is only available when you are run the application as built jar file. java -jar springboot.jar
When running within a editor you will not have the version available.

java.lang.NoClassDefFoundError: Could not initialize class org.apache.activemq.util.IdGenerator

I am trying to use ActiveMQ 5.10.0 with SoapUI 4.6 and Hermes 1.14. I get the error below when I try and add a queue. I presume Hermes can't find the type IdGenerator in any of the loaded jars. Which are:
activemq-client-5.10.0.jar
geronimo-j2ee-management_1.1_spec-1.0.1.jar
geronimo-jms_1.1_spec-1.1.1.jar
Does anyone know where this class is defined? I looked for activemq-util.jar in the binary distribution but I did not find such a file.
Error:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.activemq.util.IdGenerator
at org.apache.activemq.ActiveMQConnectionFactory.getClientIdGenerator(ActiveMQConnectionFactory.java:969)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:363)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:331)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:303)
at org.apache.activemq.ActiveMQConnectionFactory.createQueueConnection(ActiveMQConnectionFactory.java:260)
at hermes.impl.jms.ConnectionManagerSupport.createConnection(ConnectionManagerSupport.java:147)
at hermes.impl.jms.ConnectionManagerSupport.createConnection(ConnectionManagerSupport.java:92)
at hermes.impl.jms.ConnectionSharedManager.reconnect(ConnectionSharedManager.java:81)
at hermes.impl.jms.ConnectionSharedManager.connect(ConnectionSharedManager.java:91)
at hermes.impl.jms.ConnectionSharedManager.getConnection(ConnectionSharedManager.java:104)
at hermes.impl.jms.ConnectionSharedManager.getObject(ConnectionSharedManager.java:142)
at hermes.impl.jms.ThreadLocalSessionManager.connect(ThreadLocalSessionManager.java:190)
at hermes.impl.jms.ThreadLocalSessionManager.getSession(ThreadLocalSessionManager.java:570)
at hermes.impl.jms.AbstractSessionManager.getDestination(AbstractSessionManager.java:460)
at hermes.impl.DefaultHermesImpl.getDestination(DefaultHermesImpl.java:367)
at hermes.browser.tasks.BrowseDestinationTask.invoke(BrowseDestinationTask.java:141)
at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)
at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)
at java.lang.Thread.run(Unknown Source)
This is very old but in case anyone else is trying to get this spun up... don't use the built in HermesJMS that comes with SoapUI. Apparently there's a bug in it that doesn't play nice with ActiveMQ v5.8 and following [I tried 5.11 & 5.13 and had the issue. The cheating fix is to install the standalone [I had to get it from sourceforge].
The sourceforge jar is installed with [assuming version 1.14]: java -jar hermes-installer-1.14.jar
Once installed you can tie this version to soapui or launch it with the bat/sh file. I still had issues with ActiveMQ version 5.13 but version 5.11 worked for me.
The IdGenerator class is located in the activemq-client jar. Here is the result of a search in the source tree:
/activemq-client/src/main/java/org/apache/activemq/util/IdGenerator.java
There's been no recent changes so I'd guess that the error is misleading and that it's actually some other missing dependency that's being loaded when the class is created. Is there more information in the log or a 'caused by exception' ?
For whom it may interest. This is kind of common issue I come accross from time to time. I call it jar version incompatibility. I was getting exception in title and other funny exceptions when using latest (but not actively developed) hermes 1.14 and currently latest Apache Active MQ 5.14. I've found out after a long struggle that it is fixed by using an older version of Active MQ - like 5.3.

Weblogic 12c HibernateValidator ClassLoading issue

Validation framework which has been rolled up as part of the JEE6 spec (WL12). Both the WL10 and WL12 versions of our application were deployed with the following open source libraries:
JSR-303 / validation-api.jar (version 1.0)
Hibernate Validator (version 4.2.0)
However, the libraries are also bundled with WL 12 (modules directory). Note that the Hibernate Validator version is slightly different.
modules.javax.validation_1.0.0.jar
hibernate.validator_4.1.0.jar
With our WL12 run we are getting below exception:
javax.validation.ValidationException: Unable to get available provider
Attempted Solutions
Our next attempt was to use the WebLogic FilteringClassLoader to prefer the libraries from our application (APP-INF/lib directory) by specifying them in the weblogic-application.xml file (i.e. choose our versions over WebLogic’s). We were already doing this for several other open source libraries in WL10:
<prefer-application-packages>
<package-name>com.google.common.*</package-name>
<package-name>org.apache.commons.lang.*</package-name>
<package-name>org.apache.commons.logging.*</package-name>
<package-name>org.apache.commons.beanutils.*</package-name>
<package-name>org.apache.commons.collections.*</package-name>
<package-name>antlr.*</package-name>
<package-name>javax.validation.*</package-name>
<package-name>org.hibernate.validator.*</package-name>
</prefer-application-packages>
After making that change, our application experienced the following run-time error trying to process any request that makes use of the validation framework:
javax.validation.ValidationException: Unable to get available provider resolvers.
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:259)
at web20.hibernate.validation.ValidatorFactoryConfigurator.getValidatorFactory(ValidatorFactoryConfigurator.java:39)
at web20.hibernate.validation.ValidationHandlerImpl.handleHibernateValidations(ValidationHandlerImpl.java:180)
at web20.hibernate.validation.ValidationHandlerImpl.performValidation(ValidationHandlerImpl.java:255)
at web20.hibernate.validation.ValidationHandlerImpl.validateAndFormatMessages(ValidationHandlerImpl.java:302)
at web20.hibernate.validation.ValidationHandlerImpl.validateUsingHibernateGroups(ValidationHandlerImpl.java:113)
at service.serviceapp.performValidations(serviceapp.java:392)
at service.serviceapp.performValidations(serviceapp.java:379)
at service.TransactionalServiceImpl.search(TransactionalServiceImpl.java:300)
Given that Bean Validation is part of the EE standard, I assume there is some code Bean Validation integration code which causes the problem. I see two potential solutions:
Patch the WL instance and upgrade to the Validator version you want to use
Try writing your own ValidationProvider. Internally it could just delegate to the Hibernate Validator classes. If you then add a validation.xml to your application, specifying your custom provider, WL should bootstrap this one. TBH, I don't know whether this will work. There are many unknowns and I don't know enough about the integration of WL and Bean Validation.
Personally, I think I would just try to upgrade the Validator version used in WL.

WARNING in Glassfish about JMS

I have recently installed the latest Glassfish open source version and configure it but I have problem with JMS and now my 2 Glassfish servers have problem (whereas before installing new GF server, it was working on the previous GF server). So I think there is probably conflict between these 2 servers.
When I try to use JMS, I receive these logs :
[#|2013-03-20T14:10:00.015+0100|FINE|glassfish3.1.2|javax.jms.ConnectionFactory.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnectionFactory;MethodName=createConnection;|MQJMSRA_DCF1101: createConnection():|#]
[#|2013-03-20T14:10:00.015+0100|FINE|glassfish3.1.2|javax.jms.ConnectionFactory.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnectionFactory;MethodName=createConnection;|MQJMSRA_DCF1101: createConnection(u,p):username=guest|#]
[#|2013-03-20T14:10:00.015+0100|FINE|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnection;MethodName=createSession;|MQJMSRA_DC1101: connectionId=7032438472106962688:createSession():isTransacted=false:acknowledgeMode=1|#]
[#|2013-03-20T14:10:00.015+0100|FINE|glassfish3.1.2|javax.jms.Session.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectSession;MethodName=close;|MQJMSRA_DS1101: sessionId=7032438472122322689:close()|#]
[#|2013-03-20T14:10:00.015+0100|FINE|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnection;MethodName=close;|MQJMSRA_DC1101: connectionId=7032438472106962688:close():|#]
[#|2013-03-20T14:10:00.046+0100|FINE|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=152;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnection;MethodName=_unsetClientID;|MQJMSRA_DC1101: connectionId=7032438472106962688:_unsetClientID():|#]
[#|2013-03-20T14:10:06.796+0100|FINE|glassfish3.1.2|javax.jms.ConnectionFactory.mqjmsra|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnectionFactory;MethodName=createConnection;|MQJMSRA_DCF1101: createConnection():|#]
[#|2013-03-20T14:10:06.796+0100|FINE|glassfish3.1.2|javax.jms.ConnectionFactory.mqjmsra|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnectionFactory;MethodName=createConnection;|MQJMSRA_DCF1101: createConnection(u,p):username=guest|#]
[#|2013-03-20T14:10:06.796+0100|FINE|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnection;MethodName=setExceptionListener;|MQJMSRA_DC1101: connectionId=7032438472106962688:setExceptionListener()|#]
[#|2013-03-20T14:10:06.796+0100|WARNING|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=42;_ThreadName=Thread-2;|MQJMSRA_DC2001: Unsupported:setExceptionListener():inACC=false:connectionId=7032438472106962688|#]
[#|2013-03-20T14:10:06.796+0100|FINE|glassfish3.1.2|javax.jms.Connection.mqjmsra|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.messaging.jms.ra.DirectConnection;MethodName=_unsetClientID;|MQJMSRA_DC1101: connectionId=7032438472106962688:_unsetClientID():|#]
I didn't find anything on Google...anybody to help me ?
The cause was a Java library deployed in ${GLASSFISH_HOME}/glassfish/domains/domain1/lib in Milestone state. Gone back to the latest release solved the problem.