adding rest web service into websphere supported application - jersey

I already have an application which is deployed on websphere 7.X.
Now i need to add rest web service to this application, so i added jersey servlet related information in web.xml and deployed the code in tomcat,
I worked fine on tomcat, but the same war file when deployed on websphere it threw the below exception
10/29/15 16:07:55:203 EDT] 00000009 WebApplicatio I Initiating Jersey application, version 'Jersey: 1.19 02/11/2015 05:39 AM'
[10/29/15 16:07:55:747 EDT] 00000009 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/was7/app-it2/profiles/p-c7it2-a/logs/ffdc/as-c7it2-a-mfr- 3_59bd59bd_15.10.29_16.07.55.7124506202519276998895.txt com.ibm.ws.webcontainer.servlet.ServletInstance.init 181
[10/29/15 16:07:55:749 EDT] 00000009 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0100E: Uncaught init() exception created by servlet "servletname" in application XXX: java.lang.VerifyError
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl. <clinit>(RuntimeBuiltinLeafInfoImpl.java:263)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:199)
I am very new to websphere and i am not able to find out why this exception is being thrown.
Any guidance will be appreciated.
Thanks

For WAS v7, install Feature Pack for Web 2.0 and check the following page how to develop JAX-RS. Getting started with IBM JAX-RS

Related

WebSphere 8.5.5 and JMS annotations crash server application

I'm deploying an app that makes use of Spring 4.2.5, Hibernate 4.2.8, and JMS 1.1 on to WebSphere 8.5.5 and Oracle 12.
Resources such as the database connection manager, and JMS connection factory are set in the server and wired into the Spring app using JNDI.
When the app starts I see this in the logs:
[3/18/16 15:18:32:717 EST] 0000008b SystemOut O [B#631dd237/Set;
at org.springframework.jms.annotation.JmsListenerAnnotationBeanPostProcessor$1.inspect(JmsListenerAnnotationBeanPostProcessor.java:202)
at org.springframework.jms.annotation.JmsListenerAnnotationBeanPostProcessor$1.inspect(JmsListenerAnnotationBeanPostProcessor.java:198)
at org.springframework.core.MethodIntrospector$1.doWith(MethodIntrospector.java:72)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:495)
at org.springframework.core.MethodIntrospector.selectMethods(MethodIntrospector.java:68)
at org.springframework.jms.annotation.JmsListenerAnnotationBeanPostProcessor.postProcessAfterInitialization(JmsListenerAnnotationBeanPostProcessor.java:197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1559)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
... 58 more
[3/18/16 15:18:32:718 EST] 0000008b SystemOut O [FIAT-CSP-NA] [WebContainer : 0] 2016-03-18 15:18:32,718 [INFO ] org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean: Closing JPA EntityManagerFactory for persistence unit default
As you can see it appears there is some sort of error in the JMSListenerAnnotationBeanPostProcessor, followed by a message indicating that the JPA entity manager is shutting down.
I presume from this that there is a JMS problem which is shutting down the app.
Has anyone seen this? Do you know what might be the issue?
I'm really stuck on this.
The answer turned out to be class path issues. (Isn't everything on Websphere!)
I needed to remove several jars from the war file that where conflicting with jars web sphere supplied.

error WTRN0006W in webSphere - Transaction has timed out after 120 seconds - in JBoss and Tomcat everything is OK

I have a big riddle.
Code, which I modified was not clean - sql was generated as string (over 100 lines of sql code) etc ...
I moved a big sql query to oracle view and in Java code I make fast select on view.
It working good on JBoss and Tomcat.
On the other hand in WebSphere (used by client) I have an error after select in view.
[5/22/15 12:20:24:043 CEST] 00000022 TimeoutManage I WTRN0006W: Transaction 0000014D7B2185A800000002000001B660A70E3F35C49F79E7F2FBE65BD336F30DB8D5FC0000014D7B2185A800000002000001B660A70E3F35C49F79E7F2FBE65BD336F30DB8D5FC00000001 has timed out after 120 seconds.
[5/22/15 12:21:14:042 CEST] 00000056 WebApp E [Servlet Error]-[action]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport:
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:553)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:994)
at pl.com.max.primer.action.ajax.BaseAjaxAction.execute(BaseAjaxAction.java:78)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at pl.com.max.primer.plugin.RequestProcessor.process(RequestProcessor.java:135)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1143)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:591)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3453)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:119)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
Looks like your query is executing longer than 120 seconds. Maybe max transaction timeouts in JBoss or Tomcat are higher. You have to verify why this query is taking so long and try to make it faster. If it wont be possible you can extend transaction timeout via admin console.
Click Servers > Server Types > WebSphere application servers > server_name. Then click Container Services > Transaction Service. And set Maximum transaction timeout.
See here for more details: Configuring transaction properties

