[Javassist user questions] - sun.reflect.UnsafeStaticObjectFieldAccessorImpl
by steve.ebersole@jboss.com
I am trying to understand the scenarios which could lead to javassist throwing the following error:
2009-07-27 15:49:32,094 INFO [STDOUT] 15:49:32,091 ERROR [BasicLazyInitializer] Javassist Enhancement failed: com.edg.quote.model.SimultaneousFee
java.lang.RuntimeException: java.lang.IllegalArgumentException
at javassist.util.proxy.ProxyFactory.setField(ProxyFactory.java:356)
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:339)
at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:312)
at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:271)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:138)
at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate(JavassistProxyFactory.java:42)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:135)
at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:295)
at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:434)
at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at com.edg.quote.dao.hibernate.DaoImpl.read(DaoImpl.java:29)
at com.edg.quote.generator.States.(States.java:21)
at com.edg.quote.generator.StatesFactory.getStates(StatesFactory.java:7)
at com.edg.quote.services.ZipResource.validateZip(ZipResource.java:18)
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.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
at org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalArgumentException
at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(UnsafeStaticObjectFieldAccessorImpl.java:61)
at java.lang.reflect.Field.set(Field.java:656)
at javassist.util.proxy.ProxyFactory.setField(ProxyFactory.java:352)
... 56 more
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246769#4246769
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246769
16 years, 3 months
[JBossWS] - Username token: Problem accessing the soap message. Empty he
by kaymayus
Hi All,
on using username profile with the POJO endpoint i realized that the saop header in the POJO was empty (no child elements).
I could confirm this on debugging the SOAPMessage in the POJO.
I need the username within the POJO for further authorization checks.
The simple HelloWorld WebService as well as authentication and authorisation (JAAS) are working fine, but as i said, no child elements in the soap header.
I used:
JBoss 4.2.3.GA
jbossws-native-3.1.1.GA
And
JBoss 5.1.0.GA
jbossws-native-3.1.2.GA
No success!
The sent mesage from the client using soapui is:
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <env:Header>
| <wsse:Security env:mustUnderstand='1' xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext...' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>
| <wsse:UsernameToken wsu:Id='token-1-1248789148312-14111765'>
| <wsse:Username>kermit</wsse:Username>
| <wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pr...'>thefrog</wsse:Password>
| </wsse:UsernameToken>
| </wsse:Security>
| </env:Header>
| <env:Body>
| <ns1:sayHello xmlns:ns1='org.jbia.ws'>
| <arg0>World</arg0>
| </ns1:sayHello>
| </env:Body>
| </env:Envelope>
|
This is the same message that has been traced in the server log. So, the message ist ok. Furthermore authorisation and authentication are working.
I tried to get the header child elements in the following ways:
1)
| SOAPMessageContext soapMessageContext = (SOAPMessageContext)wsCtx.getMessageContext();
| SOAPMessage message = soapMessageContext.getMessage();
| try {
| Iterator it = message.getSOAPHeader().getChildElements();
| while(it.hasNext()){
| System.out.println("The child: " + it.next().toString());
| }
| } catch (SOAPException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
|
2)
| CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
| try {
| SOAPHeader header = msgContext.getSOAPMessage().getSOAPHeader();
| Iterator it = header.getChildElements();
| while(it.hasNext()){
| System.out.println("The child: " + it.next().toString());
| }
| } catch (SOAPException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
|
3)
| SOAPEnvelope envelope;
| try {
| envelope = soapMessageContext.getMessage().getSOAPPart().getEnvelope();
| SOAPHeader soapHeader = envelope.getHeader();
| Iterator it = soapHeader.getChildElements();
| while(it.hasNext()){
| Object o = it.next();
| System.out.println("The Child: " + o.toString());
| }
| } catch (SOAPException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
|
I even tried to get the principal:
| Principal principal = wsCtx.getUserPrincipal();
| if (principal==null){
| System.out.println("There is no principal name");
| } else {
| System.out.println("The principal name is " + principal.getName());
| }
|
But no success!
Am i missing something? is there another way to handel this issue? is there any workarround for this? wrong version of jboss and jbossws-native?
I apreciate very gratefully any suggestion.
Thank's
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246764#4246764
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246764
16 years, 3 months