[Remoting] - Re: Is Http Firewall tunneling in Remoting or Messaging ?
by tom.elrodï¼ jboss.com
Guess the first question is what type of firewalls are you trying to by-pass? If is just a simple firewall that only allows outbound connections on any port but does not allow inbound connections, can use the remoting multiplex transport which will allow the server to communicate back to the client over the same physical outbound connection established by the client.
If the firewall actually checks the request header to verify it is indeed an http request, then would be forced to use the remoting http transport. Can still get callbacks from the server using the http transport, but would have to do using polling, so there would be a slight delay in getting those callbacks.
In the case of multiplex transport, remoting only supports synchronous callbacks at the moment (but are currently working on support for async callbacks as well).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989456#3989456
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989456
19Â years, 5Â months
[JBoss Seam] - IllegalArgumentException: Could not set field value by refle
by js314
Trying to get a simple example to run with an entity bean, test.Test2, being injected into a session bean, test.TestSessionBean upon form submit. I know this must be something simple but can't seem to figure it out.. Using 1.1.0 CR1. Code/stack trace as follows. Thanks!
@Stateless
| @Name("testSessionBean")
| public class TestSessionBean implements TestSession {
|
| @In
| private Test2 test2;
@Entity
| @Name("test2")
| @Scope(SESSION)
| @Table(name="test2")
| public class Test2 implements Serializable{
|
| @Id @GeneratedValue(strategy=GenerationType.AUTO)
| private long id;
| private String key;
| private String value;
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
| <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
| <html>
| <head>
| <title>Test</title>
| </head>
| <body>
| <f:view>
| <h:form>
| <table border="0">
| <tr>
| <td>Key</td>
| <td><h:inputText value="#{test2.key}"/></td>
| </tr>
| <tr>
| <td>Value</td>
| <td><h:inputText value="#{test2.value}"/></td>
| </tr>
| </table>
| <h:messages/>
| <h:commandButton type="submit" value="Register" action="#{testSessionBean.seamTest}"/>
| </h:form>
| </f:view>
| </body>
| </html>
| javax.ejb.EJBException: java.lang.IllegalArgumentException: could not set field value: testSessionBe
| an.test2
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:6
| 2)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:
| 131)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:58)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
| at $Proxy774.seamTest(Unknown Source)
| at test.TestSession$$FastClassByCGLIB$$57e94628.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:69)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
| at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
| at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
| at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:78
| )
| at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:47)
| at test.TestSession$$EnhancerByCGLIB$$5ac36cfc.seamTest(<generated>)
| 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:585)
| at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
| at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper
| .java:59)
| at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:71)
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
| at javax.faces.component.UICommand.broadcast(UICommand.java:106)
| at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
| at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
| at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
| at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
| 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(Http11Base
| Protocol.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:613)
| Caused by: java.lang.IllegalArgumentException: could not set field value: testSessionBean.test2
| at org.jboss.seam.Component.setFieldValue(Component.java:1526)
| at org.jboss.seam.Component.injectFields(Component.java:1317)
| at org.jboss.seam.Component.inject(Component.java:1087)
| at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java
| :48)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(Conversati
| onInterceptor.java:51)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
| at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
| 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:585)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:6
| 3)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityMa
| nagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| ... 70 more
| Caused by: java.lang.IllegalArgumentException: Could not set field value by reflection: TestSessionB
| ean.test2 on: test.TestSessionBean with value: class test.Test2
| at org.jboss.seam.util.Reflections.set(Reflections.java:75)
| at org.jboss.seam.Component.setFieldValue(Component.java:1522)
| ... 112 more
| Caused by: java.lang.IllegalArgumentException
| at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
| at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:57)
| at java.lang.reflect.Field.set(Field.java:656)
| at org.jboss.seam.util.Reflections.set(Reflections.java:61)
| ... 113 more
| 12:47:34,090 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| javax.faces.FacesException: Error calling action method of component with id _idJsp0:_idJsp4
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
| at javax.faces.component.UICommand.broadcast(UICommand.java:106)
| at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
| at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
| at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
| at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
| 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(Http11Base
| Protocol.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:613)
| Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{testSessionBean
| .seamTest}
| at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
| at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper
| .java:59)
| at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:71)
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
| ... 25 more
| Caused by: javax.ejb.EJBException: java.lang.IllegalArgumentException: could not set field value: te
| stSessionBean.test2
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:6
| 2)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:
| 131)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:58)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
| at $Proxy774.seamTest(Unknown Source)
| at test.TestSession$$FastClassByCGLIB$$57e94628.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:69)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
| at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
| at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
| at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:78
| )
| at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:47)
| at test.TestSession$$EnhancerByCGLIB$$5ac36cfc.seamTest(<generated>)
| 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:585)
| at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
| ... 28 more
| Caused by: java.lang.IllegalArgumentException: could not set field value: testSessionBean.test2
| at org.jboss.seam.Component.setFieldValue(Component.java:1526)
| at org.jboss.seam.Component.injectFields(Component.java:1317)
| at org.jboss.seam.Component.inject(Component.java:1087)
| at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java
| :48)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(Conversati
| onInterceptor.java:51)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
| at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
| 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:585)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:6
| 3)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityMa
| nagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| ... 70 more
| Caused by: java.lang.IllegalArgumentException: Could not set field value by reflection: TestSessionB
| ean.test2 on: test.TestSessionBean with value: class test.Test2
| at org.jboss.seam.util.Reflections.set(Reflections.java:75)
| at org.jboss.seam.Component.setFieldValue(Component.java:1522)
| ... 112 more
| Caused by: java.lang.IllegalArgumentException
| at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
| at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:57)
| at java.lang.reflect.Field.set(Field.java:656)
| at org.jboss.seam.util.Reflections.set(Reflections.java:61)
| ... 113 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989450#3989450
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989450
19Â years, 5Â months
[EJB 3.0] - Problem w/ quoted fields in generated SQL
by tsar_bomba
I'm using a Progress 10.1 database that requires all queries to have quoted field names, e.g. select "name", "age" from customer.
In my entities, I'm using the back-tick (`) character to make sure field names are quoted. It works fine until I have parent-child relationship in a @OneToMany (bi-directional) setup.
Here are the entities:
| @Entity
| @Table(name="pub.customer")
| public class Customer implements Serializable
| {
| @Id
| @Column(name="`Cust-no`", nullable=false)
| private String custno;
|
| @OneToMany(mappedBy="customer")
| private List<CustomerOrder> orders;
| ...................
| }
|
| @Entity
| @Table(name="pub.order")
| public class CustomerOrder implements Serializable
| {
| @EmbeddedId
| private CustomerOrderPK customerOrderPK;
|
| @Column(name="`Cust-no`", nullable=false, insertable=false, updatable=false)
| private String custno;
|
| @ManyToOne(fetch=FetchType.LAZY)
| @JoinColumn(name="`Cust-no`")
| private Customer customer;
| .................
| }
|
...and here's the PK class from the CustomerOrder entity, just for the sake of being thorough:
| @Embeddable
| public class CustomerOrderPK implements Serializable
| {
| @Column(name="`Ar-entity`", nullable=false)
| private String arentity;
|
| @Column(name="`Order-no`")
| private Integer orderno;
| .......................
| }
|
I query it in a SLSB like so:
| public Customer getTestCustomer(String custno)
| {
| String query = "select c from Customer c " +
| "left join fetch c.orders " +
| "where c.custno = :custno";
|
| Query q = this.em.createQuery(query);
| q.setParameter("custno", custno);
|
| return (Customer)q.getSingleResult();
| }
|
Here is the query that is generated at runtime:
| Hibernate:
| /* select
| c
| from
| Customer c
| left join
| fetch c.orders
| where
| c.custno = :custno */ select
| customer0_."Cust-no" as Cust1_160_0_,
| orders1_."Ar-entity" as Ar1_161_1_,
| orders1_."Order-no" as Order2_161_1_,
| customer0_."Name" as Name2_160_0_,
| customer0_."Filler1" as Filler3_160_0_,
| customer0_."City" as City4_160_0_,
| customer0_."St" as St5_160_0_,
| customer0_."Zip-code" as Zip6_160_0_,
| customer0_."Country" as Country7_160_0_,
| customer0_."Telephone" as Telephone8_160_0_,
| customer0_."Contact" as Contact9_160_0_,
| customer0_."Status-code" as Status10_160_0_,
| customer0_."Slsmn-code" as Slsmn11_160_0_,
| customer0_."Type-code" as Type12_160_0_,
| customer0_."Via-code" as Via13_160_0_,
| customer0_."Terr-code" as Terr14_160_0_,
| customer0_."Sort-name" as Sort15_160_0_,
| customer0_."Priority" as Priority16_160_0_,
| customer0_."Comm-code" as Comm17_160_0_,
| customer0_."Description" as Descrip18_160_0_,
| customer0_."Dest-loc" as Dest19_160_0_,
| customer0_."Country-code" as Country20_160_0_,
| customer0_."Address" as Address21_160_0_,
| customer0_."Partner" as Partner22_160_0_,
| customer0_."Residential" as Residen23_160_0_,
| customer0_."Gst-code" as Gst24_160_0_,
| customer0_."Cust-number" as Cust25_160_0_,
| customer0_."sls-contact" as sls26_160_0_,
| customer0_."hold-order" as hold27_160_0_,
| customer0_."supl-code" as supl28_160_0_,
| orders1_."In-entity" as In3_161_1_,
| orders1_."Whs-code" as Whs4_161_1_,
| orders1_."Cust-no" as Cust5_161_1_,
| orders1_."Ship-no" as Ship6_161_1_,
| orders1_."Cust-po" as Cust7_161_1_,
| orders1_."Order-date" as Order8_161_1_,
| orders1_."Order-code" as Order9_161_1_,
| orders1_."Slsmn-code" as Slsmn10_161_1_,
| orders1_."Via-desc" as Via11_161_1_,
| orders1_."Order-disc" as Order12_161_1_,
| orders1_."Ship-name" as Ship13_161_1_,
| orders1_."Ship-city" as Ship14_161_1_,
| orders1_."Ship-st" as Ship15_161_1_,
| orders1_."Ship-country" as Ship16_161_1_,
| orders1_."Ship-zip" as Ship17_161_1_,
| orders1_."Pps-no" as Pps18_161_1_,
| orders1_."Invoice-no" as Invoice19_161_1_,
| orders1_."Invoice-date" as Invoice20_161_1_,
| orders1_."Qty-orig-ord" as Qty21_161_1_,
| orders1_."Qty-shipped" as Qty22_161_1_,
| orders1_."Qty-open-ord" as Qty23_161_1_,
| orders1_."Alloc-qty" as Alloc24_161_1_,
| orders1_."Alloc-value" as Alloc25_161_1_,
| orders1_."Seq-no" as Seq26_161_1_,
| orders1_."Partial-inv" as Partial27_161_1_,
| orders1_."Estimate-no" as Estimate28_161_1_,
| orders1_."Total-weight" as Total29_161_1_,
| orders1_."Sent-by" as Sent30_161_1_,
| orders1_."Sent-order" as Sent31_161_1_,
| orders1_."Sent-entity" as Sent32_161_1_,
| orders1_."Transfer-to" as Transfer33_161_1_,
| orders1_."Via-code" as Via34_161_1_,
| orders1_."Country-code" as Country35_161_1_,
| orders1_."Dest-loc" as Dest36_161_1_,
| orders1_."Drop-ship" as Drop37_161_1_,
| orders1_."Site-code" as Site38_161_1_,
| orders1_."Ship-address" as Ship39_161_1_,
| orders1_."Trans-type" as Trans40_161_1_,
| orders1_."Trans-mode" as Trans41_161_1_,
| orders1_."Ship-site" as Ship42_161_1_,
| orders1_."Order-site" as Order43_161_1_,
| orders1_."ship-date" as ship44_161_1_,
| orders1_."address-no" as address45_161_1_,
| orders1_."bev-country" as bev46_161_1_,
| orders1_."Route-no" as Route47_161_1_,
| orders1_.Cust-no as Cust48_0__, --PROBLEM!!
| orders1_."Ar-entity" as Ar1_0__,
| orders1_."Order-no" as Order2_0__
| from
| pub.customer customer0_
| left outer join
| pub.order orders1_
| on customer0_."Cust-no"=orders1_.Cust-no --PROBLEM!!
| where
| customer0_."Cust-no"=?
|
|
As you can see, the field names are quoted but the right-hand side of the join is incorrect...the join field is not quoted, resulting in this exception:
| Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
| at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:647)
| at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:99)
| at com.myapp.CustomerBean.getTestCustomer(CustomerBean.java:61)
| ...............................
|
| Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
| at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
| at org.hibernate.loader.Loader.doList(Loader.java:2147)
| at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
| at org.hibernate.loader.Loader.list(Loader.java:2023)
| at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
| at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
| at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
| at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
| at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
| at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:80)
| ... 71 more
| Caused by: java.sql.SQLException: [DataDirect][OpenEdge JDBC Driver][OpenEdge] Column "ORDERS1_.CUST" cannot be found or is not specified for query. (13865)
| at com.ddtek.jdbc.openedge.client.OpenEdgeClientRequest.prepareProcessReply(Unknown Source)
| at com.ddtek.jdbc.openedge.client.OpenEdgeClientRequest.prepare(Unknown Source)
| at com.ddtek.jdbc.openedge.OpenEdgeImplStatement.prepare(Unknown Source)
| at com.ddtek.jdbc.base.BaseImplStatement.prepare(Unknown Source)
| ...............................................
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989443#3989443
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989443
19Â years, 5Â months