UnsupportedOperationException: SRVE8020E: Servlet does not accept multipart requests

I am using Maximo Anywhere 7.5 on Websphere 8.5.
When i am trying to upload image i got this error:
servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service
SRVE0068E: An exception was thrown by one of the service methods of
the servlet [AnywhereProxyServlet] in application
[AnywhereWorkManager_1-2_4_war]. Exception created :
[java.lang.UnsupportedOperationException: SRVE8020E: Servlet does not
accept multipart requests
I Googled the error code and this came up:
SRVE8020E: Servlet does not accept multipart requests
Explanation: The servlet does not accept multipart requests.
Action: Add a #MultipartConfig annotation to this servlet or add a multipart-config element to this servlet in the web.xml.
to solve this issue i have to install fix 8.5.5.0 for WebSphere

Websphere Application startup error

I am using Websphere 7 and recently i am getting this error while trying to start the application.
00000018 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0100E: Uncaught init() exception created by servlet Application Initialization Servlet in application xxx-Portal: java.lang.NullPointerException
at com.xyz.zyx.web.init.ApplicationInitServlet.init(ApplicationInitServlet.java:75)
and the code is :
final Properties props =
init.initialize(url, getServletContext().getRealPath("/WEB-INF/classes"));
Don't know what happened all of a sudden..Something i have to change in the server parameters since I cannot change the code.
The solution was simple:
Go to installed applicaton > class loader and update detection > under WAR Class loader policy, select 'Single Class Loader'
Now the application will start.
Found it after long struggle .

mqjbnd05 error when deploying app on websphere

I have a fresh install of Wesphere 6.1 Fixpack 23. I have an app deployed that requires an MQSeries JMS Queue. I set up an MQSeries provider-based request and reply queue and an MQSeries provider-based queue connection factory. When the deployed app tries to access the queue, I receive the following error.
Any assistance would be appreciated. Thanks!
[5/28/09 10:33:42:538 EDT] 00000033 ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: espaapp. Exception thrown : org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.UnsatisfiedLinkError: mqjbnd05 (Not found in java.library.path)
Caused by: java.lang.UnsatisfiedLinkError: mqjbnd05 (Not found in java.library.path)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:953)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:922)
at java.lang.System.loadLibrary(System.java:451)
at com.ibm.mq.MQSESSION.loadLib(MQSESSION.java:1028)
at com.ibm.mq.server.MQSESSION$1.run(MQSESSION.java:246)
at java.security.AccessController.doPrivileged(AccessController.java:192)
at com.ibm.mq.server.MQSESSION.(MQSESSION.java:243)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:68)
at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:508)
at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:213)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:186)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:225)
at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:84)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:173)
at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:795)
at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:709)
at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:664)
at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:160)
at com.ibm.mq.MQQueueManager.(MQQueueManager.java:550)
at com.ibm.mq.MQSPIQueueManager.(MQSPIQueueManager.java:62)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2427)
at com.ibm.mq.jms.MQConnection.createQMXA(MQConnection.java:1806)
at com.ibm.mq.jms.MQQueueConnection.(MQQueueConnection.java:105)
at com.ibm.mq.jms.MQQueueConnection.(MQQueueConnection.java:66)
at com.ibm.mq.jms.MQXAQueueConnection.(MQXAQueueConnection.java:59)
at com.ibm.mq.jms.MQXAQueueConnectionFactory.createXAQueueConnection(MQXAQueueConnectionFactory.java:82)
at com.ibm.ejs.jms.JMSManagedQueueConnection.createConnection(JMSManagedQueueConnection.java:123)
at com.ibm.ejs.jms.JMSManagedConnection.(JMSManagedConnection.java:315)
at com.ibm.ejs.jms.JMSManagedQueueConnection.(JMSManagedQueueConnection.java:71)
... More
Does this help?
java.lang.UnsatisfiedLinkError occurs when connecting to a queue manager
Also, within the JMS -> Queue Connection Factories section, select your Queue Connection Factory and check if your "Transport Type" is set to 'BINDINGS' or 'CLIENT'
I swapped mine to CLIENT and that seemed to help a lot.
Such error often happens as a result of passing null to port, host or QManager to connection factory. Try to check all parameters during execution. Normally MQ does not require mqjbnd05 library.
Try to find this file
libmqjbnd05.so
Add that to the LIBPATH for your JVM and try again.
GO to WebSphere Admin console. Environment -> WebSphere variables. Look for MQ_INSTALL_ROOT and modify its value to your MQ installation directory [MQ Home].

Resources