OpenESignForms / openesignforms

Open eSignForms is the first open source SaaS web contracting platform
https://open.esignforms.com
107 stars 50 forks source link

Errors when runing from compiled WAR package on JBoss #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile code for JBoss WAR package.
2. Run package.
3.

What is the expected output? What do you see instead?
I expect the application to sucessfully start and run.  Instead I get some 
error messages about accessing .properties files.

ERROR (OpenESignForms) Exception: null - Could not load openesignforms 
properties file: openesignforms:

ERROR (com.esignforms.open.db.ConnectionPools) Failed to read/parse 
connectionpools.properties file 'connection pools'

What version of the product are you using? On what operating system?
Downloaded the latest .zip file Version 13.6.8 - 8 June 2013.

Please provide any additional information below.

There seems to be a portable method to reading the .properties files that will 
work.
https://community.jboss.org/thread/202208?_sscc=t

Original issue reported on code.google.com by yap...@gmail.com on 28 Jul 2013 at 6:46

GoogleCodeExporter commented 9 years ago
Unfortunately, we do not use JBoss, nor do we deploy using EAR or WAR files.  
Any changes we make would be untested here, so we'd need some recommendation on 
the desired change to be made.

We load .properties files using 
java.util.ResourceBundle.getBundle("propertyfilename") as seen in 
com.esignforms.open.config.PropertiesFile.java -- which allows for 
localization. If you have a suggested change that you can show works for you 
and will continue to work for us, we'll be happy to include it.  Like I wonder 
if using java.util.PropertyResourceBundle.getBundle() would work on JBoss.  

According to https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7, 
"The war is considered to be a single module, so classes defined in WEB-INF/lib 
are treated the same as classes in WEB-INF/classes. All classes packaged in the 
war will be loaded with the same class loader."  So I'm not sure why your WAR 
would not find files in WEB-INF/classes.  It seems there may be configuration 
you can set if you are using an EAR, but again, this is not how we've packaged 
the code and we have no expertise there.

Original comment by yoz...@gmail.com on 28 Jul 2013 at 7:28

GoogleCodeExporter commented 9 years ago
From Justin:

Looks like the files need to be in a different location for JBoss?

http://blog.moove-it.com/accessing-custom-properties-from-jboss-as/

Maybe this can be used, but it sounds wrong to unless it's webapp-specific 
since all that's really needed is for JBoss to include WEB-INF/classes in the 
classpath before WEB-INF/lib:

One of them is the “config” folder into the server domain. eg. 
“server/default/conf”

We're going to mark this as 'wont fix', but if you have more information on 
something we need to change, even if it's just some documentation in the wiki, 
let us know and we can re-open and make the changes.

If it turns out that those property files in the JAR are being found before the 
ones in the classes folder, we can consider not including those in the JAR as 
they really are expected to be tuned for each webapp deployed.  It does seem 
that Tomcat does this in a sensible way, looking at WEB-INF/classes first, but 
it doesn't seem to be required for a container to be sensible!  It does seem 
that JBoss ignores WEB-INF/classes entirely, but I don't fully get it since it 
also seems to use Tomcat which does.

Tomcat 7 seems to suggest classes are searched first per the servlet spec, but 
I'm not sure if that's true or not, though it is what we want:
http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html

But the JBoss EAP 6 docs seem to suggest it does look in classes, though it's 
not clear it's searched before the lib:
https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_
Platform/6.1/html/Development_Guide/chap-Class_Loading_and_Modules.html#Overview
_of_Class_Loading_and_Modules-1

Anyway, we have no way to investigate this further, so we'll await an 
answer/response from some who can figure it out!

Original comment by yoz...@gmail.com on 29 Jul 2013 at 10:18