[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]
Terracotta Integration Problem (Urgent)  XML
Forum Index -> General
Author Message
shyam

journeyman

Joined: 09/10/2008 04:47:49
Messages: 30
Offline

Hi,

I am facing a very annoying problem with my Terracotta Integration. I used a sample program to use terracotta.
Now i want to Integrate Terracotta with my Existing Implementation.
My current server/starting point is a C exe program which internally calls java programs. so there is no direct entry point to java classes.

I set all the command line enviornment in command prompt and then started my process. But Terracotta server does not recognises it.

Can you help me in this. Thanks very much for any any help.

i Did these steps:

set TC_INSTALL_DIR=C:\Terracotta\terracotta-2.6.2
set TC_CONFIG_PATH=C:\2008.1\trunk\tm\src\java\tc-config.xml
call %TC_INSTALL_DIR%\bin\dso-env.bat -q
set JAVA_OPTS=%TC_JAVA_OPTS%
C:\2008.1\trunk\moca\bin\mocaconmgr.exe(My Program , which calls internally java programs).

I am using Terracota 2.6.2 and java version 1.6
teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1128
Offline

How does your C program invoke java? Mostly I'm wondering if you are spawning java as a separate process or instantiating a VM in process? I suspect it is the former, but want to make sure.

If you are spawning an external process then you'll need to make sure the appropriate command line arguments are getting added. Have a look at what %JAVA_OPTS% are to get an idea of what needs to be passed along when your program executes your java commands. Presumably given the script snippet you posted, you should be able to just read it out of the environment and pass it along.

If you're running java in process I don't really know what needs to be done. I'll wait to hear that is what you are actually doing before researching that.


Tim Eck (terracotta engineer)
shyam

journeyman

Joined: 09/10/2008 04:47:49
Messages: 30
Offline

It is working now when i set up all the Terracotta required environment settings through JAVA_VMARGS set.
I see clients are coming up but so many and huge amount of log files too.

Any solution how i can only select my JVM in to terracotta.

when i execute jps -lm on a command prompt i see my process and many other. I am not really sure which one is mine because it does not show the exact port number.

What is about "Dtc.node-name= property", could this help me, but i din't get any proper example for this.

I saw this message on the console:

**************************************************************************************
The statistics buffer couldn't be opened at
'C:\2008.1\trunk\tm\terracotta\client-statistics\20080911174538178'.
The CVT system will not be active for this node.

A common reason for this is that you're launching several Terracotta L1
clients on the same machine. The default directory for the statistics buffer
uses the IP address of the machine that it runs on as the identifier.
When several clients are being executed on the same machine, a typical solution
to properly separate these directories is by using a JVM property at startup
that is unique for each client.

For example:
dso-java.sh -Dtc.node-name=node1 your.main.Class

You can then adapt the tc-config.xml file so that this JVM property is picked
up when the statistics directory is configured by using %(tc.node-name) in the
statistics path.
**************************************************************************************

below is my tc-config.xml :
<?xml version="1.0" encoding="UTF-8"?>
<tc:tc-config xmlns:tc="http://www.terracotta.org/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd">
<servers>

<server host="%i" name="localhost">

<dso-port>9510</dso-port>

<jmx-port>9520</jmx-port>

<data>terracotta/server-data</data>

<logs>terracotta/server-logs</logs>

</server>

<update-check>
<enabled>true</enabled>
</update-check>
</servers>
<clients>
<logs>terracotta/client-logs</logs>
<statistics>terracotta/client-statistics/%D</statistics>
<modules>
<module group-id="org.terracotta.modules" name="tim-ehcache-1.3" version="1.1.3"/>

</modules>
</clients>
<application>
<dso>
<instrumented-classes>
<include>
<class-expression>java.uti.Map</class-expression>
</include>
</instrumented-classes>
<roots>
<root>
<field-name>com.redprairie.tm.distancecalculatorImpl.TmDistanceCalculatorImpl.manager
</field-name>
</root>
</roots>
</dso>
</application>
</tc:tc-config>


shyam

journeyman

Joined: 09/10/2008 04:47:49
Messages: 30
Offline

I am getting

com.tc.object.tx.UnlockedSharedObjectException:
*******************************************************************************
Attempt to access a shared object outside the scope of a shared lock.
All access to shared objects must be within the scope of one or more shared locks defined in your T
erracotta configuration.
Please alter the locks section of your Terracotta configuration so that this access is auto-locked
or protected by a named lock.

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


Caused by Thread: main in VM(0)
Shared Object Type: java.util.HashMap
*******************************************************************************

I populate a Map, which gives this exception while adding the 2nd element.

I have changed my tc-config.xml file like below, but it didn't help any suggestion:
************************************************************
<?xml version="1.0" encoding="UTF-8"?>
<tc:tc-config xmlns:tc="http://www.terracotta.org/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd">
<servers>

<server host="%i" name="localhost">

<dso-port>9510</dso-port>

<jmx-port>9520</jmx-port>

<data>terracotta/server-data</data>

