Author |
Message |
08/20/2007 09:14:04
|
satish
journeyman
Joined: 07/24/2007 04:45:52
Messages: 12
Offline
|
Hi,
I followed the steps as in the Manual, and suggestions given in other forums.
I looked at the Admin console and included the classes in the Class Map.
Each and everytime I try to run the bit of code that is causing this problem, I get a message to include a class to fix the problem. I keep doing this till a point I get the following classes to add in tomcat
*******************************************************************************
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. Please add this
class to the <includes> section of the configuration file. This class also has a super-class
that has not been included for sharing in the configuration. Please add this class to the
<includes> section in the configuration file also.
Referring class : org.apache.catalina.core.ApplicationContext
Referring field : org.apache.catalina.core.ApplicationContext.context
Thread : http-80-Processor23
JVM ID : VM(0)
Non-included classes: org.apache.catalina.core.StandardContext, org.apache.catalina.core.ContainerBase
*******************************************************************************
My tc-config.xml
<instrumented-classes>
<!-- Start by including all classes for instrumentation.
It's more efficient to instrument only those classes that
hold shared roots or are part of a shared root's graph -->
<include><class-expression>nsg.Style</class-expression></include>
<include><class-expression>nsg.Device</class-expression></include>
<include><class-expression>nsg.Channel</class-expression></include>
<include><class-expression>java.util.HashMap</class-expression></include>
<include><class-expression>com.terracotta.session..*</class-expression></include>
<include><class-expression>javax.servlet..*</class-expression></include>
<include><class-expression>java.util.Hashtable</class-expression></include>
<include><class-expression>java.sql.Timestamp</class-expression></include>
<include><class-expression>org.apache..*</class-expression></include>
<include><class-expression>nsg..*</class-expression></include>
<include><class-expression>org.apache.catalina.core.StandardContext</class-expression></include>
<include><class-expression>org.apache.catalina.core.ContainerBase</class-expression></include>
<!-- Exclude tomcat internals to improve performance of webapp loading -->
</instrumented-classes>
Now I thought org.apache..* should have covered these two classes, but I included these specific classes in the file and I still get the same error.
Any suggestions ?
|
|
|
08/20/2007 09:48:26
|
tgautier
seraphim
Joined: 06/05/2006 12:19:26
Messages: 1781
Offline
|
Well, I can think of two things.
1) You probably shouldn't try to share these classes. I would examine your object graph and understand why your application is making reference to these internal classes in Tomcat.
2) If you are convinced that you do need these classes, maybe you have the Tomcat exclude lines below the include lines? The order of precedence starts from the bottom and goes up, so if you have an include line, and then an exclude line, the exclude line will take priority and then the classes won't be included.
|
|
|
08/20/2007 11:40:17
|
satish
journeyman
Joined: 07/24/2007 04:45:52
Messages: 12
Offline
|
Why is it that *..* does not work in this scenario. I had only <include><class-expression> *..* </class-expression></include>, and no exclude tags and it still gave me exceptions to include these files.
Also when you mean object graph, do you mean the map in the admin console (Terracotta Sesssion Admin console), Classes -> maps ?
|
|
|
08/20/2007 11:47:55
|
tgautier
seraphim
Joined: 06/05/2006 12:19:26
Messages: 1781
Offline
|
satish wrote:
Why is it that *..* does not work in this scenario. I had only <include><class-expression> *..* </class-expression></include>, and no exclude tags and it still gave me exceptions to include these files.
There are some classes which are never shareable, and some which have to be instrumented during boot load time. So either those classes are descendants of non-shareable classes, or it is necessary to rebuild your boot-jar.
There are more details in the Troubleshooting Guide regarding Non-portable classes:
http://www.terracotta.org/confluence/display/docs1/Troubleshooting+Guide#TroubleshootingGuide-Iamgettingcom.tc.exception.TCNonPortableObjectException.Whatnext%3F
A list of classes that are non-portable is found here:
http://www.terracotta.org/confluence/display/docs1/Unsupported+Classes
satish wrote:
Also when you mean object graph, do you mean the map in the admin console (Terracotta Sesssion Admin console), Classes -> maps ?
The object graph is the set of objects being shared by Terracotta. If you are using Terracotta Sessions, then it is the sum total of all objects you have put into your Session Context using setAttribute. Otherwise it is the sum total of all objects reachable from the roots you have declared in the Terracotta Config.
|
|
|
08/23/2007 05:44:48
|
satish
journeyman
Joined: 07/24/2007 04:45:52
Messages: 12
Offline
|
Thanks for your reply,
I have fixed the problem by including <honor-transient>true</honor-transient> for a class that had transient variables.
|
|
|
|