SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Getting started with 24x7 Java API
Goto page 1, 2  Next
 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Getting started with 24x7 Java API
Author Message
TJ



Joined: 21 Jun 2005
Posts: 35

Post Getting started with 24x7 Java API Reply with quote

I am just getting started with the 24x7 scheduler(JAVA edition).
I am basically trying to integrate the scheduler with our main project. But when I try to implement the example code (Given in the Java API, to open a session) I am getting the following error:

"Exception in thread "main" java.lang.NoClassDefFoundError: com/objectspace/jgl/container

at com.softtreetech.scheduler.j24x7.openSession(j24x7.java:246)

at TrialScheduler.main(TrialScheduler.java:32) "

Please get back ASAP.

PN: I am using the registered version of 24x7 scheduler (java edition) and running the scheduler in master mode on a local machine. Also how can I run it in the non-GUI mode?

Thanks


Tue Jun 21, 2005 12:50 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Re: Getting started with 24x7 Java API Reply with quote

Check debug.log file for more info. You should find the error reason here.

If you run 24x7 v2.1 build 107 or later you can start it as
master.bat nogui
or
master.sh nogui

This will start the scheduler in non-graphical mode.

: I am just getting started with the 24x7 scheduler(JAVA edition).
: I am basically trying to integrate the scheduler with our main project. But
: when I try to implement the example code (Given in the Java API, to open a
: session) I am getting the following error: "Exception in thread
: "main" java.lang.NoClassDefFoundError:
: com/objectspace/jgl/container

: at com.softtreetech.scheduler.j24x7.openSession(j24x7.java:246)

: at TrialScheduler.main(TrialScheduler.java:32) "

: Please get back ASAP.

: PN: I am using the registered version of 24x7 scheduler (java edition) and
: running the scheduler in master mode on a local machine. Also how can I
: run it in the non-GUI mode?

: Thanks

Tue Jun 21, 2005 1:25 pm View user's profile Send private message
TJ



Joined: 21 Jun 2005
Posts: 35

Post Re: Getting started with 24x7 Java API Reply with quote

Thanks for th Input. But the problem is that it is unable to connect to the 24x7 master, I guess that would be a minimum requirement for the rror to show up in the debug.log file.

: Check debug.log file for more info. You should find the error reason here.

: If you run 24x7 v2.1 build 107 or later you can start it as
: master.bat nogui
: or
: master.sh nogui

: This will start the scheduler in non-graphical mode.

Tue Jun 21, 2005 1:36 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Re: Getting started with 24x7 Java API Reply with quote

Which JDK version are you using?
Did you add JDPB24x7.jar and jgl3.1.0.jar files to the project class path?

: Thanks for th Input. But the problem is that it is unable to connect to the
: 24x7 master, I guess that would be a minimum requirement for the rror to
: show up in the debug.log file.

Tue Jun 21, 2005 2:09 pm View user's profile Send private message
TJ



Joined: 21 Jun 2005
Posts: 35

Post Re: Getting started with 24x7 Java API Reply with quote

jdk version: jdk1.5.0_03

Yes I did and that is precisely why the file compiles fine, it gives an error when executed.

: Which JDK version are you using?
: Did you add JDPB24x7.jar and jgl3.1.0.jar files to the project class path?

Tue Jun 21, 2005 2:26 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Re: Getting started with 24x7 Java API Reply with quote

Looks like it cannot find classes in com.sybase.dpb.* which still makes me think that either JDPB24x7.jar or jgl3.1.0.jar are not in the path or cannot be found by JVM. Are you adding these files to the class-path when running the program or only when compiling it?

: jdk version: jdk1.5.0_03

: Yes I did and that is precisely why the file compiles fine, it gives an error
: when executed.

Tue Jun 21, 2005 2:41 pm View user's profile Send private message
TJ



Joined: 21 Jun 2005
Posts: 35

Post Re: Getting started with 24x7 Java API Reply with quote

I did add it to the classpath (Environment variables --> classpath) but it gave aerror...now I compiled and executed the java files from command line by redifining the classpath there..it seemed to have taken it. Thanks anyways...though I wonder whats going on?
Is this all I have to do to create a new Job folder?
"//Creating a new Job folder

StringHolder buffer = new StringHolder("");

Integer retCode = obj.createFolder( "Weekly Payroll", "Store payroll related jobs in this folder", buffer);

if (retCode.intValue() != 1)

/* Print error */ System.out.println(obj.getLastError());

else

System.out.println("Weekly Payroll folder id is " + buffer);"

This gives a compilation error:

C:\Program Files\24x7_Scheduler\TrialScheduler.java:33: createFolder(java.lang.String,java.lang.String,com.sybase.dpb.IntegerHolder) in com.softtreetech.scheduler.j24x7 cannot be applied to (java.lang.String,java.lang.String,com.sybase.dpb.StringHolder)

Integer retCode = TJScheduler.createFolder( "Weekly Payroll", "Store payroll related jobs in this folder", buffer);

^
Could you please tell me what is wrong? (I have opened a session with an instance of the scheduler)

