org.apache.openjpa.persistence.PersistenceException: invalid stream header - openjpa

Hi I am using OpenJPA ver 2.2.0. I have two projects one where I am having code for middle and data tier code. From this project I create a jar file which I add it to a web project. In the middle tier project I am doing build time enhancement of the code before creating the jar.
When I add the jar to my web application and execute it I am getting
<openjpa-2.2.0-r422266:1244990 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: invalid stream header: 31303031
FailedObject: SELECT * FROM lbs.company_user comUs WHERE comUs.user_id = ? [java.lang.String]
at org.apache.openjpa.util.Serialization.deserialize(Serialization.java:88)
at org.apache.openjpa.jdbc.sql.DBDictionary.getBlobObject(DBDictionary.java:651)
at org.apache.openjpa.jdbc.sql.MySQLDictionary.getBlobObject(MySQLDictionary.java:346)
at org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(ResultSetResult.java:402)
at org.apache.openjpa.jdbc.sql.AbstractResult.getObject(AbstractResult.java:696)
at org.apache.openjpa.jdbc.meta.strats.HandlerStrategies.loadDataStore(HandlerStrategies.java:222)
at org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy.load(HandlerFieldStrategy.java:187)
at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:928)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1094)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1038)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:409)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:304)
at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)
at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1036)
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:994)
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:916)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1012)
at org.apache.openjpa.jdbc.kernel.GenericResultObjectProvider.getResultObject(GenericResultObjectProvider.java:93)
at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36)
at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:286)
at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302)
at org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:330)
at test.geofence.dal.impl.UserDAOImpl.findByKey(UserDAOImpl.java:58)
at test.geofence.servlets.Authentication.login(Authentication.java:199)
at test.geofence.servlets.Authentication.processRequest(Authentication.java:112)
at test.geofence.servlets.Authentication.doGet(Authentication.java:285)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.StreamCorruptedException: invalid stream header: 31303031
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at org.apache.openjpa.util.Serialization$ClassResolvingObjectInputStream.<init>(Serialization.java:127)
at org.apache.openjpa.util.Serialization$PersistentObjectInputStream.<init>(Serialization.java:161)
at org.apache.openjpa.util.Serialization.deserialize(Serialization.java:86)
... 45 more
Can somebody tell me why I am getting this error and probable solution?

I think, this error happens because the ObjectInputStream tries to open a stream, which has already been read from.
I would suggest you check the 'max_packet_size' property in MySQL. (See this: http://dev.mysql.com/doc/refman//5.5/en/packet-too-large.html) The packet size must be larger than the biggest BLOB field you are retrieving from your "company_user" table.

Related

Error in crystal report job in documentum

We are getting the below error message in the view job report option while executing the method named drs_RunReportMethod through a job named drs_crystal job in documentum for converting the crystal reports placed /Reports cabinet from .rpt to .pdf. Kindly provide your suggestions on this.
Below are the arguments of the method I have set:-
-report_output_file_format pdf, -purge_limit 5, -report_user_name dmadmin, -report0_parameter Document|Name=Design|Document, Top|N|Records=25, Show|Chart=1, -report0 /Reports/test.rpt, -report_output_docbase_path /Reports
ERROR MESSAGE OF THE JOB REPORT:
2016-02-07 11:24:48 UTC: ERROR: ERROR - Processing of report :/Reports/test.rpt failed with error DmDRSException:: THREAD: http-0.0.0.0-8080-2; MSG: [DM_DRS_E_EXCEPTION_ERROR]error: "[DM_DRS_E_EXCEPTION_ERROR]: Exception Class:class java.lang.Exception: Message:Report handler class is not configured for the report format: rpt: Cause:null: Exception Detail:java.lang.Exception: Report handler class is not configured for the report format: rpt: Stack Trace
java.lang.Exception: Report handler class is not configured for the report format: rpt
at com.documentum.drs.method.RunReportMethod.getReportHandler(RunReportMethod.java:558)
at com.documentum.drs.method.RunReportMethod.exportReport(RunReportMethod.java:403)
at com.documentum.drs.method.RunReportMethod.processReport(RunReportMethod.java:368)
at com.documentum.drs.method.RunReportMethod.processReports(RunReportMethod.java:255)
at com.documentum.drs.method.RunReportMethod.execute(RunReportMethod.java:155)
at com.documentum.mthdservlet.DmMethodRunner.runIt(Unknown Source)
at com.documentum.mthdservlet.AMethodRunner.runAndReturnStatus(Unknown Source)
at com.documentum.mthdservlet.DoMethod.invokeMethod(Unknown Source)
at com.documentum.mthdservlet.DoMethod.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] (http-0.0.0.0-8080-1) SOAP request exception java.lang.reflect.UndeclaredThrowableException

