Quoting Tom Schindl <[EMAIL PROTECTED]>:
Erik Zühlke schrieb:
That seems to be probably the problem, how I come now to the files of
openoffice? A delivery with “java - cp <OpenOffice> \ program \ classes
^^^^^^^^^
Do you noticed the space between - cp I think it should read -cp but I
think that's only a c&p-Error.
This comes from my "copy and paste" action, i use the google
translation. Sorry.
Her are more information over my appclication.
The storage structure was...
c:\sgv
c:\sgv\dokumente\.. (generated documents)
c:\sgv\oov\.. (templates)
c:\sgv\libs\.. (ext libs)
c:\sgv\mysql5\.. (the DBMS)
c:\sgv\setup\.. (installer, scripts etc.)
c:\sgv\sgv.conf (properties)
c:\sgv\Starter.exe (a exe Starter)
c:\sgv\Starter.jar (the aplication)
---------------------
under Eclipse i use the OOo librarys (.jar) directly from ...
c:\Programme\OpenOffice2\program\classes
---------------------
SGV.jar (Starter.jar)
main()
...
(Prepartion initialize/create BO, SWT, mySQL Connection and other)
...
display = new Display();
shell = new Shell(display);
shell.setText("SGV : " + firma + " " + version);
shell.setMaximized(true);
shell.setBackground(new Color(display, 160, 160, 255));
GridLayout shellGL = new GridLayout();
shell.setLayout(shellGL);
shell.setMenuBar(new MainMenue(shell).getMenu());
new MainComp(shell,zHoehe,zWeite); // with Stacklayout
shell.pack();
shell.open();
ControllerOOo.initViewOOo();
....
-----------------
ControllerOOo.jar
....
public static void initViewOOo(){
String pfadOOo = "C:\\Programme\\OpenOffice2";
try {
myBeanFacade = new BeanFacade();
myBeanFacade.launchOOo(new File(pfadOOo));
myBeanId =
myBeanFacade.createBean("private:factory/swriter",comp); // comp =
Container Stacklayout
} catch (IOException e) {
// TODO Automatisch erstellter Catch-Block
e.printStackTrace();
} catch (Exception e) {
// TODO Automatisch erstellter Catch-Block
e.printStackTrace();
}
}
....
------------------
BeanFacade.jar
....
public void launchOOo(File aOOoPath) throws IOException {
String sep = System.getProperty("file.separator");
String sofficepath = aOOoPath.getAbsolutePath() +
sep + "program" + sep + "soffice.exe";
File soffice = new File(sofficepath);
if (soffice.canRead() && soffice.isFile()) {
String user = System.getProperty("user.name");
// String params = "-bean -accept=pipe,name=" + user +
// "_Office;urp;StarOffice.NamingService";
String params = "-bean -nologo -nodefault -norestore " +
"-accept=pipe,name=\"" + user + "_Office\"" +
";urp;StarOffice.NamingService";
__oooProcess =
Runtime.getRuntime().exec(soffice.getAbsolutePath() + " " + params);
} else {
throw new IOException("No soffice executable found");
}
}
public int createBean(String aUrl, Composite parent) throws Exception {
Frame frame = SWT_AWT.new_Frame(parent);
Panel panel = new Panel(new BorderLayout());
frame.add(panel);
JRootPane root = new JRootPane();
panel.add(root);
Container contentPane = root.getContentPane();
OOoBean bean = new OOoBean();
contentPane.add(bean);
bean.loadFromURL(aUrl, null);
int id = __beanMap.size() - 1;
__beanMap.put(Integer.valueOf(id), bean);
return id;
}
---------------------
Manifest-Version: 1.0
Sealed: false
Class-Path: ./libs/mysql-connector-java-3.1.12-bin.jar ./libs/swt.jar
Main-Class: de.zuehlke_it.sgv.SGV
---------------------
my windows environement
...
Path=C:\WINDOWS\system32;C:\WINDOWS\System32\Wbem;D:\dev-java\jre1.5\bin;D:\dev-database\mysql5\bin;c:\Programme\OpenOffice2\program;c:Programme\OpenOffice2\program\classes
...
(under jvm / java...)
java.library.path=C:\WINDOWS\system32;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS\System32\Wbem;D:\dev-java\jre1.5\bin;D:\dev-database\mysql5\bin;c:\Programme\OpenOffice2\program;c:Programme\OpenOffice2\program\classes
----------------------
Under this configuration i make an export from eclipse (under eclipse
i can start the application, i can, but i must not use
BeanFacade.launchOOo(new File(pfadOOo)), in my Stacklayout container i
have OpenOffice!!);
After the export i start the appclication with "java -verbose -jar
Starter.jar".
This was the result...
....
[Loaded de.zuehlke_it.sgv.view.ooo.IBeanFacade from
file:/C:/sgv/Starter.jar]
[Loaded de.zuehlke_it.sgv.view.ooo.BeanFacade from
file:/C:/sgv/Starter.jar]
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/star/comp/beans/NoConnectionException
at
de.zuehlke_it.sgv.view.ooo.ControllerOOo.initViewOOo(ControllerOOo.java:34)
at de.zuehlke_it.sgv.SGV.main(SGV.java:180)
Ok my next try was this "java -verbose -cp
c:\Programme\OpenOffice2\program\classes\officebean.jar -jar
Starter.jar"
I become the same result!
And the next try (ups, i take a "trail and errror" way...)
I make "SET CLASSPATH=C:\Programme\OpenOffice2\program\classes" and i
start the application with "java -verbose -jar Starter.jar", with the
...same... result.
Ok, ok give me a last change...
I make copy from the officebean.jar in my "./libs" and modify my
MANIFEST.MF and export another from eclipse.
("Class-Path: ./libs/officebean.jar
./libs/mysql-connector-java-3.1.12-bin.jar ./libs/swt.jar" in
MANIFEST.MF
Ups, a differend error was follows.
[Loaded sun.awt.NullComponentPeer from D:\dev-java\jre1.5\lib\rt.jar]
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/star/lang/WrappedTargetException
at
de.zuehlke_it.sgv.view.ooo.BeanFacade.createBean(BeanFacade.java:76)
at
de.zuehlke_it.sgv.view.ooo.ControllerOOo.initViewOOo(ControllerOOo.java:36)
at de.zuehlke_it.sgv.SGV.main(SGV.java:180)
On this point my story was stoppd, i can understand what eclipse make
to connect OpenOffic and what i MUST make to integrated (clean) the
OpenOffice Bean.
Reagards...
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]