Problem running DarkStar HelloWorld in eclipse

Hello , i am beginner to sgs, and i was trying to follow the instruction of jeff about running the sgs 0.9 in eclipse,

the problem was that when i put just the two sgs config paths parameters in
the VM the run cut by exception that there is no main class, (and i set the main class to the kernel of sgs),
so i had to the first parameter the kernel class path the second parameter to the helloworld properties ,
and the two other to sgs config paths (all in VM Arguments)

(i am working under windows 2000)

this is what i got :

15/04/2007 08:44:00 com.sun.sgs.impl.kernel.Kernel
INFO: The Kernel is ready, version: 0.9.1-r2129
15/04/2007 08:44:00 com.sun.sgs.impl.kernel.Kernel startupApplication
SEVERE: Could not setup service
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.sun.sgs.impl.kernel.Kernel.createService(Kernel.java:438)
at com.sun.sgs.impl.kernel.Kernel.setupService(Kernel.java:455)
at com.sun.sgs.impl.kernel.Kernel.startupApplication(Kernel.java:327)
at com.sun.sgs.impl.kernel.Kernel.main(Kernel.java:651)
Caused by: java.lang.UnsatisfiedLinkError: no libdb_java45 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.sleepycat.db.internal.db_javaJNI.(db_javaJNI.java:35)
at com.sleepycat.db.internal.DbEnv.(DbEnv.java:213)
at com.sleepycat.db.EnvironmentConfig.createEnvironment(EnvironmentConfig.java:932)
at com.sleepycat.db.EnvironmentConfig.openEnvironment(EnvironmentConfig.java:885)
at com.sleepycat.db.Environment.(Environment.java:30)
at com.sun.sgs.impl.service.data.store.DataStoreImpl.getEnvironment(DataStoreImpl.java:531)
at com.sun.sgs.impl.service.data.store.DataStoreImpl.(DataStoreImpl.java:434)
at com.sun.sgs.impl.service.data.DataServiceImpl.(DataServiceImpl.java:208)
… 8 more
Exception in thread “main” java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.sun.sgs.impl.kernel.Kernel.createService(Kernel.java:438)
at com.sun.sgs.impl.kernel.Kernel.setupService(Kernel.java:455)
at com.sun.sgs.impl.kernel.Kernel.startupApplication(Kernel.java:327)
at com.sun.sgs.impl.kernel.Kernel.main(Kernel.java:651)
Caused by: java.lang.UnsatisfiedLinkError: no libdb_java45 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.sleepycat.db.internal.db_javaJNI.(db_javaJNI.java:35)
at com.sleepycat.db.internal.DbEnv.(DbEnv.java:213)
at com.sleepycat.db.EnvironmentConfig.createEnvironment(EnvironmentConfig.java:932)
at com.sleepycat.db.EnvironmentConfig.openEnvironment(EnvironmentConfig.java:885)
at com.sleepycat.db.Environment.(Environment.java:30)
at com.sun.sgs.impl.service.data.store.DataStoreImpl.getEnvironment(DataStoreImpl.java:531)
at com.sun.sgs.impl.service.data.store.DataStoreImpl.(DataStoreImpl.java:434)
at com.sun.sgs.impl.service.data.DataServiceImpl.(DataServiceImpl.java:208)
… 8 more

Thanks in advance,
lior

Hi

Your java.library.path does not point to the folder containing the db_java45 dll. In eclipse you can either add an arguement to the run settings, or, if you find the db.jar in the SGS libs folder, right click on it, and somewhere in the properties there is a ‘native libraries’ settinsg dialog, just find the win32-x86 folder and in there is the needed dll.

HTH

Endolf

Thanks for replying to me. :slight_smile:

i tried a lot variation and at last i removed the parameters from vm arguments to just arguments,

now there is new problem:

16/04/2007 01:47:24 com.sun.sgs.impl.kernel.Kernel
INFO: The Kernel is ready, version: 0.9.1-r2129
16/04/2007 01:47:25 com.sun.sgs.impl.kernel.Kernel startupApplication
SEVERE: Could not setup service
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.sun.sgs.impl.kernel.Kernel.createService(Kernel.java:438)
at com.sun.sgs.impl.kernel.Kernel.setupService(Kernel.java:455)
at com.sun.sgs.impl.kernel.Kernel.startupApplication(Kernel.java:327)
at com.sun.sgs.impl.kernel.Kernel.main(Kernel.java:651)
Caused by: java.lang.NoClassDefFoundError: com/sleepycat/db/DatabaseException
at com.sun.sgs.impl.service.data.store.DataStoreImpl.(DataStoreImpl.java:434)
at com.sun.sgs.impl.service.data.DataServiceImpl.(DataServiceImpl.java:208)
… 8 more
Exception in thread “main” java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.sun.sgs.impl.kernel.Kernel.createService(Kernel.java:438)
at com.sun.sgs.impl.kernel.Kernel.setupService(Kernel.java:455)
at com.sun.sgs.impl.kernel.Kernel.startupApplication(Kernel.java:327)
at com.sun.sgs.impl.kernel.Kernel.main(Kernel.java:651)
Caused by: java.lang.NoClassDefFoundError: com/sleepycat/db/DatabaseException
at com.sun.sgs.impl.service.data.store.DataStoreImpl.(DataStoreImpl.java:434)
at com.sun.sgs.impl.service.data.DataServiceImpl.(DataServiceImpl.java:208)
… 8 more

it is look like missing class exception…
i do not have any idea what causing this problem…

(now i did not put the two parameters of config of sgs in the vm arguments because it demands a refernce to the main class)

any idea?

Looks like you don’t have the slpeeycat db.jar it looks like in your classpath.

You need all the jars in libs, including the db.jar in lib/db

Thank you again , and i am sorry :slight_smile:

the class path worked :slight_smile:

16/04/2007 06:47:52 com.sun.sgs.impl.kernel.Kernel
INFO: The Kernel is ready, version: 0.9.1-r2129
16/04/2007 06:47:55 com.sun.sgs.impl.kernel.Kernel main
SEVERE: Missing required property com.sun.sgs.app.name from config: C:/Darkstar/sgs/sgs-config.properties … skipping startup
16/04/2007 06:47:55 com.sun.sgs.impl.kernel.Kernel main
SEVERE: Missing required property com.sun.sgs.app.name from config: C:/Darkstar/sgs/sgs-logging.properties … skipping startup
Hello World!16/04/2007 06:47:58 com.sun.sgs.impl.kernel.Kernel applicationReady
INFO: HelloWorld: application is ready

but it is seems that it is running not?

can i contribute in some way?

thank you,
lior

In your application configuration file are you including a value for com.sun.sgs.app.name? This is a required property.

seth

in my application properties i included a value for com.sun.sgs.app.name,

any other idea?

Are you putting this in the application properties file (where it belongs) or in the VM launch properties?

JK

Oh.

If Im reading that error right, your using the wrong properties file as the parameter to Kernel.

you need the application configuration properties not sgs-logging.properties.

The sgs-logging properties, if you wish to use them, have to be specified with a -D parameter,
See the comment at the top of the sgs-logging.properties file for details.