• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Won't Fix
  • interfaces
  • Reporter: gbevin
  • February 09, 2009
  • 0
  • Watchers: 1
  • July 27, 2012
  • January 18, 2010

Description

When trying to reproduce another issue I ran into this one.

I basically use Spring 2.0.4 with its countries sample war, no changes made. The war obtained by running “ant warfile” in the countries samples directory.

Then I used the following tc-config.xml file to run the webapp with Tomcat 5.5.25, after having modified catalina.sh to use dso-java.sh instead of regular java:

<?xml version=”1.0” encoding=”UTF-8”?>

%(user.home)/terracotta/server-data %(user.home)/terracotta/server-logs %(user.home)/terracotta/client-logs *..* org.apache.coyote..* org.apache.catalina..* org.apache.jasper..* org.apache.tomcat..* countries

The error I got was the following. It seems that we might have to look into our Spring support to exclude some more classes by default:

com.tc.exception.TCNonPortableObjectError: ******************************************************************************* Attempt to share an instance of a non-portable class referenced by a portable class. This unshareable class has not been included for sharing in the configuration.

For more information on this issue, please visit our Troubleshooting Guide at: http://terracotta.org/kit/troubleshooting

Referring class : org.springframework.samples.countries.web.CountriesController Referring field : org.springframework.web.context.support.WebApplicationObjectSupport.servletContext Thread : http-8080-Processor24 JVM ID : VM(0) Non-included class: org.apache.catalina.core.ApplicationContextFacade

Under most circumstances, you should only be adding classes for your application. If you are adding classes for frameworks or code not written by you, then you should consider finding a Terracotta Integration Module (TIM) that matches the framework you are using.

As an example, if the non-portable class listed below is net.sf.ehcache.CacheManager, you should consider using the ehcache TIM.

It is also possible that some or all of the classes above are truly non-portable, the solution is then to mark the referring field as transient. For more information on non-portable classes see the Troubleshooting Guide.

Action to take:

1) Reconfigure to include the unshareable classes * edit your tc-config.xml file * locate the element \* add this snippet inside the element

   <instrumented-classes>
     <include>
       <class-expression>org.apache.catalina.core.ApplicationContextFacade</class-expression>
     </include>
   </instrumented-classes>

* if there is already an element present, simply add the new includes inside it

*******************************************************************************

at com.tc.object.ClientObjectManagerImpl.throwNonPortableException(ClientObjectManagerImpl.java:754)
at com.tc.object.ClientObjectManagerImpl.checkPortabilityOfTraversedReference(ClientObjectManagerImpl.java:646)
at com.tc.object.ClientObjectManagerImpl.access$900(ClientObjectManagerImpl.java:75)
at com.tc.object.ClientObjectManagerImpl$NewObjectTraverseTest.checkPortability(ClientObjectManagerImpl.java:987)
at com.tc.object.Traverser.addReferencedObjects(Traverser.java:48)
at com.tc.object.Traverser.traverse(Traverser.java:89)
at com.tc.object.ClientObjectManagerImpl.addToManagedFromRoot(ClientObjectManagerImpl.java:909)
at com.tc.object.ClientObjectManagerImpl.create(ClientObjectManagerImpl.java:267)
at com.tc.object.ClientObjectManagerImpl.lookupOrCreateIfNecesary(ClientObjectManagerImpl.java:327)
at com.tc.object.ClientObjectManagerImpl.lookupOrCreate(ClientObjectManagerImpl.java:300)
at com.tc.object.tx.ClientTransactionManagerImpl.logicalInvoke(ClientTransactionManagerImpl.java:791)
at com.tc.object.TCObjectLogical.logicalInvoke(TCObjectLogical.java:18)
at com.tc.object.bytecode.ManagerImpl.logicalInvoke(ManagerImpl.java:229)
at com.tc.object.bytecode.ManagerUtil.logicalInvoke(ManagerUtil.java:247)
at java.util.HashMap.put(Unknown Source)
at com.terracotta.session.SessionData.bindAttribute(SessionData.java:345)
at com.terracotta.session.SessionData.setAttributeReturnOld(SessionData.java:241)
at com.terracotta.session.SessionData.setAttribute(SessionData.java:233)
at org.springframework.samples.countries.web.CountriesController.handleMain(CountriesController.java:105)
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 org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:434)
at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:372)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:839)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:774)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:460)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
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:174)
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 com.tc.tomcat55.session.SessionValve55.tcInvoke(SessionValve55.java:63)
at com.tc.tomcat55.session.SessionValve55.invoke(SessionValve55.java:50)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:613)