: Looks like it cannot find classes in com.sybase.dpb.* which still makes me
: think that either JDPB24x7.jar or jgl3.1.0.jar are not in the path or
: cannot be found by JVM. Are you adding these files to the class-path when
: running the program or only when compiling it?

Tue Jun 21, 2005 2:54 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Re: Getting started with 24x7 Java API Reply with quote

Last parameter must be defined is an IntegerHolder not a StringHolder. See the docs.
This parameter accepts folder id if createFolder() succeeds.

PS. You can but you don't have to redifine the global CLASSPATH variable. You can simply add the required JAR and class files to the command line using the standard classpath parameter.

: I did add it to the classpath (Environment variables --> classpath) but it
: gave aerror...now I compiled and executed the java files from command line
: by redifining the classpath there..it seemed to have taken it. Thanks
: anyways...though I wonder whats going on?
: Is this all I have to do to create a new Job folder?
: "//Creating a new Job folder

: StringHolder buffer = new StringHolder("");

: Integer retCode = obj.createFolder( "Weekly Payroll", "Store
: payroll related jobs in this folder", buffer);

: if (retCode.intValue() != 1)

: /* Print error */ System.out.println(obj.getLastError());

: else

: System.out.println("Weekly Payroll folder id is " + buffer);"

: This gives a compilation error: C:\Program
: Files\24x7_Scheduler\TrialScheduler.java:33:
: createFolder(java.lang.String,java.lang.String,com.sybase.dpb.IntegerHolder)
: in com.softtreetech.scheduler.j24x7 cannot be applied to
: (java.lang.String,java.lang.String,com.sybase.dpb.StringHolder)

: Integer retCode = TJScheduler.createFolder( "Weekly Payroll",
: "Store payroll related jobs in this folder", buffer);

: ^
: Could you please tell me what is wrong? (I have opened a session with an
: instance of the scheduler)

Tue Jun 21, 2005 3:12 pm View user's profile Send private message
TJ



Joined: 21 Jun 2005
Posts: 35

Post Re: Getting started with 24x7 Java API Reply with quote

Thankyou for the response but please note that there is an error in your documentation. The example gives it as Stringholder instead of Integer hoder.

: Last parameter must be defined is an IntegerHolder not a StringHolder. See
: the docs.
: This parameter accepts folder id if createFolder() succeeds.

: PS. You can but you don't have to redifine the global CLASSPATH variable. You
: can simply add the required JAR and class files to the command line using
: the standard classpath parameter.

Tue Jun 21, 2005 3:34 pm View user's profile Send private message
TJ



Joined: 21 Jun 2005
Posts: 35

Post Re: Getting started with 24x7 Java API Reply with quote

Thankyou for all the assistance and so sorry about proloning this but I still have errors:

One I open the socket and try to create a new folder, this is the error that I get :

IOException while running socketReader: java.io.EOFException
java.io.EOFException

at java.io.DataInputStream.readInt(DataInputStream.java:358)

at com.sybase.dpb.AsyncSocketReader.run(AsyncSocketReader.java:41)
IOException in sendMessage(): java.net.SocketException: Software caused connecti
on abort: socket write error
java.net.SocketException: Software caused connection abort: socket write error

at java.net.SocketOutputStream.socketWrite0(Native Method)

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

at java.net.SocketOutputStream.write(SocketOutputStream.java:115)

at java.io.DataOutputStream.writeInt(DataOutputStream.java:183)

at com.sybase.dpb.JDPB_Connection.sendMessage(JDPB_Connection.java:603)

at com.sybase.dpb.JDPB_Connection.connect(JDPB_Connection.java:444)

at com.sybase.dpb.JDPB_Connection.connect(JDPB_Connection.java:324)

at com.softtreetech.scheduler.j24x7.openSession(j24x7.java:250)

at TrialScheduler.main(TrialScheduler.java:28)
IOException in sendMessage(): java.net.SocketException: Software caused connecti
on abort: socket write error
java.net.SocketException: Software caused connection abort: socket write error

at java.net.SocketOutputStream.socketWrite0(Native Method)

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

at java.io.DataOutputStream.write(DataOutputStream.java:90)

at com.sybase.dpb.JDPB_Connection.sendMessage(JDPB_Connection.java:616)

at com.sybase.dpb.JDPB_Connection.connect(JDPB_Connection.java:444)

at com.sybase.dpb.JDPB_Connection.connect(JDPB_Connection.java:324)

at com.softtreetech.scheduler.j24x7.openSession(j24x7.java:250)

at TrialScheduler.main(TrialScheduler.java:28)

is the port blocked?

: Thankyou for the response but please note that there is an error in your
: documentation. The example gives it as Stringholder instead of Integer
: hoder.

Tue Jun 21, 2005 3:59 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Re: Getting started with 24x7 Java API Reply with quote

Hm, never seen such error before. Quick Google search turned up the follwoing results:

http://www.google.com/search?hl=en&lr=&biw=1004&q=java.net.SocketException%3A+Software+caused+connection+abort+socket+write+error

It seems to be a problem on the server side or incopatible JDK/JRE versions used on the client (your rpogram) and server (24x7 scheduler). Do you you se them JDK/JRE or different? Do you connect to local or remote server? Does it cause the scheduler to crash? Can you connect to the scheduler after receiving this error.

: Thankyou for all the assistance and so sorry about proloning this but I still
: have errors: One I open the socket and try to create a new folder, this is
: the error that I get : IOException while running socketReader:
: java.io.EOFException
: java.io.EOFException

: at java.io.DataInputStream.readInt(DataInputStream.java:358)

: at com.sybase.dpb.AsyncSocketReader.run(AsyncSocketReader.java:41)
: IOException in sendMessage(): java.net.SocketException: Software caused
: connecti
: on abort: socket write error
: java.net.SocketException: Software caused connection abort: socket write
: error

: at java.net.SocketOutputStream.socketWrite0(Native Method)

: at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

: at java.net.SocketOutputStream.write(SocketOutputStream.java:115)

: at java.io.DataOutputStream.writeInt(DataOutputStream.java:183)

: at com.sybase.dpb.JDPB_Connection.sendMessage(JDPB_Connection.java:603)

: at com.sybase.dpb.JDPB_Connection.connect(JDPB_Connection.java:444)

: at com.sybase.dpb.JDPB_Connection.connect(JDPB_Connection.java:324)

: at com.softtreetech.scheduler.j24x7.openSession(j24x7.java:250)

: at TrialScheduler.main(TrialScheduler.java:28)
: IOException in sendMessage(): java.net.SocketException: Software caused
: connecti
: on abort: socket write error
: java.net.SocketException: Software caused connection abort: socket write
: error

: at java.net.SocketOutputStream.socketWrite0(Native Method)

: at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

: at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

: at java.io.DataOutputStream.write(DataOutputStream.java:90)

: at com.sybase.dpb.JDPB_Connection.sendMessage(JDPB_Connection.java:616)

: at com.sybase.dpb.JDPB_Connection.connect(JDPB_Connection.java:444)

: at com.sybase.dpb.JDPB_Connection.connect(JDPB_Connection.java:324)

: at com.softtreetech.scheduler.j24x7.openSession(j24x7.java:250)

: at TrialScheduler.main(TrialScheduler.java:28)

: is the port blocked?

Tue Jun 21, 2005 4:09 pm View user's profile Send private message
TJ



Joined: 21 Jun 2005
Posts: 35

Post Re: Getting started with 24x7 Java API Reply with quote

See the scenario is like this:
I have a scheduler in master mode executing on my machine and I am writing a program to connect to this scheduler locally and create a Job folder.
I Just bought the latest version of your scheduler, the Java edition.
I am using jdk1.5.0_03 and I don't know what JDK version ur latest 24x7 scheduler, Java edition uses.

The scheduler doesn't crash...I can operate on the sceduler after this error occurs too.

: Hm, never seen such error before. Quick Google search turned up the follwoing
: results:
: http://www.google.com/search?hl=en&lr=&biw=1004&q=java.net.SocketException
: %3A+Software+caused+connection+abort+socket+write+error

: It seems to be a problem on the server side or incopatible JDK/JRE versions
: used on the client (your rpogram) and server (24x7 scheduler). Do you you
: se them JDK/JRE or different? Do you connect to local or remote server?
: Does it cause the scheduler to crash? Can you connect to the scheduler
: after receiving this error.

Tue Jun 21, 2005 4:47 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Re: Getting started with 24x7 Java API Reply with quote

The scheduler uses JDK/JRE specified by your JAVA_HOME environment variable. Please make sure you use the same version for both your program and 24x7 Scheduler. Try restarting the scheduler and see it that helps.

: See the scenario is like this: I have a scheduler in master mode executing on
: my machine and I am writing a program to connect to this scheduler locally
: and create a Job folder.
: I Just bought the latest version of your scheduler, the Java edition.
: I am using jdk1.5.0_03 and I don't know what JDK version ur latest 24x7
: scheduler, Java edition uses.

: The scheduler doesn't crash...I can operate on the sceduler after this error
: occurs too.

Tue Jun 21, 2005 5:14 pm View user's profile Send private message
TJ



Joined: 21 Jun 2005
Posts: 35

Post Re: Getting started with 24x7 Java API Reply with quote

JDK for both are the same!
Well I did do the golden rule of restart a couple of times..doesn't work. Could you suggest any other port number?

: The scheduler uses JDK/JRE specified by your JAVA_HOME environment variable.
: Please make sure you use the same version for both your program and 24x7
: Scheduler. Try restarting the scheduler and see it that helps.

Tue Jun 21, 2005 5:22 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Re: Getting started with 24x7 Java API Reply with quote

Why are you asking about a port number? You should be specifying the same port number that you have in the scheduler settings for the remote control. The default number is 1097 by the way.

: JDK for both are the same!
: Well I did do the golden rule of restart a couple of times..doesn't work.
: Could you suggest any other port number?

Tue Jun 21, 2005 5:35 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.