Author |
Message |
|
I was under the impression that using this ConcurrentDistributedMap was an abstraction to using a Map with an clustered ehcache backing. I have seen references to source code which has a reference to the ehcache Cache instance that is used for this abstraction.
|
|
|
I was looking to take advantage of making a Map cluster backed via ehcache via ConcurrentDistributedMap. However, I am have a *very* difficult time tracking down where that implementation exists with regard to terracotta-toolkit-*.jar's.
I can't figure out if that is only available in the ee version.
Thanks,
Brad
|
|
|
We are configured in DSO mode with the following components (and for the most part operating correctly with regard to what terracotta is supposed to do):
terracotta-3.4.0
spring-3.0.4
hibernate-3.5.6
ehcache-2.2.0
Everything appears to be working (except for why I am posting) correctly wrt to WebSession replication, Hibernate second level caching with ehcache, and DSO root functionality.
However, after a certain amount of stress-testing, one or more of the appservers (tomcat instances) starts to throw these InstantiationExceptions complaining about a defaultConstructor. The code previous to "breaking" is covered in the stress test. From that point, this particular class is always "broken" until the appserver is restarted -- like it's been instrumented or modified in the JVM.
Anyway, it appears someone else had this issue back in terracotta 2 and I am wondering if that was re-introduced or if there is something that I have mis-configured. http://forums.terracotta.org/forums/posts/list/319.page
We are using hibernate-3.5.6 and I have *not* been able to get the tim-hibernate-entity working. (It fails during startup where the terracotta classes are looking for a VERSION field in a hibernate class). Anyway, the fact that I am adding net.sf..* and org.hibernate..* to instrumented classes could be significant but I really really don't want to roll-back hibernate upgrades and all appears to be working otherwise.
Below is my tc-config for my appservers and a snippet of the exception.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-5.xsd" xmlns:tc="http://www.terracotta.org/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server name="tc1">
<dso-port>59510</dso-port>
<jmx-port>59520</jmx-port>
<l2-group-port>59530</l2-group-port>
<data>/tc/terracotta-data/server-logs</data>
<logs>/tc/terracotta-data/server-logs</logs>
<statistics>/tc/terracotta-data/server-statistics</statistics>
<dso>
<persistence>
<mode>permanent-store</mode>
</persistence>
</dso>
</server>
<server name="tc2">
<dso-port>59510</dso-port>
<jmx-port>59520</jmx-port>
<l2-group-port>59530</l2-group-port>
<data>/tc/terracotta-data/server-logs</data>
<logs>/tc/terracotta-data/server-logs</logs>
<statistics>/tc/terracotta-data/server-statistics</statistics>
<dso>
<persistence>
<mode>permanent-store</mode>
</persistence>
</dso>
</server>
</servers>
<!--Tell DSO where to put the generated client logs See the Terracotta DSO Guide for additional information. -->
<clients>
<modules>
<repository>company/lib</repository>
<module name="tim-tomcat-6.0" version="2.2.1" />
<module name="tim-ehcache-2.x" version="1.6.1" />
</modules>
<logs>/tc/terracotta-data/client-logs</logs>
</clients>
<application>
<dso>
<!-- needed for TreeMap -->
<additional-boot-jar-classes>
<include>java.lang.String$CaseInsensitiveComparator</include>
</additional-boot-jar-classes>
<instrumented-classes>
<include>
<class-expression>org.springframework.security..*</class-expression>
</include>
<include>
<class-expression>com.company..*</class-expression>
<honor-transient>true</honor-transient>
</include>
<!-- flex remoting -->
<include>
<class-expression>flex.messaging..*</class-expression>
</include>
<include>
<class-expression>org.granite.messaging..*</class-expression>
</include>
<!-- needed for hibernate 2nd level cache (could not get the tim-hibernate to work) -->
<include>
<class-expression>org.hibernate..*</class-expression>
<honor-transient>true</honor-transient>
</include>
<include>
<class-expression>net.sf..*</class-expression>
<honor-transient>true</honor-transient>
</include>
<!-- Exclude tomcat internals to improve performance of webapp loading -->
<exclude>org.apache.coyote..*</exclude>
<exclude>org.apache.catalina..*</exclude>
<exclude>org.apache.jasper..*</exclude>
<exclude>org.apache.tomcat..*</exclude>
</instrumented-classes>
<!--Tell DSO which applications in your web container is using DSO -->
<!-- was getting locking issues with hibernate under load (could not get the tim-hibernate to work) -->
<locks>
<autolock auto-synchronized="true">
<method-expression>* org.hibernate.cache.ReadWriteCache$Lock.lock(..)</method-expression>
<lock-level>write</lock-level>
</autolock>
<autolock auto-synchronized="true">
<method-expression>* org.hibernate.cache.ReadWriteCache$Lock.unlock(..)</method-expression>
<lock-level>write</lock-level>
</autolock>
</locks>
<web-applications>
<web-application>product</web-application>
</web-applications>
</dso>
</application>
</tc:tc-config>
Code:
org.hibernate.InstantiationException: No default constructor for entity: com.company.model.arts.CustomerAffiliationId
at org.hibernate.tuple.PojoInstantiator.instantiate(PojoInstantiator.java:107)
at org.hibernate.tuple.component.AbstractComponentTuplizer.instantiate(AbstractComponentTuplizer.java:102)
at org.hibernate.type.ComponentType.instantiate(ComponentType.java:510)
at org.hibernate.type.ComponentType.instantiate(ComponentType.java:516)
at org.hibernate.type.ComponentType.assemble(ComponentType.java:565)
at org.hibernate.type.ManyToOneType.assembleId(ManyToOneType.java:257)
at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:241)
at org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:147)
at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:58)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:159)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:71)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1853)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:369)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:134)
at org.hibernate.collection.PersistentSet.isEmpty(PersistentSet.java:169)
at com.company.service.impl.CustomerManagerImpl.convertToCustDTO(CustomerManagerImpl.java:819)
|
|
|
Two tools I was using were
* Zenoss via ZenJMX (http://community.zenoss.org/docs/DOC-3396). We use that for monitoring tomcat, activemq, and other JVMs.
* jmxterm - command line jmx browser of sorts (http://wiki.cyclopsgroup.org/jmxterm:manual)
Mainly we wanted to have some nice statistics monitoring in Zenoss to comliment the other jmx stats for tomcat, etc... Requests, Object counts (any session related data), etc...
|
|
|
Is there any other alternative to connecting to the jmx mbean? I can't figure out how to make this work with any other tools (except jconsole noted in the thread).
I need to monitor this remotely. How are people accomplishing this task without running the dev-console?
Is there some other form of URL which would solve this?
|
|
|
That worked thank you.
Now I need to work on incorporating this concept in the monitor tool we are using which uses a jmx client to attach. But at least I have something to work with.
|
|
|
I did notice that com.sun.management.jmxremote was not set to anything other than empty string. Unless the reason it is listed in the SystemProperties is that it is set and not null.
[main] INFO com.tc.logging.TCLogging - All Java System Properties for this Terracotta instance:
========================================================================
cluster-forceshutdown : true
com.sun.management.jmxremote :
|
|
|
I have a terracotta instance with a tc-config jmx port setting of 19520. From remote machines I can telnet to that port and get jmx related binary responses.
However, when trying to connect from jconsole or other thirdparty jmx clients, I get the following exception... "with a root cause of non-JRMP server at remote endpoint".
error connecting to server:Failed to connect to service:jmx:rmi:///jndi/rmi://10.200.12.233:19520/jmxrmi [Nested Exception: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]]
I have tried several mutations of connect URL's from jconsole -- all without specifying login credentials. (e.g., service:jmx:jmxmp://10.200.12.233:19520)
I can however connect via process id from a jconsole on the machine running the terracotta instance. It appears to be a problem for me only from remote machine. The dev-console can connect just fine.
using terracotta-3.0.1
server section of tc-config.xml
<dso-port>19510</dso-port>
<jmx-port>19520</jmx-port>
<l2-group-port>19530</l2-group-port>
snippet from terracotta server logs
[main] INFO com.terracottatech.console - JMX Server started. Available at URL[service:jmx:jmxmp://0.0.0.0:19520]
|
|
|