| View previous topic :: View next topic |
| Author |
Message |
bolekovnik General User

Joined: 24 Jan 2006 Posts: 20
|
Posted: Mon Jun 11, 2007 5:52 am Post subject: NoClassDefFoundError Exception (Bootstrap) |
|
|
When I try to run the Servlet Example coming from the OpenOffice.org_2.2_SDK, then I receive the following Exception:
| Code: |
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: com/sun/star/comp/helper/Bootstrap
ConverterServlet.convertDocument(ConverterServlet.java:225)
ConverterServlet.doPost(ConverterServlet.java:132)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
|
Line 225 in the ConverterServlet.java is the following one:
| Code: |
XComponentContext xcomponentcontext = com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null);
|
I am using the Makefile which comes with the java example.
Any ideas why?
Thanks! |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3532 Location: Hamburg, Germany
|
|
| Back to top |
|
 |
bolekovnik General User

Joined: 24 Jan 2006 Posts: 20
|
Posted: Tue Jun 12, 2007 8:59 am Post subject: |
|
|
Thanks hol.sten for the reply,
I went through all your links a tried some of the test, which were described. I tried that one: http://www.oooforum.org/forum/viewtopic.phtml?t=19474&highlight=classpath and was surprised why it works only if you set the OOOLIBPATH while you are executing the .bat file???
My set's are as follow:
| Code: |
ALLUSERSPROFILE=C:\Documents and Settings\All Users
ANT_HOME=C:\java\ant
CLASSPATH=D:\SAPjco\sapjco.jar;C:\Program Files\OpenOffice.org 2.0\program\classes\juh.jar;C:\Program Files\OpenOffice.org 2.0\program\classes\jurt.jar;C:\Program Files\OpenOffice.org 2.0\program\clas
ses\ridl.jar;C:\Program Files\OpenOffice.org 2.0\program\classes\sandbox.jar;C:\Program Files\OpenOffice.org 2.0\program\classes\unoil.jar
ClusterLog=C:\WINDOWS\Cluster\cluster.log
CommonProgramFiles=C:\Program Files\Common Files
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
JAVAC=C:\java\j2sdk1.4.2_10\bin
JAVA_HOME=C:\java\j2sdk1.4.2_10
LOGONSERVER=\\ESTADDC1
NUMBER_OF_PROCESSORS=4
OFFICE_PROGRAM_PATH=C:\Program Files\OpenOffice.org 2.0\program
OO_HOME=C:\Program Files\OpenOffice.org 2.0
OO_LIB_PATH=C:\Program Files\OpenOffice.org 2.0\program\classes
OO_SDK_HOME=C:\Program Files\OpenOffice.org_2.2_SDK
OS=Windows_NT
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\ARIS70;D:\SAPjco;C:\java\j2sdk1.4.2_
10\bin;C:\java\ant\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0403
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=RDP-Tcp#1
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\DARIUS~1\LOCALS~1\Temp\1
TMP=C:\DOCUME~1\DARIUS~1\LOCALS~1\Temp\1
windir=C:\WINDOWS
|
OK, never the less, I am desparated trying to run my Servlet and it still not working? I saw in this Post: http://www.oooforum.org/forum/viewtopic.phtml?t=50715&highlight=servlet that you have to tell Tomcat where it can find the OpenOffice.org classes? I don't know where??? Can you tell me how to setup Tomcat so I can run my OOo Servlets?
Thanks! |
|
| Back to top |
|
 |
bolekovnik General User

Joined: 24 Jan 2006 Posts: 20
|
Posted: Tue Jun 12, 2007 9:04 am Post subject: |
|
|
I found this in the settings/std.mk file:
| Code: |
SDK_JAVA_UNO_BOOTSTRAP_FILES=\
-C $(CLASSES_DIR) $(SQM)com/sun/star/lib/loader/Loader.class$(SQM) \
-C $(CLASSES_DIR) $(SQM)com/sun/star/lib/loader/Loader$$CustomURLClassLoader.class$(SQM) \
-C $(CLASSES_DIR) $(SQM)com/sun/star/lib/loader/InstallationFinder.class$(SQM) \
-C $(CLASSES_DIR) $(SQM)com/sun/star/lib/loader/InstallationFinder$$StreamGobbler.class$(SQM) \
-C $(CLASSES_DIR) $(SQM)com/sun/star/lib/loader/WinRegKey.class$(SQM) \
-C $(CLASSES_DIR) $(SQM)com/sun/star/lib/loader/WinRegKeyException.class$(SQM) \
-C $(CLASSES_DIR) $(SQM)win/unowinreg.dll$(SQM)
|
Maybe all the loader classes are important for Tomcat??? |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3532 Location: Hamburg, Germany
|
|
| Back to top |
|
 |
bolekovnik General User

