Re: [jboss-dev-forums] [JBoss Microcontainer Development] - JBREFLECT-5 - Implementing generics in JavassistClassInfo
by Kabir Khan
Kabir Khan [http://community.jboss.org/people/kabir.khan%40jboss.com] replied to the discussion
"JBREFLECT-5 - Implementing generics in JavassistClassInfo"
To view the discussion, visit: http://community.jboss.org/message/539766#539766
--------------------------------------------------------------
2 - classloader for parameterized type
I posted this last night right after my "1 - other problem", but could not see it again today?!?
Anyway, for a test still using SomeSignature and SomeValue, but now uses the lazy feature where I do something along the lines of
public void testClasses() throws Throwable
{
generateClasses();
ClassInfo info = (Classinfo)getTypeInfoFactory().getTypeInfo(SomeSignature.class);
MethodInfo mi = info.getDeclaredMethod("signature", new TypeInfo[0]);
ClassInfo returnInfo = mi.getReturnType(); //Constructs the parameterized class info internally
TypeInfo[] args = returnInfo.getActualTypeArguments(); //* Lazily loads the type arguments
}
This fails with the call to returnInfo.getActualTypeArguments()
java.lang.IllegalStateException: java.lang.ClassNotFoundException: org.jboss.test.classinfo.test.JavassistParameterizedClassInfoClassLoaderArgumentsTestCaseWithSignature
at org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl.getTypeInfo(JavassistTypeInfoFactoryImpl.java:840)
at org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl.createTypeInfoForTypeArgument(JavassistTypeInfoFactoryImpl.java:898)
at org.jboss.reflect.plugins.javassist.JavassistParameterizedClassInfo.getActualTypeArguments(JavassistParameterizedClassInfo.java:115)
....
Caused by: java.lang.ClassNotFoundException: org.jboss.test.classinfo.test.JavassistParameterizedClassInfoClassLoaderArgumentsTestCaseWithSignature
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.resolveComplexTypeInfo(IntrospectionTypeInfoFactoryImpl.java:434)
at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getTypeInfo(IntrospectionTypeInfoFactoryImpl.java:390)
at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory.getTypeInfo(IntrospectionTypeInfoFactory.java:54)
at org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl.delegateToIntrospectionImplementation(JavassistTypeInfoFactoryImpl.java:620)
at org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl.get(JavassistTypeInfoFactoryImpl.java:547)
at org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl.get(JavassistTypeInfoFactoryImpl.java:454)
at org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl.get(JavassistTypeInfoFactoryImpl.java:411)
at org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl.getTypeInfo(JavassistTypeInfoFactoryImpl.java:836)
... 23 more
The reason is that I am using the classloader of the raw type (i.e. Set) to load up this parameterized type, but obviously SomeValue cannot be found there.
One way around this would be in mi.getReturnType() when looking up/creating/caching the parameterized class info to use the classloader of mi.getDeclaringClass().getClassLoader(), which should be able to see all the classes involved. However, I am still stuck on which classloader to use for my previous post.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/539766#539766]
Start a new discussion in JBoss Microcontainer Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years
[JBoss ESB Development] - Where to find SOAPProcessor?
by Sebastian Vergara
Sebastian Vergara [http://community.jboss.org/people/svergara] created the discussion
"Where to find SOAPProcessor?"
To view the discussion, visit: http://community.jboss.org/message/539656#539656
--------------------------------------------------------------
Hi, this is my first post about JBossESB.
I downloaded jbossesb-4.8 and deployed it in the jboss-5.1.0.GA AS. But, when I'm trying to use the SOAPProceesor class an error ocurres in the import. I don't know where to find this class.
**************************************************************************************************************************************************************************
package org.jboss.soa.esb.samples.quickstart.webserviceproducer.webservice;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.Oneway;
import javax.jws.WebParam;
import javax.jws.soap.SOAPBinding;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.actions.ActionUtils;
import org.jboss.soa.esb.actions.soap.SOAPProcessor; <----------- This is where it doesn't work!
/**
* @author
*/
@WebService(name = "GoodbyeWorldWS", targetNamespace = " http://webservice_producer/goodbyeworld http://webservice_producer/goodbyeworld")
// @SOAPBinding(style = SOAPBinding.Style.RPC)
public class GoodbyeWorldWS {
@WebMethod
public String sayGoodbye(@WebParam(name = "message") String message) {
Message esbMessage = SOAPProcessor.getMessage();
if (esbMessage != null) {
System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
// System.out.println("\n" + esbMessage.toString() + "\n");
}
System.out.println("Web Service Parameter - message=" + message);
return "... Ah Goodbye then!!!! - " + message;
}
@WebMethod
public String sayAdios(String message) {
Message esbMessage = SOAPProcessor.getMessage();
if (esbMessage != null) {
System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
// System.out.println("\n" + esbMessage.toString() + "\n");
}
System.out.println("Web Service Parameter - message=" + message);
return "... Adios Amigo!!!! - " + message;
}
@WebMethod
@Oneway
public void sayGoodbyeWithoutResponse(@WebParam(name = "message") String message) {
Message esbMessage = SOAPProcessor.getMessage();
if (esbMessage != null) {
System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
}
System.out.println("Web Service Parameter - message=" + message);
}
}
**************************************************************************************************************************************************************************
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/539656#539656]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years