Problems with ROP (on M2 and different on M3)

From: hmai..otmail.ru
Date: Thu Feb 07 2008 - 11:26:43 EST

  • Next message: Kevin Menard: "Re: Problems with ROP (on M2 and different on M3)"

    Hello!

    I've got problems running SelectQueries using ROP.
    They seem really serious to me, or maybe i'm doing something wrong?

    -----------FIRST PROBLEM----------------
    First, with M3. After i switched to M3, simply running my query:
    SelectQuery query = new SelectQuery(Militaryman.class, null);
    List result = context.performQuery(query);

    gets me an exception on client side (pojo class here does not matter, and i don't have any int columns):
    Exception in thread "AWT-EventQueue-0" org.apache.cayenne.CayenneRuntimeException: [v.3.0M2 Oct 28 2007 16:09:02] Remote error. URL - http://localhost:8080/cayenne/cws; CAUSE - expected int at M
            at org.apache.cayenne.remote.hessian.HessianConnection.doSendMessage(HessianConnection.java:145)
            at org.apache.cayenne.remote.BaseConnection.sendMessage(BaseConnection.java:73)[18:59:49 INFO] - *** Message error for 0: Bootstrap - took 375 ms.

            at org.apache.cayenne.remote.ClientChannel.send(ClientChannel.java:276)
            at org.apache.cayenne.remote.ClientChannel.getEntityResolver(ClientChannel.java:232)
            at org.apache.cayenne.CayenneContext.getEntityResolver(CayenneContext.java:178)
            at org.apache.cayenne.util.ObjectContextQueryAction.<init>(ObjectContextQueryAction.java:71)
            at org.apache.cayenne.CayenneContextQueryAction.<init>(CayenneContextQueryAction.java:41)
            at org.apache.cayenne.CayenneContext.onQuery(CayenneContext.java:352)
            at org.apache.cayenne.CayenneContext.performQuery(CayenneContext.java:341)
            at com.nic.joker.data.pojo.cayenne.CayenneEntityManager.select(CayenneEntityManager.java:144)
            at com.nic.joker.data.pojo.POJOEntityViewList.load(POJOEntityViewList.java:91)
            at test.B.handle(B.java:28)
            at com.nic.joker.kernel.xml.oldstyle.OldStyleEventHandler.handle(OldStyleEventHandler.java:110)
            at com.nic.joker.kernel.EventController.run(EventController.java:118)
            at com.nic.joker.kernel.EventController.deliverEvent(EventController.java:129)
            at com.nic.joker.ui.swing.event.ButtonController.actionPerformed(ButtonController.java:36)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6038)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
            at java.awt.Component.processEvent(Component.java:5803)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4410)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2429)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Caused by: com.caucho.hessian.io.HessianProtocolException: expected int at M
            at com.caucho.hessian.io.HessianInput.error(HessianInput.java:1687)
            at com.caucho.hessian.io.HessianInput.expect(HessianInput.java:1679)
            at com.caucho.hessian.io.HessianInput.readInt(HessianInput.java:533)
            at com.caucho.hessian.io.JavaDeserializer$IntFieldDeserializer.deserialize(JavaDeserializer.java:475)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:199)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:141)
            at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1030)
            at com.caucho.hessian.io.ArrayDeserializer.readList(ArrayDeserializer.java:101)
            at com.caucho.hessian.io.SerializerFactory.readList(SerializerFactory.java:329)
            at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1149)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:201)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:141)
            at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1030)
            at com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializer.deserialize(JavaDeserializer.java:383)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:199)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:141)
            at com.caucho.hessian.io.SerializerFactory.readMap(SerializerFactory.java:343)
            at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1155)
            at com.caucho.hessian.io.MapDeserializer.readMap(MapDeserializer.java:114)
            at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1030)
            at com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializer.deserialize(JavaDeserializer.java:383)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:199)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:141)
            at com.caucho.hessian.io.SerializerFactory.readMap(SerializerFactory.java:343)
            at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1155)
            at com.caucho.hessian.io.CollectionDeserializer.readList(CollectionDeserializer.java:78)
            at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1047)
            at com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializer.deserialize(JavaDeserializer.java:383)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:199)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:141)
            at com.caucho.hessian.io.SerializerFactory.readMap(SerializerFactory.java:343)
            at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1155)
            at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1007)
            at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:201)
            at $Proxy0.processMessage(Unknown Source)
            at org.apache.cayenne.remote.hessian.HessianConnection.doSendMessage(HessianConnection.java:140)
            ... 40 more

    -----------SECOND PROBLEM----------------
    Second problem is on M2 (as you can see, i wasn't able to test it on M3):

    When i use simple query, without any parameters, everything works fine:

    SelectQuery query = new SelectQuery(Militaryman.class, expression);
    List result = context.performQuery(query);

    But then i try to add some parameters (no matter which!!!):

    String expr = "militarymanname like 'A%'";
    Expression expression = Expression.fromString(expr);
    SelectQuery query = new SelectQuery(getPOJOClass(type.getName()), expression);
    List result = context.performQuery(query);

    I've tried different parameters, tried using ExpressionFactory, but exception is all the same.
    (and there is no mention in persistence limitations doc that expressions do not work there).

    Exception (on server side):
    19:20:53,074 ERROR [[cws]] Servlet.service() for servlet cws threw exception
    com.caucho.hessian.io.HessianFieldException: org.apache.cayenne.exp.parser.SimpleNode.children: [Ljava.lang.Object; ([Ljava.lang.Object..24044e) cannot be assigned to [Lorg.apache.cayenne.exp.parser.Node;
            at com.caucho.hessian.io.JavaDeserializer.logDeserializeError(JavaDeserializer.java:589)
            at com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializer.deserialize(JavaDeserializer.java:387)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:199)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:141)
            at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1634)
            at com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializer.deserialize(JavaDeserializer.java:383)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:199)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:141)
            at org.apache.cayenne.remote.hessian.service.ServerAbstractQueryDeserializer.readMap(ServerAbstractQueryDeserializer.java:49)
            at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1634)
            at com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializer.deserialize(JavaDeserializer.java:383)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:199)
            at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:141)
            at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1634)
            at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:149)
            at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:391)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            at java.lang.Thread.run(Thread.java:619)

    Thanks,
    Andrey)



    This archive was generated by hypermail 2.0.0 : Thu Feb 07 2008 - 11:27:20 EST