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

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.

Related

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.

NetBeans 7.4 not creating jar files properly

I am developing a project for a Java Enterprise Applications class. I have an application with an ejb module that has "facade" classes from a class library that connects to a simple Twitter-like database. All the logic is working fine, however, when I add the remote beans for the facade and try to run it, the application crashes with the stack trace included at the end.
Looking throught the GlassFish output screen, I found the following warnings:
WARNING: ACDEPL112: The following extensions or libraries are referenced from the manifest of C:\Users[project_path]\Questions\dist\gfdeploy\Questions\QuestionClient.jar but were not found where indicated: QuestionLib.jar ; ignoring and continuing
INFO: ACDEPL103: Java Web Start services started for the app client Questions/QuestionClient.jar (contextRoot: /Questions/QuestionClient)
INFO: Questions was successfully deployed in 3,097 milliseconds.
WARNING: The collection of metamodel [EntityType] types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units. Please verify that your entity classes are referenced in persistence.xml using either elements or a global false element. The lookup on [class com.problemSet3.db.Questions] will return null.
WARNING: EJB5184:A system exception occurred during an invocation on EJB QuestionsFacade, method: public java.util.List com.problemSet3.db.AbstractFacade.findAll()
When I checked the path, I found that the .jar file mentioned exists where it should, but it is instead named QuestionLib_jar and it is a folder with all the contents of the jar file. This files are being generated by NetBeans, I don't know how the jar files are being compiled to folders instead of actual jars.
How can I fix this?
Stack trace
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:446)
at org.glassfish.appclient.client.AppClientFacade.launch(AppClientFacade.java:183)
at org.glassfish.appclient.client.AppClientGroupFacade.main(AppClientGroupFacade.java:65)
Caused by: javax.ejb.EJBException
at com.sun.ejb.containers.EJBContainerTransactionManager.processSystemException(EJBContainerTransactionManager.java:748)
at com.sun.ejb.containers.EJBContainerTransactionManager.completeNewTx(EJBContainerTransactionManager.java:698)
at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:503)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4475)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2009)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1979)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:212)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:79)
at com.sun.proxy.$Proxy295.findAll(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:143)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:173)
at com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatchToServant(ServerRequestDispatcherImpl.java:528)
at com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatch(ServerRequestDispatcherImpl.java:199)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequestRequest(MessageMediatorImpl.java:1549)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequest(MessageMediatorImpl.java:1425)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleInput(MessageMediatorImpl.java:930)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:213)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequest(MessageMediatorImpl.java:694)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.dispatch(MessageMediatorImpl.java:496)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.doWork(MessageMediatorImpl.java:2222)
at com.sun.corba.ee.impl.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
at com.sun.corba.ee.impl.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
Caused by: java.lang.IllegalArgumentException: No [EntityType] was found for the key class [com.problemSet3.db.Questions] in the Metamodel - please verify that the [Entity] class was referenced in persistence.xml using a specific com.problemSet3.db.Questions property or a global false element.
at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.entityEmbeddableManagedTypeNotFound(MetamodelImpl.java:173)
at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.entity(MetamodelImpl.java:193)
at org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.internalFrom(CommonAbstractCriteriaImpl.java:114)
at org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl.from(AbstractQueryImpl.java:246)
at com.problemSet3.db.AbstractFacade.findAll(AbstractFacade.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4695)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:630)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55)
at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4667)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4655)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:205)
... 19 more
Java Result: 1
Well, after a painful night and morning I finally solved it. The persistence.xml file that was being used by the ejb module had this line:
<exclude-unlisted-classes>false</exclude-unlisted-classes>
I went into the properties and made it include each class manually, so now it looks like this:
<class>com.problemSet3.db.Answers</class>
<class>com.problemSet3.db.Questions</class>
<class>com.problemSet3.db.Users</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
plus the other generated code. I still get the warning on GlassFish, but no exceptions are thrown.

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.

What causes a com.sun.identity.agents.arch.AgentException with a message stating "invalid transport string" in a JBoss agent?

com.sun.identity.agents.arch.AgentException: Invalid transport string
at com.sun.identity.agents.util.TransportToken.initializeFromString(TransportToken.java:135)
at com.sun.identity.agents.util.TransportToken.(TransportToken.java:115)
at com.sun.identity.agents.common.SSOTokenValidator.validate(SSOTokenValidator.java:99)
at com.sun.identity.agents.realm.AmRealm.authenticate(AmRealm.java:141)
at com.sun.identity.agents.jboss.v40.AmJBossLoginModule.validatePassword(AmJBossLoginModule.java:88)
at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:249)
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 javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.defaultLogin(JaasSecurityManagerBase.java:552)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.authenticate(JaasSecurityManagerBase.java:486)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.isValid(JaasSecurityManagerBase.java:365)
at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:160)
at org.jboss.web.tomcat.security.JBossWebRealm.authenticate(JBossWebRealm.java:384)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:258)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:417)
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:662)
Based on the stacktrace it looks like you may try to use an application-client with your application that has enabled the AMRealm in its security-domain configuration (and/or AMRealm is the default security domain).
The transport string is basically the password that is being provided to the JAAS login module. I suppose you wanted to authenticate on your own (since the filter cannot be found on the stacktrace I'm guessing that this is not a web request..). Without any further info it is hard to help to diagnose your problem..

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

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.