Comments

Fiona OShea 2009-02-11

QA can you try to reproduce this issue with Spring 2.0.5 (which is supported). If there is still an issue assign back to DRB

nadeem ghani 2009-03-16

build the war file in spring 2.0.5 import into session-configurator start app with tc enabled

com.tc.exception.TCNonPortableObjectError: ******************************************************************************* Attempt to share an instance of a non-portable class referenced by a portable class. This unshareable class must be in the DSO boot jar. Please add this class to the boot jar configuration and re-create the DSO boot jar.

For more information on this issue, please visit our Troubleshooting Guide at: http://terracotta.org/kit/troubleshooting

Referring class : org.apache.commons.logging.impl.Jdk14Logger Referring field : org.apache.commons.logging.impl.Jdk14Logger.logger Non-portable field name : org.apache.commons.logging.impl.Jdk14Logger.logger Thread : [email protected] JVM ID : VM(1) Class to add to boot jar: java.util.logging.Logger

Under most circumstances, you should only be adding classes for your application. If you are adding classes for frameworks or code not written by you, then you should consider finding a Terracotta Integration Module (TIM) that matches the framework you are using.

As an example, if the non-portable class listed below is net.sf.ehcache.CacheManager, you should consider using the ehcache TIM.

It is possible that this class is truly non-portable, the solution is then to mark the referring field as transient. For more information on non-portable classes see the Troubleshooting Guide.

Action to take:

1) Reconfigure and rebuild the boot jar * edit your tc-config.xml file * locate the element \* add this snippet inside the element

   <additional-boot-jar-classes>
    <include>java.util.logging.Logger</include>
   </additional-boot-jar-classes>

* if there is already an element present, simply add the new includes inside it \* Recreate the boot jar by running the 'make-boot-jar' tool in the bin/ directory

*******************************************************************************

at com.tc.object.ClientObjectManagerImpl.throwNonPortableException(ClientObjectManagerImpl.java:770)
at com.tc.object.ClientObjectManagerImpl.checkPortabilityOfTraversedReference(ClientObjectManagerImpl.java:663)
at com.tc.object.ClientObjectManagerImpl.access$900(ClientObjectManagerImpl.java:77)
at com.tc.object.ClientObjectManagerImpl$NewObjectTraverseTest.checkPortability(ClientObjectManagerImpl.java:1005)
at com.tc.object.Traverser.addReferencedObjects(Traverser.java:48)
at com.tc.object.Traverser.traverse(Traverser.java:89)
at com.tc.object.ClientObjectManagerImpl.addToManagedFromRoot(ClientObjectManagerImpl.java:927)
at com.tc.object.ClientObjectManagerImpl.create(ClientObjectManagerImpl.java:279)
at com.tc.object.ClientObjectManagerImpl.lookupOrCreateIfNecesary(ClientObjectManagerImpl.java:339)
at com.tc.object.ClientObjectManagerImpl.lookupOrCreate(ClientObjectManagerImpl.java:312)
at com.tc.object.tx.ClientTransactionManagerImpl.logicalInvoke(ClientTransactionManagerImpl.java:807)
at com.tc.object.TCObjectLogical.logicalInvoke(TCObjectLogical.java:18)
at com.tc.object.bytecode.ManagerImpl.logicalInvoke(ManagerImpl.java:253)
at com.tc.object.bytecode.ManagerUtil.logicalInvoke(ManagerUtil.java:251)
at java.util.HashMap.put(Unknown Source)
at org.mortbay.jetty.servlet.AbstractSessionManager$Session.setAttribute(AbstractSessionManager.java:1057)
at org.springframework.samples.countries.web.CountriesController.handleMain(CountriesController.java:105)
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 org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:434)
at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:372)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:461)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:416)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:380)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.terracotta.servlet.TerracottaSessionHandler.handle(TerracottaSessionHandler.java:106)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) 2009-03-16 18:20:25.522::WARN:  /countries/main/home.htm com.tc.exception.TCNonPortableObjectError:  \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Attempt to share an instance of a non-portable class referenced by a portable class. This unshareable class must be in the DSO boot jar. Please add this class to the boot jar configuration and re-create the DSO boot jar.