<logs>terracotta/server-logs</logs>

</server>

<update-check>
<enabled>true</enabled>
</update-check>
</servers>
<clients>
<logs>terracotta/client-logs</logs>
<statistics>terracotta/client-statistics/%D</statistics>
<modules>
<module group-id="org.terracotta.modules" name="tim-ehcache-1.3" version="1.1.3"/>

</modules>
</clients>
<application>
<dso>
<locks>
<autolock>
<method-expression>synchronized void com.redprairie.tm.distancecalculator.TmDistanceCalculatorImpl.addDistanceToCache(..) </method-expression>
<lock-level>write</lock-level>

</autolock>

</locks>


<roots>
<root>
<field-name>com.redprairie.tm.distancecalculatorImpl.TmDistanceCalculatorImpl
</field-name>
</root>
</roots>
</dso>
</application>
</tc:tc-config>

*****************************************************
tgautier

seraphim

Joined: 06/05/2006 12:19:26
Messages: 1781
Offline

follow the instructions that are given in the error you just posted. Also read the docs here:

http://www.terracotta.org/web/display/orgsite/Configuring+Terracotta.

<autolock>
<method-expression>synchronized void com.redprairie.tm.distancecalculator.TmDistanceCalculatorImpl.addDistanceToCache(..) </method-expression>
<lock-level>write</lock-level>

Should be:

<autolock>
<method-expression>void com.redprairie.tm.distancecalculator.TmDistanceCalculatorImpl.addDistanceToCache(..)</method-expression>
<lock-level>write</lock-level>

And the the object TmDistanceCalculatorImpl must be a shared object (and the method addDistanceToCache must be synhronized).

I recommend you start from the top:

http://www.terracotta.org/web/display/orgsite/Integration+Overview

Read each doc in order and you'll be much better off.

[WWW]
shyam

journeyman

Joined: 09/10/2008 04:47:49
Messages: 30
Offline

I have changed HashMap to concurrentHashMap.
Now my config file look like thsi:

<?xml version="1.0" encoding="UTF-8"?>
<tc:tc-config xmlns:tc="http://www.terracotta.org/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd">
<servers>

<server host="%i" name="localhost">

<dso-port>9510</dso-port>

<jmx-port>9520</jmx-port>

<data>terracotta/server-data</data>

<logs>terracotta/server-logs</logs>

</server>

<update-check>
<enabled>true</enabled>
</update-check>
</servers>
<clients>
<logs>terracotta/client-logs</logs>
<statistics>terracotta/client-statistics/%D</statistics>
<modules>
<module group-id="org.terracotta.modules" name="tim-ehcache-1.3" version="1.1.3"/>

</modules>
</clients>
<application>
<dso>
<instrumented-classes>
<include>
<class-expression>com.redprairie.tm.distancecalculatorImpl.TmDistanceCalculatorImpl</class-expression>
</include>
</instrumented-classes>
<locks>
<autolock>
<method-expression>void com.redprairie.tm.distancecalculator.TmDistanceCalculatorImpl.addDistanceToCache(..) </method-expression>
<lock-level>write</lock-level>

</autolock>

</locks>


<roots>
<root>

<field-name>com.redprairie.tm.distancecalculatorImpl.TmDistanceCalculatorImpl.manager
</field-name>
</root>
</roots>
</dso>
</application>
</tc:tc-config>

____________________________

but now the problem is i have to load, 80000 items in to the cache. when i run my server without binding Terracotta, it comes up in 2/3 minutes. But with Terracotta it takes a load of time.
Could you help me in this, what can be the problem.
shyam

journeyman

Joined: 09/10/2008 04:47:49
Messages: 30
Offline

I get the below lines in my Terracotta Administrator Console:

2008-09-17 15:49:43,149 [TC Memory Monitor] INFO com.tc.runtime.TCMemoryManagerImpl - Sleep time changed to : 600
2008-09-17 15:49:58,229 [TC Memory Monitor] INFO com.tc.runtime.TCMemoryManagerImpl - Sleep time changed to : 240
2008-09-17 15:50:19,700 [TC Memory Monitor] INFO com.tc.runtime.TCMemoryManagerImpl - Sleep time changed to : 22
2008-09-17 15:50:37,687 [TC Memory Monitor] INFO com.tc.runtime.TCMemoryManagerImpl - Sleep time changed to : 8
2008-09-17 15:50:43,592 [TC Memory Monitor] INFO com.tc.runtime.TCMemoryManagerImpl - Sleep time changed to : 4
2008-09-17 15:50:46,278 [TC Memory Monitor] INFO com.tc.runtime.TCMemoryManagerImpl - Sleep time changed to : 1
gkeim

ophanim

Joined: 12/05/2006 10:22:37
Messages: 685
Location: Terracotta, Inc.
Offline

This past thread might be useful: http://forums.terracotta.org/forums/posts/list/1101.page

It talks about batching your transactions.

Gary Keim (terracotta developer) Want to post to this forum? Join the Terracotta Community
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.7 © JForum Team