I am getting following error while calling web services in jboss server from soap ui.
server logs are as:
2014-10-13 18:17:40,137 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] (http-
0.0.0.0-8080-1) SOAP request exception
java.lang.reflect.UndeclaredThrowableException
at
org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:228)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:474)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:295)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:205)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:131)
at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: ilog/rules/res/session/IlrSessionFactory
at com.maersk.brms.service.ServiceCore.<init>(ServiceCore.java:46)
at com.maersk.brms.service.ExportDocMandatory.getMandatoryData(ExportDocMandatory.java:32)
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 org.jboss.wsf.container.jboss50.invocation.InvocationHandlerJSE.invoke(InvocationHandlerJSE.java:108)
at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:222)
... 26 more
my service is also calling ruleapp in RES deployed in same jboss server.
Maybe this helps: https://developer.jboss.org/message/618552#618552 I haven't tried it yet though (production system, I have to be careful).
The problem I encountered enabling RTS server in JBoss, the mistake was the schema for RTS in database got deleted.

unable to run reports in SpagoBI

I installed SpagoBI server 3.6 but could not able to run any reports created by me except the example reports given by default. When i execute my jasper report it shows "error check in log files".
This is the log file error:
ERROR it.eng.spagobi.utilities.engines.AbstractEngineStartServlet.handleException:64 - Service execution failed
it.eng.spagobi.utilities.engines.SpagoBIEngineException: An error occurred while executing report. Check log file for more information
at it.eng.spagobi.engines.jasperreport.services.JasperReportEngineStartAction.doService(JasperReportEngineStartAction.java:105)
at it.eng.spagobi.utilities.engines.AbstractEngineStartServlet.doService(AbstractEngineStartServlet.java:47)
at it.eng.spagobi.utilities.service.AbstractBaseServlet.service(AbstractBaseServlet.java:48)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at it.eng.spagobi.utilities.filters.SpagoBIAccessFilter.doFilter(SpagoBIAccessFilter.java:193)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:722)
Caused by: it.eng.spagobi.engines.jasperreport.JasperReportEngineRuntimeException: Impossible to run report
at it.eng.spagobi.engines.jasperreport.JasperReportEngineInstance.runReport(JasperReportEngineInstance.java:118)
at it.eng.spagobi.engines.jasperreport.services.JasperReportEngineStartAction.doService(JasperReportEngineStartAction.java:95)
... 18 more
Caused by: it.eng.spagobi.engines.jasperreport.JasperReportEngineRuntimeException: Impossible to run report
at it.eng.spagobi.engines.jasperreport.JasperReportEngineInstance.runReport(JasperReportEngineInstance.java:251)
at it.eng.spagobi.engines.jasperreport.JasperReportEngineInstance.runReport(JasperReportEngineInstance.java:116)
... 19 more
Caused by: it.eng.spagobi.utilities.engines.SpagoBIEngineRuntimeException: Impossible to deserialize catalogue
at it.eng.qbe.dataset.QbeDataSet.getCatalogue(QbeDataSet.java:252)
at it.eng.qbe.dataset.QbeDataSet.init(QbeDataSet.java:82)
at it.eng.qbe.dataset.QbeDataSet.loadData(QbeDataSet.java:104)
at it.eng.spagobi.engines.jasperreport.JasperReportEngineInstance.runReport(JasperReportEngineInstance.java:205)
... 20 more
Caused by: java.lang.NoClassDefFoundError: org/json/JSONObject
at it.eng.qbe.dataset.QbeDataSet.getCatalogue(QbeDataSet.java:242)
... 23 more
Caused by: java.lang.ClassNotFoundException: org.json.JSONObject
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
... 24 more
Please help me
The innermost exception means that the class org.json.JSONObject was not found (Most likely found here: http://www.json.org/), this usually is because the corresponding jar for such class is not found in the classpath, so you need to download the jar for this class and put it in the classpath of Spago, i'm not familiar with Spago but you should find how to put this jar in the classpath on their documentation.

twitter4j 3.0.3 twitter.updateStatus(msg) does not work

I'm updating an a project that uses twitter api v1 to v1.1, I realised that the application is not sharing to twitter anymore. I did some research and I updated the code to reflect the new authentication mechanism
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
.setOAuthConsumerKey(consumerKey)
.setOAuthConsumerSecret(ConsumerSecret)
.setOAuthAccessToken(oAuthAccessToken)
.setOAuthAccessTokenSecret(oAuthAccessTokenSecret)
.setHttpRetryCount(2)
.setHttpRetryIntervalSeconds(2);
TwitterFactory tf = new TwitterFactory(cb.build());
Twitter twitter = tf.getInstance();
twitter.addRateLimitStatusListener(rateLimitStatusListener);
Status status = twitter.updateStatus(statusMsg);
The application does not throw any exception anymore but it does tell me that the statusMsg been sent but when I check the twitter account itself I cannot see the tweet. I went back and I added the same status again and the program threw an exception with the cause being that the message is duplicated which means it's there somewhere but the twitter account does not show it. Am I missing anything here?
The exception is
TwitterException{exceptionCode=[b2b52c28-10981ab8], statusCode=403, message=Status is a duplicate, code=187, retryAfter=-1, rateLimitStatus=null, version=3.0.3}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:177)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61)
at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:98)
at twitter4j.TwitterImpl.post(TwitterImpl.java:1871)
at twitter4j.TwitterImpl.updateStatus(TwitterImpl.java:241)
at myClass(TwitterMessage.java:130)
at (DefaultTwitterSocialNetworkApi.java:433)
at myClass(ActivityService.java:433)
at myClass(ActivityService.java:389)
at myClass(UserCommentResource.java:79)
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 com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:187)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1357)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1289)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1239)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:420)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:497)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:684)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myClass(myClass.java:141)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myClass(myClass.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myClass(myClass.java:28)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:680)
UPDATE:
I discovered the bug I shoul have added
twitter.setOAuthAccessToken(userAccessToken);
without this line the application sends the tweet to the account that owns the application.
Seems like as of today (jan 14) this error is also thrown, when not using a ssl connection.
Actually the error message is a bit different, as it doesn't clearly state that this is a duplicate status. But the Message contains two ErrorCodes, one of them links here.
Anyway, See REST API, regarding 403 error code? for possible solution (enable SSL, use latest twitter4j).