For more information on this issue, please visit our Troubleshooting Guide at: http://terracotta.org/kit/troubleshooting

Referring class : org.apache.commons.logging.impl.Jdk14Logger Referring field : org.apache.commons.logging.impl.Jdk14Logger.logger Non-portable field name : org.apache.commons.logging.impl.Jdk14Logger.logger Thread : [email protected] JVM ID : VM(1) Class to add to boot jar: java.util.logging.Logger

Under most circumstances, you should only be adding classes for your application. If you are adding classes for frameworks or code not written by you, then you should consider finding a Terracotta Integration Module (TIM) that matches the framework you are using.

As an example, if the non-portable class listed below is net.sf.ehcache.CacheManager, you should consider using the ehcache TIM.

It is possible that this class is truly non-portable, the solution is then to mark the referring field as transient. For more information on non-portable classes see the Troubleshooting Guide.

Action to take:

1) Reconfigure and rebuild the boot jar * edit your tc-config.xml file * locate the element \* add this snippet inside the element

   <additional-boot-jar-classes>
    <include>java.util.logging.Logger</include>
   </additional-boot-jar-classes>

* if there is already an element present, simply add the new includes inside it \* Recreate the boot jar by running the 'make-boot-jar' tool in the bin/ directory

*******************************************************************************

at com.tc.object.ClientObjectManagerImpl.throwNonPortableException(ClientObjectManagerImpl.java:770)
at com.tc.object.ClientObjectManagerImpl.checkPortabilityOfTraversedReference(ClientObjectManagerImpl.java:663)
at com.tc.object.ClientObjectManagerImpl.access$900(ClientObjectManagerImpl.java:77)
at com.tc.object.ClientObjectManagerImpl$NewObjectTraverseTest.checkPortability(ClientObjectManagerImpl.java:1005)
at com.tc.object.Traverser.addReferencedObjects(Traverser.java:48)
at com.tc.object.Traverser.traverse(Traverser.java:89)
at com.tc.object.ClientObjectManagerImpl.addToManagedFromRoot(ClientObjectManagerImpl.java:927)
at com.tc.object.ClientObjectManagerImpl.create(ClientObjectManagerImpl.java:279)
at com.tc.object.ClientObjectManagerImpl.lookupOrCreateIfNecesary(ClientObjectManagerImpl.java:339)
at com.tc.object.ClientObjectManagerImpl.lookupOrCreate(ClientObjectManagerImpl.java:312)
at com.tc.object.tx.ClientTransactionManagerImpl.logicalInvoke(ClientTransactionManagerImpl.java:807)
at com.tc.object.TCObjectLogical.logicalInvoke(TCObjectLogical.java:18)
at com.tc.object.bytecode.ManagerImpl.logicalInvoke(ManagerImpl.java:253)
at com.tc.object.bytecode.ManagerUtil.logicalInvoke(ManagerUtil.java:251)
at java.util.HashMap.put(Unknown Source)
at org.mortbay.jetty.servlet.AbstractSessionManager$Session.setAttribute(AbstractSessionManager.java:1057)
at org.springframework.samples.countries.web.CountriesController.handleMain(CountriesController.java:105)
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 org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:434)
at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:372)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:461)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:416)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:380)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.terracotta.servlet.TerracottaSessionHandler.handle(TerracottaSessionHandler.java:106)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)