[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]
BigMemory Max + Ecache getting started  XML
Forum Index -> BigMemory
Author Message
ant284

neo

Joined: 10/02/2013 04:26:45
Messages: 9
Offline

Hi,

Sorry for this, I'm sure you getting loads of this request but couldn't find anything on the forum.

I have donwloaded and registered to BigMemory Max 4 - 8GB
and started with the instruction here :
http://terracotta.org/documentation/4.0/bigmemorymax/get-started

In eclipse I have created a new project, new class HelloWorld
put the key and the ehcache xml in a config folder.

When I run the code, I get
Exception in thread "main" java.lang.NoClassDefFoundError: BigMemory
Caused by: java.lang.ClassNotFoundException: BigMemory

I'm currently running Java 1.6 ...

any help would be appreciated

Thanks,
adahanne

master

Joined: 03/20/2012 23:14:46
Messages: 95
Offline

hello,
could you please provide us with more details about your project ?
How did you set the classpath (maven, ant or just adding to the IDE classpath ?)
Even better : can you zip your project and attach it to the forum post ? (you would not need to include all the big memory jars, just tell us which jars , with precise version, you relied on)
thank you in advance
ant284

neo

Joined: 10/02/2013 04:26:45
Messages: 9
Offline

Hi,

actually it all seems to work
1) Removed the key path when running java.

2) changed in the example
this line
final CacheManager cacheManager = new CacheManager();
to
final CacheManager cacheManager = new CacheManager("ehcache.xml");

at the moment i'm not running maven for it
ant284

neo

Joined: 10/02/2013 04:26:45
Messages: 9
Offline

Hi,

so here is the error again.
I'm not using mavent/ant etc.... just using Eclipse and put the lib files in the build configuration as mentioned by the documention here
http://terracotta.org/documentation/4.0/bigmemorymax/get-started/server-array

The error comes directly when in the run configuration I put the key
-Dcom.tc.productkey.path=/path/to/terracotta-license.key

so out of curiosity I added into my lib path all the jars I could find but no luck.
It really seems like something is going on when I put the key only. Because with the previous example works but clearly don't need the key but when I use the server array example and put the key, I get the following error

Exception in thread "main" java.lang.NoClassDefFoundError: BigMemory
Caused by: java.lang.ClassNotFoundException: BigMemory
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


if I don't put the key I get this
Oct 3, 2013 1:18:50 PM net.sf.ehcache.terracotta.TerracottaClient info
INFO: Thread [main] [cacheManager: 'SampleConfig']: Creating new ClusteredInstanceFactory
2013-10-03 13:18:50,236 INFO - Terracotta Enterprise 4.0.4, as of 20130919-132058 (Revision 31119-23771 by cruise@rh5vmo136.terracotta.lan from 4.0.4)
2013-10-03 13:18:50,852 INFO - Successfully loaded base configuration from server at 'localhost:9510'.
2013-10-03 13:18:50,894 INFO - Log file: '/Users/anthonyward/terracotta/client-logs/terracotta-client.log'.
2013-10-03 13:18:51,147 ERROR - Terracotta license key is required for Enterprise capabilities. Please place terracotta-license.key in the Terracotta installation directory or in the resource path. You can also specify it as a system property with -Dcom.tc.productkey.path=/path/to/key
2013-10-03 13:18:51,147 ERROR - License key not found


Also I had to change from the example here
http://terracotta.org/documentation/4.0/bigmemorymax/get-started/server-array

// Create a cache manager using the factory method...
final CacheManager cacheManager = CacheManager.newInstance(Group.class
.getResource("/ehcache-server-array.xml"));

to

// Create a cache manager using the factory method...
final CacheManager cacheManager = CacheManager.newInstance(("ehcache-server-array.xml"));


Thanks
adahanne

master

Joined: 03/20/2012 23:14:46
Messages: 95
Offline

Hello,
I could not reproduce your error, even specifying a license path with -Dcom.tc.productkey.path=/path/to/terracotta-license.key
That said, I acknowledge that the Group.class does not exist, and that the ehcache and slf4j jars also need to be added to your classpath (I have asked the webmasters to update the website accordingly)

Here is a screenshot I took of my workspace : no need to specify any vm argument for the license if you follow my setup.

https://dl.dropboxusercontent.com/u/2138522/bigmemory-max-tryout.png

I hope that helps, and thanks for letting us know !
Anthony
ant284

neo

Joined: 10/02/2013 04:26:45
Messages: 9
Offline

Will try and let you... I guess can't talk of beginners luck here :)
ant284

neo

Joined: 10/02/2013 04:26:45
Messages: 9
Offline

Quick question, bigmemory works with Java 1.7?? I thought I read somewhere in the doc that it works only with 1.5/1.6 - need to find the documentation if I'm correct (don't trust me though read below why :) )

Ok OK ...

So the problem was with the path to the key.

I put the key in the workspace directory. To explain a bit more,
I created in eclipse a project :
Java BigMemory Cache Server

Here is the path to the project:
/Users/anthonyward/Documents/workspace/Java BigMemory Cache Server/

then I put the key here:
/Users/anthonyward/Documents/workspace/Java BigMemory Cache Server/
terracotta-license.key

So in the reference, as you can probably see and I didn't catch it straight, was the space inside the name of the project.

so fixed it from:
-Dcom.tc.productkey.path=/Users/anthonyward/Documents/workspace/Java BigMemory Cache Server/terracotta-license.key
to
-Dcom.tc.productkey.path="/Users/anthonyward/Documents/workspace/Java BigMemory Cache Server/terracotta-license.key"


Sorry for the stupid mistake.


ant284

neo

Joined: 10/02/2013 04:26:45
Messages: 9
Offline

double post
 
Forum Index -> BigMemory
Go to:   
Powered by JForum 2.1.7 © JForum Team