[JBossCache] - Re: Debuging with JBossCache (from IntelliJ)
by gmeroz
i tried to run \JBossCache-all-2.0.0.ALPHA1\examples\PojoCache\annotated50 using the same configuration and got the following error:
-------------------------------------------------------
GMS: address is 192.168.10.222:4578
-------------------------------------------------------
-------------------------------------------------------
GMS: address is 192.168.10.222:4582
-------------------------------------------------------
org.jboss.cache.ReplicationException: java.lang.Exception: Don't know how to marshall object of type class examples.Student
at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:2110)
at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:2045)
at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:2177)
at org.jboss.cache.RPCManager.callRemoteMethods(RPCManager.java:65)
at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:84)
at org.jboss.cache.interceptors.BaseRpcInterceptor.replicateCall(BaseRpcInterceptor.java:62)
at org.jboss.cache.interceptors.ReplicationInterceptor.handleReplicatedMethod(ReplicationInterceptor.java:114)
at org.jboss.cache.interceptors.ReplicationInterceptor.invoke(ReplicationInterceptor.java:86)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:290)
at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:128)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:151)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
at org.jboss.cache.interceptors.InvocationContextInterceptor.invoke(InvocationContextInterceptor.java:61)
at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:3803)
at org.jboss.cache.TreeCache.put(TreeCache.java:1556)
at org.jboss.cache.TreeCacheProxyImpl.put(TreeCacheProxyImpl.java:226)
at org.jboss.cache.pojo.impl.InternalHelper.put(InternalHelper.java:162)
at org.jboss.cache.pojo.impl.SerializableObjectHandler.putIntoCache(SerializableObjectHandler.java:76)
at org.jboss.cache.pojo.impl.SerializableObjectHandler.put(SerializableObjectHandler.java:60)
at org.jboss.cache.pojo.impl.PojoCacheDelegate.putObjectII(PojoCacheDelegate.java:179)
at org.jboss.cache.pojo.impl.PojoCacheImpl.putObject(PojoCacheImpl.java:139)
at org.jboss.cache.pojo.impl.PojoCacheImpl.org$jboss$cache$pojo$impl$PojoCacheImpl$attach$aop(PojoCacheImpl.java:117)
at org.jboss.cache.pojo.impl.PojoCacheImpl$PojoCacheImplAdvisor.attach3085019539260813833(PojoCacheImpl$PojoCacheImplAdvisor.java)
at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java)
at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:109)
at test.examples.StudentMaintTest.testPropagation(StudentMaintTest.java:98)
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 junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:69)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.lang.Exception: Don't know how to marshall object of type class examples.Student
at org.jboss.cache.marshall.TreeCacheMarshaller200.marshallObject(TreeCacheMarshaller200.java:253)
at org.jboss.cache.marshall.TreeCacheMarshaller200.marshallMap(TreeCacheMarshaller200.java:328)
at org.jboss.cache.marshall.TreeCacheMarshaller200.marshallObject(TreeCacheMarshaller200.java:238)
at org.jboss.cache.marshall.TreeCacheMarshaller200.marshallMethodCall(TreeCacheMarshaller200.java:279)
at org.jboss.cache.marshall.TreeCacheMarshaller200.marshallObject(TreeCacheMarshaller200.java:182)
at org.jboss.cache.marshall.TreeCacheMarshaller200.marshallMethodCall(TreeCacheMarshaller200.java:279)
at org.jboss.cache.marshall.TreeCacheMarshaller200.marshallObject(TreeCacheMarshaller200.java:182)
at org.jboss.cache.marshall.TreeCacheMarshaller200.objectToStream(TreeCacheMarshaller200.java:82)
at org.jboss.cache.marshall.VersionAwareMarshaller.objectToByteBuffer(VersionAwareMarshaller.java:121)
at org.jgroups.blocks.RpcDispatcher.callRemoteMethod(RpcDispatcher.java:205)
at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:2104)
... 50 more
org.jboss.cache.pojo.PojoCacheException: PojoTreeCache: org.jboss.cache.ReplicationException: java.lang.Exception: Don't know how to marshall object of type class examples.Student
at org.jboss.cache.pojo.impl.PojoCacheImpl.org$jboss$cache$pojo$impl$PojoCacheImpl$attach$aop(PojoCacheImpl.java:122)
at org.jboss.cache.pojo.impl.PojoCacheImpl$PojoCacheImplAdvisor.attach3085019539260813833(PojoCacheImpl$PojoCacheImplAdvisor.java)
at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java)
at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:109)
at test.examples.StudentMaintTest.testPropagation(StudentMaintTest.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Process finished with exit code -1
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997038#3997038
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997038
18 years
[EJB 3.0] - Customizing the persistence of an embedded object
by SmokingAPipe
Simple question: I have a class that uses an embedded object that's not an entity, like this:
| @Entity
| public class LogMessage {
| private java.util.logging.Level level;
| }
|
Right now, the way that handles it is it creates a bytea column to store the level. Of course that's not what I want. What would be ideal would be to somehow annotate it so I could define my own persistence for that particular field. In this case, I would want to persist it as either an integer or a string perhaps. I know in Hibernate it wasn't a big deal to write my own custom type with its own storage approach but I can't find anything like that in EJB3. Any ideas?
Of course the other thing i can do is to just write up my own enum and not even use the java.util.logging.Level class, but hey, that class is there and does exactly what I want so it would be ideal to use it.
Thanks for any ideas on this
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997031#3997031
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997031
18 years
[EJB 3.0] - ClassCastException EJB3 wrapped local object.
by hurzeler
Hello there,
I have the following issue. I have a Stateless session bean called SiteDAOBean. This bean has a method:
| public void update(Site site) throws PersistenceException
| {
| em.merge(site);
| }
|
Which works nicely if I call it remotely with a Site argument. However due to some extra functionallity that I need locally I have to wrap the Site class by extending it to SelectableSite. It then has a couple more methods that are only used locally and a field that is transient but it is still fundamentally a Site class.
Calling:
| SiteDAO siteDAO = (SiteDAO) context.lookup(SiteDAOBean.class
| .getSimpleName()
| + "/remote");
| siteDAO.update(site);
|
I get the following exception:
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: mhl.edm.util.SelectableSite (no security manager: RMI class loader disabled)
| at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371)
| at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
| at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
| at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
| at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
| at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
| at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
| at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
| at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
| at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
| at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
| at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:267)
| ... 102 more
Obviously I need to cast the SelectableSite back to Site so that RMI does not complain not finding the class remotely.
I tried:
siteDAO.update((Site)site);
but that does not work. Can anyone tell me how to overcome this issue short from creating a new Site object?
Thanks for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997022#3997022
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997022
18 years