[EJB 3.0] - Re: Simple injection of SessionContext not working
by jaikiran
Downloaded the source code of JBoss-4.0.4 GCA and after debugging found that the culprit was the following statement in ResourceHandler.java of JBoss:
Line number: 283
if (!ref.type().equals(Object.class))
ref.type() returns null and the subsequent call to equals method throws a NullpointerException.
Surprisingly, this is a very simple injection and i have seen this type of injection being used in the EJB3 Trail.
I even tried moving the annotation to method level:
@Resource
| public void setSessionContext(SessionContext sessionCtx) {
| System.out.println("Setting the session context: " + sessionCtx);
| this.sessionContext = sessionCtx;
| }
Even in this case i get the NullPointerException. This time at:
anonymous wrote : java.lang.NullPointerException
| at org.jboss.ejb3.injection.ResourceHandler.loadMethodInjectors(ResourceHandler.java:183)
The reason is the same as mentioned above, this time in the loadMethodInjectors method.
Am i doing something wrong? Cant believe that this simple injection fails.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960634#3960634
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960634
19 years, 9 months
[JBossCache] - Problem Running JBoss Cache within JBoss Application Server
by emailmsgbox
So, I'm using JBoss 4.0.4 with JBoss cache 1.4 on JVM 1.5
I using the Address class from the tutorial.
|
| PojoCacheMBean myCache;
| ....
| Address address = new adddress()
| myCache.putObject("123",address );
|
|
and the error is .....
anonymous wrote :
| ...
| jboss.cache.TreeCache] putObject(): exception occurred: java.lang.IllegalArgumentException: PojoCache.putObject(): Object type is neither aspectized nor Serializable nor an array of primitives. Object class name is com.test.data.Address
|
it looks like that the 1.5 annotation are ignored
if I remove the annotation @org.jboss.cache.aop.annotation.PojoCacheable
the error is the same ?!
the cache 1.4 upgreade : I replaced jboss-cache.jar with jboss-cache-jdk50.jar
and jboss-aop-jdk50.jar
As I understand jboss-aop.xml is not needed
Please , Any ideas ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960628#3960628
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960628
19 years, 9 months