[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: bricardq  XML
Profile for bricardq -> Messages posted by bricardq [19] Go to Page: 1, 2 Next 
Author Message
Ok. My final goal is to achieve failover between two application servers..
So, I have to replicate stateful beans on these servers. And if a server crashes, the client's request has to be automatically redirected on other one. Problem is the following:
Replication is active and failover works. But I can have only one instance of mystateful bean on the cluster. So, if another client tries to get the stateful bean, he will get the stateful with same state that the last client. In pratical terms, with a shopping cart case, there is only one cart at same time. Then, if multiple clients connect to servers, they will share the same cart..
As I said, an Id is assigned at the time of lookup. My requirements would be to replicate the couple bean/Id, to have as many instances of objects as different ids.
I can't use HTTPSessions clustering because I already have a mechanism for failover.
Do you think implementing my use case is feasible?

Thanks for any help!
Thanks for quick reply

I understand your idea, but it doesn't match my requirements.. Terracotta would help only to replicate the map in cluster. The advantage of Terracotta would be minor.
I would want that replication be in way the more transparent as possible.. and in this case, I could use serialization instead.
If you another ideas, don't hesitate to tell me which ones.
So, Terracotta does'nt aims to replicate more than one instance of a shared root?

Thanks you again
Hello everyone

I want to know if it is possible to share objects in a special way:
My object has an Id which identify it in a unique way.
So I want to share only objects that own the same Id.
More precisely, I get the object by a lookup that assign an id to this object.
Then, I want to access to my object on different servers.
So, there would be as many instances of objects as different ids.
The principle looks like to sessions clustering. Each client can access to his session on different servers. But if a new client connects, he gets a new object.
I know I am not very precise..

Thanks
Hello vasu!
I have same error as you:
Code:
java.lang.AssertionError: replaced mapping for

I know your topic has been posted 1 year ago but if you go back here, could you tell me what piece of code lead to this error and what did you do to correct it?
If anybody else can help me to understand what's happening, I would appreciate it!

Thanks!
Actually, I am using Tomcat6 andTerracotta instruments classloader of Tomcat5.5.
Tomcat6 is an embedded version. I had to add import of Terracotta packages and org.apache.tomcat.util.compat package (because of 'NoClassDefFound' and 'Unresolved package in bundle' errors.
But Tomcat6 does not have compat package. I guess this is the cause of my troubles..
Finally, there is no way to deactive this instrumentation?
Does anybody know an solution to get round problem?
Thanks
Hey!
It's me again. Is anybody who would be able to tell me when classes are analyzed by Terracotta?
Are they analyzed in defineClass method from customized java.lang.ClassLoader?
If yes, can't they analyzed again if I redefine classes with ASM?
If anybody could help me even a little, I would be very grateful to him.
Thx
Hello!
I want to use Terracotta to cluster application with EJBs and using Tomcat.
More precisely, I want to use Tomcat only to transmit requests from browser to EJB, and I don't want to cluster HTTP sessions.
Problem is dso-boot jar instruments Tomcat classloaders. Is there a solution to deactive this instrumentation?
Thanks
Hello
I am trying to add annotations with a java agent and ASM. My agent add annotations in a premain method. Problem is that Terracotta doesn't see added annotations. So, I guess Terracotta analyse classes before my premain method be called..
I wonder if this method was possible, and if not : why?
I thought to add a "marker" interface as written in this topic but I don't know if it's the same mechanism, nor how I declare it in tc-config.xml.

Thanks
Hi

Would anyone be able to tell me in which class(es) Terracotta methods are added with ASM.
I looked at that Terracotta adds methods starting with '__tc_'. I ask this to debug mechanism of bytecode instrumentation.
Actually, both Terracotta and Easybeans use ASM.

My problem is very strange: I have still the same exception because of this code which is in a Stateful bean:
Code:
 @PostConstruct
 public void postConstruct() {
 	map = new HashMap<Product, Integer>();
 }
 

Now, if I remplace this piece of code by:
Code:
 @PostConstruct
 public void postConstruct() {
 	init();
 }
 public void init() {
 	map = new HashMap<Product, Integer>();
 }
 

... No problem !!(?)
I really don't understand what's happening.
Any ideas?
Thx in advance
Hi

EasyBeans classloader already has a map with bytecode corresponding to classes names.
I debugged Terracotta code a little and I found this:
Method getManager () returns NULL_MANAGER in ManagerUtil.java file because boolean enabled is false. However, I noticed that defineClass0Pre(...) in ClassProcessorHelper.java was called and especially ManagerUtil.enable(); was executed.
This method is well called for my instrumented classes with the right classloader. So, I don't understand why enabled is false when getManager() is called. I add that classloader is the same when getManager() is called as when defineClass0Pre(...) is called.

NEWS: I tried to remove method with PostContruct annotation and it worked! Problem is not resolved but it seems really come from PostConstruct. I hope this can help anyone to understand what's happening

I am really locked. So I appreciate any help!
Thanks in advance.
Easybeans is an EJB3 container from ow2 consortium.
I had some 'not instrumented class' exceptions for these handlers. That 's why I added them in my config.
I am now using your annotations but I have still this error:
Code:
 [[WARN] could not read class [org/ow2/easybeans/gen/invocationcontext/beans/CustomerBean/EasyBeansInvocationContextImploriginal$EasyBeans$injectedByEasyBeansDEPINJECT39797] as byte array
  [WARN] could not read class [org/ow2/easybeans/gen/invocationcontext/beans/CustomerBean/EasyBeansInvocationContextImplbeanPostConstruct$generatedPOSTCONSTRUCT39797] as byte array
  [WARN] could not read class [org/ow2/easybeans/gen/invocationcontext/beans/CustomerBean/EasyBeansInvocationContextImplpostConstructAROUNDINVOKE39797] as byte array
  2008-07-16 12:42:50,344 : AbsTransactionInterceptor.handleContextContainerTransaction : Exception (not application exception) in business method
  java.lang.UnsupportedOperationException
          at com.tc.object.bytecode.NullManager.lookupOrCreateRoot(NullManager.java:57)
          at com.tc.object.bytecode.ManagerUtil.lookupOrCreateRoot(ManagerUtil.java:134)
          at beans.CustomerBean.__tc_setmap(CustomerBean.java)
          at beans.CustomerBean.original$EasyBeans$postConstruct(CustomerBean.java:118)
          at org.ow2.easybeans.gen.invocationcontext.beans.CustomerBean.EasyBeansInvocationContextImplpostConstructAROUNDINVOKE39797.proceed(Unknown Source)
          at org.ow2.easybeans.transaction.interceptors.CMTRequiredTransactionInterceptor.intercept(CMTRequiredTransactionInterceptor.java:110)
          at org.ow2.easybeans.gen.invocationcontext.beans.CustomerBean.EasyBeansInvocationContextImplpostConstructAROUNDINVOKE39797.proceed(Unknown Source)
          at org.ow2.jonas.ejb.easybeans.JOnASENCInterceptor.intercept(JOnASENCInterceptor.java:67)
          at org.ow2.easybeans.gen.invocationcontext.beans.CustomerBean.EasyBeansInvocationContextImplpostConstructAROUNDINVOKE39797.proceed(Unknown Source)
          at beans.CustomerBean.postConstruct(CustomerBean.java)
          at beans.CustomerBean.beanPostConstruct$generated(CustomerBean.java)
          at org.ow2.easybeans.gen.invocationcontext.beans.CustomerBean.EasyBeansInvocationContextImplbeanPostConstruct$generatedPOSTCONSTRUCT39797.proceed(Unknown Source)
          at org.ow2.jonas.ejb.easybeans.JOnASENCInterceptor.intercept(JOnASENCInterceptor.java:67)
          at org.ow2.easybeans.gen.invocationcontext.beans.CustomerBean.EasyBeansInvocationContextImplbeanPostConstruct$generatedPOSTCONSTRUCT39797.proceed(Unknown Source)
          at beans.CustomerBean.postConstructEasyBeansLifeCycle(CustomerBean.java)
          at org.ow2.easybeans.container.session.SessionFactory.create(SessionFactory.java:151)
          at org.ow2.easybeans.container.session.stateful.StatefulSessionFactory.create(StatefulSessionFactory.java:129)
          at org.ow2.easybeans.container.session.stateful.StatefulSessionFactory.create(StatefulSessionFactory.java:54)
          at org.ow2.util.pool.impl.JPool.get(JPool.java:256)
          at org.ow2.easybeans.container.session.stateful.StatefulSessionFactory.getBean(StatefulSessionFactory.java:144)
          at org.ow2.easybeans.container.session.stateful.StatefulSessionFactory.localCall(StatefulSessionFactory.java:180)
          at org.ow2.easybeans.container.session.SessionFactory.rpcInvoke(SessionFactory.java:181)
          at org.ow2.easybeans.rpc.rmi.server.RMIServerRPCImpl.getEJBResponse(RMIServerRPCImpl.java:106)
          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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
          at org.ow2.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:161)
          at sun.rmi.transport.Transport$1.run(Transport.java:153)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
          at java.lang.Thread.run(Thread.java:595)
  
 

I guess that problem comes from the fact EJB container generate classes (byte array) on the fly (in the case of @PostConstruct annotations or else). Next, container don't keep classes once they are loaded in classloader. But Terracotta seems to want access to these byte array..
If anyone has any idea, I am interested!

thanks
Hello everybody
I am trying to deploy clustered application using annotations for configuration and Easybeans EJB container.
I obtain these exceptions when I deploy my application:
Code:
 AW::WARNING - could not load class [org/ow2/util/scan/api/configurator/metadata/ClassMetadataConfigurator] as a resource in loader [30.0]
 AW::WARNING - could not load class [org/ow2/util/scan/api/configurator/IClassConfigurator] as a resource in loader [27.0]
 AW::WARNING - could not load class [org/ow2/util/scan/api/configurator/BasicConfigurator] as a resource in loader [27.0]
 AW::WARNING - could not load class [org/ow2/util/scan/api/metadata/IClassMetadata] as a resource in loader [29.0]
 AW::WARNING - could not load class [org/ow2/util/scan/api/configurator/metadata/FieldMetadataConfigurator] as a resource in loader [30.0]
 AW::WARNING - could not load class [org/ow2/util/scan/api/configurator/IFieldConfigurator] as a resource in loader [27.0]
 AW::WARNING - could not load class [org/ow2/util/scan/api/metadata/IFieldMetadata] as a resource in loader [29.0]
 AW::WARNING - could not load class [org/ow2/util/scan/api/configurator/metadata/MethodMetadataConfigurator] as a resource in loader [30.0]
 AW::WARNING - could not load class [org/ow2/util/scan/api/configurator/IMethodConfigurator] as a resource in loader [27.0]
 AW::WARNING - could not load class [org/ow2/util/scan/api/metadata/IMethodMetadata] as a resource in loader [29.0]
 AW::WARNING - could not load class [beans/CustomerBeanInterceptorManager] as a resource in loader [org.ow2.easybeans.loader.EasyBeansClassLoader[urls=file:/home/bricardq/cluster/noeud1/deploy/terracotta.jar]]
 [WARN] could not read class [beans/CustomerBeanInterceptorManager] as byte array
 


Then, I have this error at execution, in client side:
Code:
 AW::WARNING - could not load class [org/apache/log4j/Logger] as a resource in loader [sun.misc.Launcher$AppClassLoader@b162d5]
 AW::WARNING - could not load class [org/apache/log4j/Priority] as a resource in loader [sun.misc.Launcher$AppClassLoader@b162d5]
 Cannot get CustomerBean : javax.naming.NamingException: Cannot unwrap object 'UnicastJNDIReferenceWrapper_Stub[UnicastRef [liveRef: [endpoint:[129.183.128.75:41887](remote),objID:[6328cb54:11b2773a075:-8000, 6]]]]' with name 'beans.CustomerBean_beans.CustomerRemote@Remote' :Error while sending a request [Root exception is javax.ejb.EJBException: Error while sending a request]
 

And finally, I have these errors in server side at execution:
Code:
 [[WARN] could not read class [org/ow2/easybeans/gen/invocationcontext/beans/CustomerBean/EasyBeansInvocationContextImploriginal$EasyBeans$injectedByEasyBeansDEPINJECT39797] as byte array
 [WARN] could not read class [org/ow2/easybeans/gen/invocationcontext/beans/CustomerBean/EasyBeansInvocationContextImplbeanPostConstruct$generatedPOSTCONSTRUCT39797] as byte array
 [WARN] could not read class [org/ow2/easybeans/gen/invocationcontext/beans/CustomerBean/EasyBeansInvocationContextImplpostConstructAROUNDINVOKE39797] as byte array
 2008-07-16 12:42:50,344 : AbsTransactionInterceptor.handleContextContainerTransaction : Exception (not application exception) in business method
 java.lang.UnsupportedOperationException
         at com.tc.object.bytecode.NullManager.lookupOrCreateRoot(NullManager.java:57)
         at com.tc.object.bytecode.ManagerUtil.lookupOrCreateRoot(ManagerUtil.java:134)
         at beans.CustomerBean.__tc_setmap(CustomerBean.java)
         at beans.CustomerBean.original$EasyBeans$postConstruct(CustomerBean.java:118)
         at org.ow2.easybeans.gen.invocationcontext.beans.CustomerBean.EasyBeansInvocationContextImplpostConstructAROUNDINVOKE39797.proceed(Unknown Source)
         at org.ow2.easybeans.transaction.interceptors.CMTRequiredTransactionInterceptor.intercept(CMTRequiredTransactionInterceptor.java:110)
         at org.ow2.easybeans.gen.invocationcontext.beans.CustomerBean.EasyBeansInvocationContextImplpostConstructAROUNDINVOKE39797.proceed(Unknown Source)
         at org.ow2.jonas.ejb.easybeans.JOnASENCInterceptor.intercept(JOnASENCInterceptor.java:67)
         at org.ow2.easybeans.gen.invocationcontext.beans.CustomerBean.EasyBeansInvocationContextImplpostConstructAROUNDINVOKE39797.proceed(Unknown Source)
         at beans.CustomerBean.postConstruct(CustomerBean.java)
         at beans.CustomerBean.beanPostConstruct$generated(CustomerBean.java)
         at org.ow2.easybeans.gen.invocationcontext.beans.CustomerBean.EasyBeansInvocationContextImplbeanPostConstruct$generatedPOSTCONSTRUCT39797.proceed(Unknown Source)
         at org.ow2.jonas.ejb.easybeans.JOnASENCInterceptor.intercept(JOnASENCInterceptor.java:67)
         at org.ow2.easybeans.gen.invocationcontext.beans.CustomerBean.EasyBeansInvocationContextImplbeanPostConstruct$generatedPOSTCONSTRUCT39797.proceed(Unknown Source)
         at beans.CustomerBean.postConstructEasyBeansLifeCycle(CustomerBean.java)
         at org.ow2.easybeans.container.session.SessionFactory.create(SessionFactory.java:151)
         at org.ow2.easybeans.container.session.stateful.StatefulSessionFactory.create(StatefulSessionFactory.java:129)
         at org.ow2.easybeans.container.session.stateful.StatefulSessionFactory.create(StatefulSessionFactory.java:54)
         at org.ow2.util.pool.impl.JPool.get(JPool.java:256)
         at org.ow2.easybeans.container.session.stateful.StatefulSessionFactory.getBean(StatefulSessionFactory.java:144)
         at org.ow2.easybeans.container.session.stateful.StatefulSessionFactory.localCall(StatefulSessionFactory.java:180)
         at org.ow2.easybeans.container.session.SessionFactory.rpcInvoke(SessionFactory.java:181)
         at org.ow2.easybeans.rpc.rmi.server.RMIServerRPCImpl.getEJBResponse(RMIServerRPCImpl.java:106)
         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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
         at org.ow2.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:161)
         at sun.rmi.transport.Transport$1.run(Transport.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
         at java.lang.Thread.run(Thread.java:595)
 

I suppose that easyBeans wants to explore class bytecode whereas it is not available anymore.Could you help me?
Thanks in advance.
Here is my tc-config.xml (I test with only Root home-made annotation)
Thanks for quick reply. I didn't realize that instrumentation was done dynamically

Hi everybody
I want to know if it is possible to dynamically add clustered objects/applications with an application server using Terracotta. The constraint is to not restart application server and Terracotta server detects there is new object(s).
One of application server advantages is to dynamically deploy applications when server is running.
Problem is to change configuration file of Terracotta server.
If you have any idea, can you tell me what to do..
Thanks
jvoegele wrote:

It seems like one of the Apache Commons JARs is not correct
 

You seem to be right!
I changed my ant version to 1.7.0 and it works now.
It could help users with same troubles.
I had some messages:
Code:
 /home/bricardq/Terracotta/terracotta/code/base/./buildscripts/jvms.rb:278:in `raise_exception': You must specify a valid JavaSE-1.6 JRE using one of the following environment variables or conmmand-line arguments: JAVASE_16, JAVASE_6, JAVA_HOME_16 (InvalidJVM)
 

I had these error for each version of JAVA 1.4, 1.5 et 1.6. I don't think it is normal.. I'm lucky to have 3 versions of JAVA.
Thanks jvoegele
 
Profile for bricardq -> Messages posted by bricardq [19] Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7 © JForum Team