[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
issue with serialization of objects II  XML
Forum Index -> Ehcache
Author Message
alex123

neo

Joined: 05/03/2011 02:28:39
Messages: 4
Offline

Hi,
I am trying to run a simple JSF application with Terracotta Distributed Ehcache Custom Installation and Tomcat 5.5 because I cannot use serialization. There is only one bean class.

I execute this steps to run this application:

1- I launch terracotta server with start-tc-server.bat
(there is a previously configured file tc-config.xml in my TC_HOME\bin)
2- launch the script startTC.bat (in TC_HOME)
3- launch the run.bat script from Apache Tomcat to start this server.


I have an ehcache.xml in my WEB-INF\classes

I have attached these files: ehcache.xml, tc-config.xml and startTC.bat
I am not sure this configuration is corrected. Please I need some help

The application is launched correctly but when I try to access this (http://localhost:8080/myfaces-test/index.jsf) y only get this error:



GRAVE: Error Rendering View[/index.xhtml]
javax.el.ELException: /index.xhtml: java.io.NotSerializableException: SomeBackingBean
at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:50)
at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.terracotta.modules.tomcat.tomcat_5_5.SessionValve55.tcInvoke(SessionValve55.java:99)
at org.terracotta.modules.tomcat.tomcat_5_5.SessionValve55.invoke(SessionValve55.java:85)
at org.terracotta.session.ModernTomcatSessionValve.invoke(ModernTomcatSessionValve.java:66)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:843)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:679)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1293)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: java.io.NotSerializableException: SomeBackingBean
at com.terracotta.session.SerializedAttributeStore$SerializedAttribute.<init>(SerializedAttributeStore.java:98)
at com.terracotta.session.SerializedAttributeStore$SerializedAttributeWithCache.<init>(SerializedAttributeStore.java:141)
at com.terracotta.session.SerializedAttributeStore.put(SerializedAttributeStore.java:60)
at com.terracotta.session.SessionData.bindAttribute(SessionData.java:455)
at com.terracotta.session.SessionData.setAttributeReturnOld(SessionData.java:322)
at com.terracotta.session.SessionData.setAttribute(SessionData.java:313)
at org.apache.myfaces.context.servlet.SessionMap.setAttribute(SessionMap.java:53)
at org.apache.myfaces.context.servlet.AbstractAttributeMap.put(AbstractAttributeMap.java:108)
at org.apache.myfaces.el.VariableResolverImpl$13.put(VariableResolverImpl.java:195)
at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:331)
at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
at com.sun.el.parser.AstValue.getValue(AstValue.java:85)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183)
at com.sun.facelets.el.ELText$ELTextVariable.writeText(ELText.java:184)
at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:45)
... 23 more


Best regards,
Alex
 Filename tc-config.xml [Disk] Download
 Description
 Filesize 1 Kbytes
 Downloaded:  103 time(s)

 Filename ehcache.xml [Disk] Download
 Description
 Filesize 791 bytes
 Downloaded:  106 time(s)

 Filename startupTC.bat [Disk] Download
 Description
 Filesize 544 bytes
 Downloaded:  112 time(s)

ari

seraphim

Joined: 05/24/2006 14:23:21
Messages: 1665
Location: San Francisco, CA
Offline

need to see your tomcat config files where you registered the valve.

BTW, what did you expect Ehcache "foo" to do in this use case? Is it a POJO cache you haven't started working with yet?

--Ari
[WWW]
alex123

neo

Joined: 05/03/2011 02:28:39
Messages: 4
Offline

Hi Ari,

I send the tomcat configuration file "context.xml" placed in my TOMCAT_HOME\conf folder

I don't understand "Ehcache foo" ¿¿?
is it necessary to add code to my application to use the cache configured in the ehcache.xml file?
Because in the documentation appears:
"In your application, the distributed cache is set up by creating the CacheManager, which references the Ehcache configuration file. There are a number of ways to have your application locate the Ehcache configuration file, some of which have been noted above."

Thanks and regards,
Alex
 Filename context.xml [Disk] Download
 Description
 Filesize 1 Kbytes
 Downloaded:  101 time(s)

ari

seraphim

Joined: 05/24/2006 14:23:21
Messages: 1665
Location: San Francisco, CA
Offline

Yeah,

You are completely confused at this point. You are clustering a Spring Webflow app. That means you need SESSION REPLICATION, not Ehcache.

Your Ehcache, ehcache.xml and valueMode=identity settings for cache name "foo" are all correct yet useless. Ehcache is not being used here.

Look at your stack trace. it is invoking Terracotta through our sessions product. I can't even tell from our docs nor do I remember but I don't think you should set that valve and have our stuff in your classpath. You are getting serialization-based Terracotta sessions.

Anyways, start over, reading ONLY chapter 9 of terracotta.org documentation. You seem to be mixing ehcache.org with terracotta.org and express with custom / DSO install.

--Ari
[WWW]
ari

seraphim

Joined: 05/24/2006 14:23:21
Messages: 1665
Location: San Francisco, CA
Offline

From the reference guide on old-style DSO sessions replication I don't see any reference to editing tomcat servlet configs. I think the Tomcat TIM does it for you.

http://www.terracotta.org/confluence/display/docs/Configuration+Guide+and+Reference#ConfigurationGuideandReference-webapplications

You sure you need DSO? Once you get things to start properly instead of having half of one setup and half the other, you will have to go through a cycle of configuration where you get UnlockedSharedObjectException and UninstrumentedAccessException (or something like that) from our system. Each time you get an exception, you will have to stop the app, add some config to tc-config.xml and try again. The cycle could take days.

Just setting your expectations. Here's a VERY OLD sessions tutorial for Spring JPetStore app: http://www.terracotta.org/confluence/display/docs/Sessions+Tutorial

You can try that...not sure but I think the Sessions Configurator is gone. Anyways, try it without the configurator to learn how it works. If you get that to work, you are ready to take on your own app ;)

--Ari
[WWW]
alex123

neo

Joined: 05/03/2011 02:28:39
Messages: 4
Offline

Hi again,

yes I think I am completely confused ;)
I have read a lot of documentation but I think I have a big mixture in my head.
The principal focus is to cluster an application wtih this frameworks:

- hibernate
- spring & spring security
- jsf
- mule

It is very important to use this without serialization because it is not possible to change code to serialize the application.
So, I have been making proofs with a simple jsf application to have an idea.

I was looking for solutions to apply Terracotta app in this kind of application.
I will read the point (9) that you told me and I will try again.
It is possible I have some doubts :S

Thank you very much
ari

seraphim

Joined: 05/24/2006 14:23:21
Messages: 1665
Location: San Francisco, CA
Offline

Everything in your list works with Terracotta DSO, provided you use only specific versions of those vendors' frameworks (example: not all Hibernate versions work cleanly with DSO).

Mule is another story. What do you mean by you want to cluster an app with mule? The app has mule in it or you want us to cluster mule. Apps w/ mule in them work fine w/ DSO modulo a little bit of configuration magic that I do not remember at the moment. Clustering mule's internals with DSO does not work however.


--Ari
[WWW]
alex123

neo

Joined: 05/03/2011 02:28:39
Messages: 4
Offline

Ok.
I will not use mule in the application I was wrong, in fact it seems easier.. (I think :))
I will try again.

Thanks and regards,
Alex
rajoshi

seraphim

Joined: 07/04/2011 04:36:10
Messages: 1491
Offline

Issue seems to be resolved.Please let us know if more information is required.

Rakesh Joshi
Senior Consultant
Terracotta.
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team