[EJB/JBoss] - Exception when running with JDK 1.6 Mustang
by gommo
I'm running JBoss 4.0.4GA1 using EJB3.
I've been running this successfully with my client software using jdk1.5.0
I've tried to get it to work with 1.6 but I keep getting an exception thrown by the client when attempting to retreive a collection from a session bean.
JBoss boots up fine and throws no errors; The exception is a classnotfoundexception on org.jboss.aop.adivce.Interceptor.
All the required jars (including jboss-aop-jdk50-client.jar) are in the classpath (Nothing has changed exception compiling with jdk1.6 and running with 1.6)
These exception is
Got marshalling exception, exiting
java.lang.ClassNotFoundException: [Lorg.jboss.aop.advice.Interceptor;
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:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1624)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
at org.jboss.remoting.Client.invoke(Client.java:525)
at org.jboss.remoting.Client.invoke(Client.java:488)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:48)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61)
at $Proxy1.createProxy(Unknown Source)
at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.tributech.tuxedo.client.core.session.LocalSession$1.run(LocalSession.java:53)
at com.tributech.tuxedo.client.core.session.SessionMethod.run(SessionMethod.java:42)
at com.tributech.tuxedo.client.core.session.LocalSession.run(LocalSession.java:85)
at java.lang.Thread.run(Thread.java:619)
Error loading classes from remote call result.
java.lang.ClassNotFoundException: [Lorg.jboss.aop.advice.Interceptor;
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:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1624)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
at org.jboss.remoting.Client.invoke(Client.java:525)
at org.jboss.remoting.Client.invoke(Client.java:488)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:48)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61)
at $Proxy1.createProxy(Unknown Source)
at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.tributech.tuxedo.client.core.session.LocalSession$1.run(LocalSession.java:53)
at com.tributech.tuxedo.client.core.session.SessionMethod.run(SessionMethod.java:42)
at com.tributech.tuxedo.client.core.session.LocalSession.run(LocalSession.java:85)
at java.lang.Thread.run(Thread.java:619)
Thanks for any help you can provide
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969445#3969445
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969445
19 years, 7 months
[JBoss AOP] - Re: change text with interceptors
by stalep
hi, im not certain i understood you question, but ill try to clarify a bit.
first off your jboss-aop.xml is completly valid and will work, but its a bit "wierd". for readability i would recommend:
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
| <aop>
| <interceptor name="TextformatInterceptor" class="segn.util.interceptor.TextFormatInterceptor" scope="PER_CLASS"/>
| <bind pointcut="call(public void $instanceof{segn.util.model*}->set*(java.lang.String))">
| <interceptor-ref name="TextFormatInterceptor"/>
| </bind>
| </aop>
|
with your version you would have gotten an error if you tried to use the same interceptor on several pointcuts (multiple definitions but possibly different scope).
for the second question i would recommend to take a look at the examples given in the jboss-aop dist. but to the point, if an invocations is of type "methodinvocation" you can just try to cast it to that type. eg:
| public class TextFormatInterceptor implements Interceptor {
| public String getName() { return "TextFormatInterceptor"; }
|
| public Object invoke(Invocation invocation)
| throws Throwable
| {
| if(invocation instanceof MethodInvocation)
| try
| {
| MethodInvocation mi = (MethodInvocation) invocation;
| Object rsp = mi.invokeNext();
| if (rsp instanceof java.lang.String)
| {
| //do whatever you want
| //eg: return new String("foo");
| }
| else
| return rsp;
|
| }
| catch(Exception e) {}
| }
| }
|
i havent compiled this code, its just to give you an idea, and with the MethodInvocation object you have other methods you can get data from than just Invocation. look at the examples for more info. if i was way off, try to explain you problem again and ill do my best to help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969442#3969442
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969442
19 years, 7 months
[JBoss jBPM] - Re: Confused about variable and token association
by mteira
Hello again.
I think that I've found the problem. It's how the variable is initialized in the ActioHandler:
if (!ci.hasVariable(varName, executionContext.getToken())) {
| ci.setVariable(varName, new Integer(0), executionContext.getToken());
| }
ContextInstance.setVariable(String name, Object value, Token token) resolves the TokenVariableMap using getOrCreateTokenVariableMap, that delegates on the parent Token when the var doesn't exist on the current token:
// if the given token has a variable map
| TokenVariableMap tokenVariableMap = null;
| if ( (tokenVariableMaps!=null)
| && (tokenVariableMaps.containsKey(token))
| ) {
| tokenVariableMap = (TokenVariableMap) tokenVariableMaps.get(token);
|
| } else if (!token.isRoot()) {
| tokenVariableMap = getOrCreateTokenVariableMap(token.getParent());
|
| } else {
| tokenVariableMap = createTokenVariableMap(token);
| }
|
So, the only way to force a variable to be created in the current Token is to use the function:
public void createVariable(String name, Object value, Token token)
that uses createTokenVariableMap(Token token) to do the work.
So, using ContextInstance.setVariable(String name, Object value, Token token) is always delegating into the parent context when the variable name doesn't exist in the current Token tokenVariableMap.
I find this a little confusing. Is it the expected behaviour?
Regards.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969439#3969439
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969439
19 years, 7 months