Hello everybody,
I'm trying to run Docmosis in a web application with Glassfish on a linux server, but when I try to execute the line "SystemManager.initialise();", docmosis don't find the file docmosis.properties.
I developed the application on Windows and I have put docmosis.properties in the folder I have found when I make :
File file = new File("");
String path = file.getAbsolutePath();
It was on the folder : "glassfishInstall"\\domains\\domain1\\lib\\ext
Everythings worked great.
Now I'm trying to run this app on a linux server, I have try the same procedure and it appear not to be the same path, it was "glassfishInstall"/domains/domain1/config
I have try to put docmosis.properties and docmosisConverterPoolConfig.xml on this path :
"glassfishInstall"/domains/domain1/lib/ext
"glassfishInstall"/domains/domain1/config
"glassfishInstall"/domains/domain1/applications/"webApp"_war/web/WEB_INF/classes (directly in the projet into netbeans before deploy the application on the glassfish server)
and it was the same problem, docmosis couldn't find docmosis.properties.
Here is the error from the server.log of glassfish :
[#|2011-04-12T15:09:22.023+0200|WARNING|glassfishv3.0|com.docmosis.util.DMProperties|_ThreadID=31;_ThreadName=Thread-1;|Could not find docmosis.properties|#]
[#|2011-04-12T15:09:22.035+0200|INFO|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=31;_ThreadName=Thread-1;|INFO c
om.docmosis.SystemManager - Docmosis version [2.2.3_3415] initialising
|#]
[#|2011-04-12T15:09:22.036+0200|WARNING|glassfishv3.0|com.docmosis.util.DMProperties|_ThreadID=31;_ThreadName=Thread-1;|Could not find docmosis.properties|#]
[#|2011-04-12T15:09:22.055+0200|INFO|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=31;_ThreadName=Thread-1;|FATAL c
om.docmosis.document.converter.pool.ConverterPool - An error occurred initializing the converter pool
java.lang.IllegalStateException: There is no converter pool configuration specified. Make sure your docmosis.properties (or System properties) specifies "do
cmosis.document.converter.pool.config.resource"
at com.docmosis.document.converter.pool.ConverterPool.loadXMLConfig(line:498)
at com.docmosis.document.converter.pool.ConverterPool.(line:110)
at com.docmosis.document.converter.pool.ConverterPool.initialise(line:70)
at com.docmosis.SystemManager.initConverterPool(line:111)
at com.docmosis.SystemManager.initialise(line:51)
at stateless.document.DocumentSessionBean.initialize(DocumentSessionBean.java:110)
at stateless.document.DocumentSessionBean.recupererDocumentAbsenceEleve(DocumentSessionBean.java:133)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
Thank you for your replies !
Have a good day !
Hello RossierFl.
Are you deploying a war or an ear to Glassfish or are you building the file structure in domains/domain1 yourself? Assuming you are building a war/ear, you simply need to make sure you put these config files into the correct place and docmosis will find them. (for example in WEB-INF/classes).
Docmosis is simply looking for these files in the root of one of your classpath entries. Generally you wouldn't want to go dropping the files in different folders since that makes it a little harder to deploy. Please look at the following posts to see if you get the clues you need:
http://www.docmosis.com/content/bundling-jar-docmosis
http://www.docmosis.com/content/npe-systemmanagerinitialise
http://www.docmosis.com/node/109
Hello, thank you for your replies paulj.
I'm deploying an ear into Glassfish. I take this file on the dist directory of my projet when I make a clean and build on NetBeans...
I'll take a look of your link and come back if they are a problem
Thank you, Have a wonderfull day
Hello,
I have try to put docmosis.properties and docmosisConverterPoolConfig.xml into the folder WEB-INF/classses, and when I deploy it, the files are into the good folder when I look into the path of the application into Glassfish...
How can I find my classpath entries ? you said me docmosis is looking in the root of one of this classpath entries, I want to check it if they is a problem with this...
Can I configure a converter into the code? I have found how to put a properties with this line into Java :
System.setProperty("docmosis.openoffice.location","/usr/lib/openoffice");
and it works, but now if I make this for all properties into the docmosis.properties, it's the docmosisConverterPoolConfig.xml he doesn't found... If you know how to configure a converter into the code, I don't need any file... (I'm conscious if I make this I lost Multi-platform)...
Thank you, have a wonderfull day !
Hello RossierFl.
1) Classloading in application servers is non trivial to debug since they have custom classloaders to achieve the required flexibility. If you look at the Glassfish documentation it discusses how to load resources. By default things should be picked up from the WEB-INF/classes directory automatically. You should do some tests of using your own code to find resources:
a) put some code into your application to do this:
System.out.println(this.getClass().getResource("/a/b/gogo.txt"));
then deploy it
b) put a file in WEB-INF/classes/a/b/gogo.txt
c) make a call to your server so that it runs your code in a) and see if it finds gogo.txt
2) You can't set a system property to configure the converter pool. The setting of System properties for Docmosis to use is intended to allow overriding of configuration values but not specifying all configuration possibilities.
Hello modman, Thank you for your replies,
I have try your procedure but the line System.out.println(this.getClass().getResource("/a/b/gogo.txt")); return : ""INFO: null""
I think Glassfish don't load resource or not correctly, is this possible?
I have seen on the net when the web.xml is not on the version 2.3 Glassfish don't load the resource, I don't think it is possible but I have try with the version 2.5, there is always the same problem...
All the sample I have see use a WEB Application, I have a Enterprise Application with an EJB module (Java) and a WAR (the view), Do you know if the procedure is the same as a WEB Application ?
Thank you, Have a wonderfull day ...
Hello RossierFl.
Try deploy this code and running it:
System.out.println("GETTING CLASSLOADER Roots");
ClassLoader cl = getClass().getClassLoader();
try {
Enumeration urls = cl.getResources("/");
while(urls.hasMoreElements()) {
URL url = urls.nextElement();
System.out.println("Url = " + url.getPath());
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Hopefully it will show you all the root locations in the classloader used in the environment in which your code is running. You should see "...../WEB-INF/classes" among other things. Verify this is where you expect it to be.
Good luck.
Hello, Thank for the time you take for me !
I have try your code and this is the result :
Url = /opt/glassfishv3/glassfish/lib/install/applications/__cp_jdbc_ra/
Url = /opt/glassfishv3/glassfish/lib/install/applications/__xa_jdbc_ra/
Url = /opt/glassfishv3/glassfish/lib/install/applications/__dm_jdbc_ra/
Url = /opt/glassfishv3/glassfish/lib/install/applications/jmsra/
Url = /opt/glassfishv3/glassfish/domains/domain1/applications/GabiJavaFlexEE6/GabiJavaFlexEE6-ejb_jar/
Url = /opt/glassfishv3/glassfish/domains/domain1/generated/ejb/GabiJavaFlexEE6/GabiJavaFlexEE6-ejb_jar/
I have try to put docmosis.properties to each folder of the result but there is always the same problem...
Is there a file to configure into glassfish to configure the loading of resource, or a way to force glassfish to load a file?
I have no idea what I can make for this problem...
Thank, Have a good day
Hello RossierFl.
I think your EAR may simply not be structured as you need. Have a read about EAR file format - there's lots of information about it on the net. You have several options. You shouldn't need to copy the properties files in AFTER you deploy, your EAR should be build with the properties file in the correct location and when you deploy it they will be available to your application. It might be simplest if you try this:
- change your build script to create a WAR file with a WEB-INF directory containing classes, lib and web.xml.
- make your build script put this inside your EAR
- deploy the EAR again
- run the same tests as you have been doing...
Good luck.
Hello RossierFl,
I try to run Docmosis server on Ubuntu 10.04 LTS 64bits with OpenOffice et Java 64bits. I try to install different versions of Java. I never get thru.
I installed the Ubuntu 11.04 64bits with standard OpenOffice with apt-get. At the first try, everything worked perfect.
Just migrate....
Hello Pamestla.
Thankyou for taking the time to share your success with the Docmosis Community. It all helps.