Joined: 24 Jan 2006 Posts: 20
|
Posted: Wed Jun 13, 2007 6:32 am Post subject: |
|
|
| Quote: | | You didn't look hard enough. Look again. I showed 2 tries. The first didn't work, the second worked. The .bat file of the second try contained this two lines: |
Maybe I should explain it better. I didn't say that your second try doesn't work, I just said that I am surprised that even if I set the OOLIBPATH already before in the System variables, I have to set it again in the batch file, so that the test app is running properly.
....
NUMBER_OF_PROCESSORS=4
OFFICE_PROGRAM_PATH=C:\Program Files\OpenOffice.org 2.0\program
OO_HOME=C:\Program Files\OpenOffice.org 2.0
OO_LIB_PATH=C:\Program Files\OpenOffice.org 2.0\program\classes
OO_SDK_HOME=C:\Program Files\OpenOffice.org_2.2_SDK
OS=Windows_NT
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\ARIS70;D:\SAPjco;C:\java\j2sdk1.4.2_
10\bin;C:\java\ant\bin
...
Anyway, regarding my servlet problem, I did put the jar files in the Tomcat directory as you said and now I am getting at least a different Exception:
| Code: |
Cause Exception: null
Message Exception: no office executable found!
com.sun.star.comp.helper.BootstrapException: no office executable found!
at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java:253)
at ODFServlet.runODF(ODFServlet.java:93)
at ODFServlet.doGet(ODFServlet.java:74)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
|
I put those jar files in the following directory: CATALINA_HOME/shared/lib.
Here is the test method I am trying to execute in my servlet for a better understanding:
| Code: |
public void runODF() throws IOException
{
com.sun.star.uno.XComponentContext xContext = null;
Runtime runtime = Runtime.getRuntime();
String path = "C:/Program Files/OpenOffice.org 2.0/program/soffice.exe";
runtime.exec( path );
try
{
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
if( xContext != null )
{
System.out.println("Connected to a running office ...");
} else {
System.out.println("Not connected to a running office ...");
}
xContext = null;
System.exit(0);
}
catch( Exception e )
{
System.err.println( "Cause Exception: "+e.getCause() );
System.err.println( "Message Exception: "+e.getMessage() );
e.printStackTrace();
System.exit(1);
}
}
|
|
|
| Back to top |
|
 |
bolekovnik General User

Joined: 24 Jan 2006 Posts: 20
|
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3532 Location: Hamburg, Germany
|
Posted: Wed Jun 13, 2007 8:58 am Post subject: |
|
|
| bolekovnik wrote: | | Quote: | | You didn't look hard enough. Look again. I showed 2 tries. The first didn't work, the second worked. The .bat file of the second try contained this two lines: |
Maybe I should explain it better. |
Maybe you should really look harder!
| bolekovnik wrote: | I just said that I am surprised that even if I set the OOLIBPATH already before in the System variables, I have to set it again in the batch file, so that the test app is running properly.
...
OO_LIB_PATH=C:\Program Files\OpenOffice.org 2.0\program\classes
... |
As I already told you, in my bat file one line defines OOOLIBPATH and uses that variable with %OOOLIBPATH% in the following line. I named that variable OOOLIBPATH with three O, three! Not two like OOLIBPATH as in your last post. And nothing with underscores like OO_LIB_PATH.
Ok, now again: OOOLIBPATH, OOLIBPATH, and OO_LIB_PATH are the names of three different variables! And you didn't set OOOLIBPATH in your environment so it has to be set in the bat file.
But anyway, even if you got it now, this doesn't solve your Tomcat problem!
| bolekovnik wrote: | Anyway, regarding my servlet problem, I did put the jar files in the Tomcat directory as you said and now I am getting at least a different Exception:
| Code: | ...
Message Exception: no office executable found! |
|
Which has already been discussed in this forum. And has been the topic of the first link I posted in my first reply in this thread for you!
| bolekovnik wrote: | | I put those jar files in the following directory: CATALINA_HOME/shared/lib. |
Which is in vain, if you're using the bootstrap connection mechanism!
| bolekovnik wrote: | Here is the test method I am trying to execute in my servlet for a better understanding:
| Code: | ...
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
... |
|
As far as I know this will not work in Tomcat.
So I repeat it for you for the last time in this thread: Use the older connection mechanism with Tomcat or use a Java application which is not running within Tomcat in conjunction with something like RMI. I don't provide any further links, because this thread already contains enough unread links... |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3532 Location: Hamburg, Germany
|
Posted: Wed Jun 13, 2007 9:01 am Post subject: |
|
|
Because you are ignoring my replies  |
|
| Back to top |
|
 |
bolekovnik General User

Joined: 24 Jan 2006 Posts: 20
|
Posted: Thu Jun 14, 2007 2:06 am Post subject: |
|
|
| Quote: | Because you are ignoring my replies |
I messed something up and that's why nothing is running.
Sorry for bothering you with the CLASSPATH and OOLIBPATH. I was confused about the names, but figured out, that it has to be OOLIBPATH and not SOMETHING_ELSE.
I need to reinstall my server anyway and will try out everything from scratch.
Thanks for your help! |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3532 Location: Hamburg, Germany
|
Posted: Thu Jun 14, 2007 8:21 am Post subject: |
|
|
| bolekovnik wrote: | | Quote: | Because you are ignoring my replies |
I messed something up and that's why nothing is running.
Sorry for bothering you with the CLASSPATH and OOLIBPATH. I was confused about the names, but figured out, that it has to be OOLIBPATH and not SOMETHING_ELSE. |
Thank you for your clarification
| bolekovnik wrote: | | I need to reinstall my server anyway and will try out everything from scratch. |
If you still try Tomcat, try the older connection mechanism and not the bootstrap connection mechanism. Although it seams that the bootstrap connection mechanism is easier to handle, it has some disadvantages as you can read in the various threads I posted here.
Regards
hol.sten |
|
| Back to top |
|
 |
|