java.lang.NoClassDefFoundError: javax/persistence/Persistence... axis2 and eclipselink

I want to deploy axis2 web services in netbeans, i installed the plugin axis2 in netbeans. Also i use EclipseLink 2.0 to connect a db. My connection is successful when i use in a main class that i created. But when i try to test my web services in netbeans with right click on the services throw this exception:
[ERROR] javax/persistence/Persistence
java.lang.NoClassDefFoundError: javax/persistence/Persistence
at db.util.ManageConnection.getStatsEntityManagerFactory(ManageConnection.java:33)
at services.LoginService.loginService(LoginService.java:31)
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 org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
at org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(RPCInOnlyMessageReceiver.java:63)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:135)
at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:130)
at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:825)
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:271)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: Class Not found : javax.persistence.Persistence
at org.apache.axis2.deployment.DeploymentClassLoader.findClass(DeploymentClassLoader.java:92)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.apache.axis2.deployment.DeploymentClassLoader.loadClass(DeploymentClassLoader.java:273)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 31 more
[ERROR] org.apache.axis2.AxisFault: javax/persistence/Persistence
I can deploy others services that not contain connections with eclipselink (entityManager...)..
I found in others forum with the same problem but they're using hibernate, that the solution is add to classpath this: hibernate-jpa-2.0-api-1.0.0.Final.jar, in this link http://www.coderanch.com/t/513512/ORM/databases/Error-java-lang-NoClassDefFoundError-javax
But I dont Know what is the problem with EclipseLink i dont know if i add other library and where.. thank you very much...
This my service class
public class LoginService {
EntityManagerFactory emf = ManageConnection.
getStatsEntityManagerFactory(PersistenceConfiguration.
getPERSISTENCE_UNIT_NAME());
public String prubaServicioWeb(String nombre) {
return nombre + " Welcome";
}
public void loginService(String whatever) {
BankJpaController bankController = new
BankJpaController(emf);
Bank bank = new Bank();
bank.setId(null);
bank.setBankCode("BNSJ");
bank.setName("Bank of America");
bankController.create(bank);
}
}
You need the javax.persistence classes that come in either the javax.persistence_1.0.0.jar (if using only JPA 1.0) or javax.persistence_2.0.4.v201112161009.jar if using JPA 2.0 (the jar might be named slightly different, this was what was shipped with a 2.4 milestone).
These will be in the jlib/jpa directory of your EclipseLink download.