I created a default GWT project and trying to create a document in the database with a simple entry using CouchDB as my database. Previously we were using CouchDB 1.6 i.e futon as UI. Now, recently trying to use CouchDB 2.0 i.e Fauxton as UI.
PROBLEM:-
Unable to create a document in CouchDB 2.0.
SERVER SIDE CODE:-
public String greetServer(String input) throws IllegalArgumentException {
// Verify that the input is valid.
System.out.println(input);
Session session=new Session("192.168.1.48",5984);
Database db=session.getDatabase("testing");
Document doc=new Document();
doc.put("name", input);
db.saveDocument(doc);
return "Hello, " + input;
}
EXCEPTION:-
2017-02-22 17:23:41.147:WARN:/:qtp10750155-45: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String com.dbconnect.client.GreetingService.greetServer(java.lang.String) throws java.lang.IllegalArgumentException' threw an unexpected exception: net.sf.json.JSONException: JSONObject["update_seq"] is not a number.
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:416)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:605)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:333)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:303)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:95)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Unknown Source)
Caused by:
net.sf.json.JSONException: JSONObject["update_seq"] is not a number.
at net.sf.json.JSONObject.getDouble(JSONObject.java:2090)
at net.sf.json.JSONObject.getInt(JSONObject.java:2109)
at com.fourspaces.couchdb.Database.<init>(Database.java:50)
at com.fourspaces.couchdb.Session.getDatabase(Session.java:185)
at com.dbconnect.server.GreetingServiceImpl.greetServer(GreetingServiceImpl.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:587)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:333)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:303)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:95)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Unknown Source)
/**********************************EDIT 1************************/
Link where mentioned about update_seq
The thing is we are not updating update_seq through our code its auto has done at the time of creation document in the database. So, don't know whats the issue.
Forgot to write that database is been created through java easily on CouchDB 2.0.
Do WE HAVE TO USE NEW VERSIONS OF JAR FILES>?
The problem has to do with couchdb4j being old (last commit on github was nearly 5 years ago).
This post also states this an suggests using a client-library that's more actively worked on e.g. Ektorp (see CouchDB Java client).
Background on the couchbd4j-problem you are facing
The migration documentation you linked (https://blog.couchdb.org/2016/08/17/migrating-to-couchdb-2-0/) states:
Most importantly, the update seq, or sequence, is not a number any
longer but a string.
As you said you do not deal with update_seq directly but couchdb4j does.
The current implementation of couchdb4j client-library parses the server-response-property update_seq as Integer using the following code:
updateSeq = json.getInt("update_seq");
And this will no longer work with CouchDb 2.0
Here's a link to the most recent code containing this line: https://github.com/mbreese/couchdb4j/blob/master/src/java/com/fourspaces/couchdb/Database.java (see line 59)
I hope this helped,
Christian
Use matching or new version of jar files everywhere in client as well as server. One may do directory search for file versions. Clean and rebuild whole project to eliminate possibilities of old files being picked.
Related
I am trying to migrate from an on premises TFS to online using OpsHub VSO Migration Tool, but it fails when it gets to the user mapping screen with the below error. I have tried clearing the TFS cache and restarting the migration tool, but it still fails. Any help would be greatly appreciated.
10/14/2015 11:43:43,132 ERROR [http-8989-1] (com.opshub.eai.config.service.ConfigServiceImpl) - OH-TFS-Connector-0051: Operation failed getUserList. Server Error : Server was unable to process request. ---> There was an error generating the XML document. ---> TF20507: The string argument contains a character that is not valid:'u0153'. Correct the argument, and then try the operation again.
Parameter name: value
com.opshub.eai.tfs.exception.OIMTFSApiExcpetion: OH-TFS-Connector-0051: Operation failed getUserList. Server Error : Server was unable to process request. ---> There was an error generating the XML document. ---> TF20507: The string argument contains a character that is not valid:'u0153'. Correct the argument, and then try the operation again.
Parameter name: value
at com.opshub.eai.tfs.adapter.TFSClient.getUserList(TFSClient.java:502)
at com.opshub.eai.tfs.adapter.TFSAdapter.getUserList(TFSAdapter.java:550)
at com.opshub.eai.config.business.ConfigServiceBusiness.getUserList(ConfigServiceBusiness.java:975)
at com.opshub.eai.config.service.ConfigServiceImpl.getUserList(ConfigServiceImpl.java:408)
at com.opshub.eai.config.service.ConfigServiceImpl$$EnhancerByCGLIB$$a8e82089.CGLIB$getUserList$6(<generated>)
at com.opshub.eai.config.service.ConfigServiceImpl$$EnhancerByCGLIB$$a8e82089$$FastClassByCGLIB$$17643662.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
at com.opshub.eai.config.service.ServiceInterception.intercept(ServiceInterception.java:48)
at com.opshub.eai.config.service.ConfigServiceImpl$$EnhancerByCGLIB$$a8e82089.getUserList(<generated>)
at com.opshub.eai.config.service.ConfigService.getUserList(ConfigService.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
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:175)
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: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(Unknown Source)
I got this kind of error. when trying to read a properties file It works fine in development mode but when I trying to deploy app to tomcat this error is comes.
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type 'java.io.FileNotFoundException' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object not found in the classpath
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:619)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:153)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:539)
at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:616)
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:390)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Whenever you make an Rpc call, the classes involved must implement java.io.Serializable. In your case, this might have happened.
In your service class methods you somewhere mentioned one of the arguments or return type as java.io.FileNotFoundException which does not implement java.io.Serializable. Hence it cannot be serialized.
EDIT : This might help you Serialization Exception while making an RPC call
Every exception that could go to the client-side has to be declared in a throws clause in your RemoteService interface.
If it's working in DevMode, it's probably because you don't have such an exception. You have to find the cause of the FileNotFoundException.
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.
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.
I am trying to deploy solr 3.5 in Jboss 5.1 server. I've modified the
WEB-INF\web.xml to set the solr home by adding the following:
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>E:\apache-solr-3.5.0\example\solr</env-entry-value>
</env-entry>
Now when I start jboss I get this error. The wiki says remove
xercesImpl-2.8.1.jar
and xml-apis-1.3.03.jar from WEB-INF\lib in solr.war. But I don't see these
jars in that location for Solr 3.5.
Thanks.
13:30:39,614 ERROR [AbstractKernelController] Error installing to Parse:
name=vfsfile:/E:/jboss/server/default/deploy/solr.war/ state=PreParse
mode=Manual requiredState=Parse
org.jboss.deployers.spi.DeploymentException: Error creating managed object
for vfsfile:/E:/jboss/server/default/deploy/solr.war/
at
org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
at
org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:362)
at
org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:322)
at
org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:294)
at
org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:234)
at
org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
at
org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1454)
at
org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1172)
at
org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1113)
at
org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at
org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
at
org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:789)
at
org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)
at
org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at
org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at
org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at
org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
at
org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
at
org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)
at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)
at
org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
at
org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source:
The content of element type "env-entry" must match
"(description?,env-entry-name,env-entry-value?,env-entry-type)". #
vfsfile:/E:/jboss/server/default/deploy/solr.war/WEB-INF/web.xml[47,14]
at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
at
org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:189)
at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:166)
at
org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137)
at
org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121)
at
org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:304)
at
org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:286)
at
org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:203)
at
org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:348)
... 33 more
Caused by: org.xml.sax.SAXException: The content of element type
"env-entry" must match
"(description?,env-entry-name,env-entry-value?,env-entry-type)". #
vfsfile:/E:/jboss/server/default/deploy/solr.war/WEB-INF/web.xml[47,14]
at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.error(SaxJBossXBParser.java:426)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
... 42 more
It is late to post an answer, perhaps, but the solution was so easy (and time-consuming, if you do not already know it!) that I thought I had to share it! Hoping this helps…
Uncomment the block looking like this:
<!-- People who want to hardcode their "Solr Home" directly into the
WAR File can set the JNDI property here...
-->
<env-entry>
<env-entry-name>/solr/home</env-entry-name>
<env-entry-value>/the/path/to/your/solr/home</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
but put the env-entry node as the last child of the web-app node, and not as the first (like in the original web.xml file).
Then you're gone.
I personally tested it on a JBoss AS 6.0.0 installation over a Ubuntu Linux machine (OpenJDK for Java v. 1.6.0_24 / IcedTea6 1.11.4), with Solr 3.6.1.