[JBoss Microcontainer Development] - Servlet Scanner plugin
by Remy Maucherat
Remy Maucherat [http://community.jboss.org/people/remy.maucherat%40jboss.com] created the discussion
"Servlet Scanner plugin"
To view the discussion, visit: http://community.jboss.org/message/533736#533736
--------------------------------------------------------------
Hi,
For Servlet annotation scanning, I would need the following APIs:
- For Servlet annotation processing, query classes from a JAR for a set of annotations (on fields, methods, type); could return a Set keyed per annotation (given the current org.jboss.metadata.annotation.creator.Processor a simple set of classes would be ok too)
- For ServletContainerInitializer implementation, query classes from a "classpath" (a list of VirtualFile) for a set of annotations (on fields, methods, type) and implemented interfaces/classes; return a set of classes
This would translate to something like:
- public Set<Class<?>> getClasses(VirtualFile classpathItem, Set<Class<? extends Annotation>> annotationsToLookFor) (from the Hibernate plugin, assuming it looks for annotation on fields, methods and type), or return a Map<Class<? extends Annotation>>, Class<?>>
- public Set<Class<?>> getClasses(List<VirtualFile> classpath, Set<Class<? extends Annotation>> annotationsToLookFor, Set<Class<?>> supertypesToLookFor) (note: in case there are multiple SCIs with HandlesType, this could be less efficient than using a map to pass the annotations/types to look for, and getting a map back; of course, it is simpler too)
The plugin could be based on the Hibernate one, it looks the closest to the requirements.
Thanks,
Rémy
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533736#533736]
Start a new discussion in JBoss Microcontainer Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
Re: [jboss-dev-forums] [JBoss ESB Development] - Problem in retrieving WSDL from remote endpoint
by Vitaliy Lukashev
Vitaliy Lukashev [http://community.jboss.org/people/VitaliyLu] replied to the discussion
"Problem in retrieving WSDL from remote endpoint"
To view the discussion, visit: http://community.jboss.org/message/533645#533645
--------------------------------------------------------------
Hi all !
I want to know have i a right in decision?
in a HttpGatewayServlet class:
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// if it's a wsdl request, serve up the contract then short-circuit
if ("wsdl".equalsIgnoreCase(req.getQueryString())) {
resp.setCharacterEncoding("UTF-8");
Charset charset = Charset.forName("UTF-8"); // add
CharsetEncoder chr = charset.newEncoder(); //add
String mimeType = (contract != null ? contract.getMimeType() : "text/xml");
resp.setContentType(mimeType);
String data = (contract != null ? contract.getData() : "<definitions/>");
ByteBuffer bbuf = chr.encode(CharBuffer.wrap(data)); //add
resp.setContentLength(bbuf.capacity()); // this is problem place i change length buf
Writer writer = new BufferedWriter(resp.getWriter());
writer.write(data);
writer.flush();
return;
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533645#533645]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
[JBoss AOP Development] - Adding org.apache.log4j and org.junit to nonAdvisablePackages
by Flavia Rainone
Flavia Rainone [http://community.jboss.org/people/flavia.rainone%40jboss.com] created the discussion
"Adding org.apache.log4j and org.junit to nonAdvisablePackages"
To view the discussion, visit: http://community.jboss.org/message/533537#533537
--------------------------------------------------------------
I've just discovered that UserDefinedClassLoaderTestCase is failing for ages now and nobody ever noticed because another failure happens when Junit is printing the report.
I've just fixed the initial failure, but I would also like to prevent the second failure to happen (i.e., if there is a failure, we want to to make sure we see that failure reported).
The cause of that second failure is an OutOfMemoryError, result of an endless instrumentation loop JBoss AOP enters because of calls to logger in JoinPointGenerator. Whenever such a call is found, JBoss AOP tries to weave the class. Since there was a problem in the classloader used by the test (fixed now), the class is not found and the same JoinPointGenerator try to log an error again, entering a infinite loop state.
Another problem that I saw is that, when Junit tries to generate the report, it uses org.junit packaged classes to do so, and JBoss AOP enters the loop again.
Despite the particularities of the aforementioned test, that was buggy, I think we should avoid weaving classes from those packages. Doing otherwise can:
- cause several deadlock problems because AOP startes the weaving process from inside the weaving process, in the case of org.apache.log4j (as seen before with other classes)
- cause problems when somebody is running a test that involves JBoss AOP with Junit, in the case of org.junit.
Can I add those packages to the isNonAdvisableClassName methods?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533537#533537]
Start a new discussion in JBoss AOP Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
Re: [jboss-dev-forums] [EJB 3.0 Development] - Fixing the EJB3 testsuite...
by Carlo de Wolf
Carlo de Wolf [http://community.jboss.org/people/wolfc] replied to the discussion
"Fixing the EJB3 testsuite..."
To view the discussion, visit: http://community.jboss.org/message/533441#533441
--------------------------------------------------------------
I've applied the patch with a minor modification. http://fisheye.jboss.org/changelog/JBossAS/?cs=102770 Rev 102770 can serve as a template to fix the other tests.
Commits should go under: http://https://jira.jboss.org/jira/browse/EJBTHREE-2057 EJBTHREE-2057
Note that I get:
javax.jms.JMSException: Failed to initialise session factory
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1043)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:790)
at org.hornetq.jms.client.HornetQConnection.authorize(HornetQConnection.java:572)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:602)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:116)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:111)
at org.jboss.ejb3.mdb.ProducerManagerImpl.connect(ProducerManagerImpl.java:221)
at org.jboss.ejb3.test.interceptors2.unit.InterceptorsTestCase.testMixedConsumer(InterceptorsTestCase.java:610)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
at junit.extensions.TestSetup.run(TestSetup.java:27)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
at junit.extensions.TestSetup.run(TestSetup.java:27)
Caused by: HornetQException[errorCode=0 message=Failed to initialise session factory]
Caused by: java.lang.IllegalArgumentException: Error instantiating connector factory "org.hornetq.integration.transports.netty.NettyConnectorFactory"
at org.hornetq.core.client.impl.FailoverManagerImpl.instantiateConnectorFactory(FailoverManagerImpl.java:1016)
at org.hornetq.core.client.impl.FailoverManagerImpl.<init>(FailoverManagerImpl.java:228)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.initialise(ClientSessionFactoryImpl.java:237)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1039)
Caused by: java.lang.ClassNotFoundException: org.hornetq.integration.transports.netty.NettyConnectorFactory
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:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at org.hornetq.core.client.impl.FailoverManagerImpl.instantiateConnectorFactory(FailoverManagerImpl.java:1011)
I guess the client side classes of HornetQ are not yet available in $JBOSS_HOME/client (and jbossall-client.jar Class-Path).
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533441#533441]
Start a new discussion in EJB 3.0 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years