CMDBuild Forum

Cmdbuild on resin?

Will cmdbuild run on resin?

 

--

Ståle

CMDBuild is currently certified to work with Apache Tomcat 6 and 7. We have never tried it with Resin, and we don’t know that environment enough to test it properly. You will need two libraries not included in the war:

Some time ago I tried running CMDBuild on Eclipse Jetty and there were a few issues, but I had no time to fix them. It shouldn't be too difficult since, as I recall, we don't rely on any specific Tomcat feature anymore.
 
Paolo
 

I have now tried to make Cmdbuild run on Resin, with the help of my colleagues who are more skilled

in the world of web applications. According to them, it seems that Cmdbuild tries to use some

extentions to the DataSource-standard that are Tomcat specific.  Do you know if this is the case? If so, is it possible to use the more vanilla DataSource-standard.

 

Apparently both Resin and Tomcat have implemented additional functionality to the DataSource thingy, presumably to make things faster.

 

Does this make sense? Disclaimer: This is not my field of expertise, and I'm basically just guessing here

 

--

Ståle

 

You are probably referring to the context.xml file, where we use org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory. That should be included in the tomcat-dbcp.jar library (see my previous post), and it should not depend on other Tomcat libraries, thus it should be added to the Resin classpath without doing any damage.

 
Paolo
 
P.S.
We use the BasicDataSourceFactory in the org.cmdbuild.services.DBService class only, and we cannot use the javax.sql.DataSource interface to fetch database URL, username and password from the database.properties file.
 

OK, so we can use the tomcat-dbcp.jar on resin. Should it go in the WEB-INF/lib or somewhere more global? What is then the proper place to put the database parameters?

 

cmdbuild/conf/cmdbuild-jdbc.conf (our current option)

cmdbuild/conf/database.properties

cmdbuild/cmdbuild-1/cmdbuild/WEB-INF/database.properties

cmdbuild/cmdbuild-1/cmdbuild/WEB-INF/database.conf

AFAIK it should be put outside the web application, just like the PostgresSQL driver.

 
When you start CMDBuild for the first time, you should see the configuration wizard. The "existing database" option will configure the WEB-INF/conf/database.conf file in the webapp directory. Of course you can do it by yourself as well without the Web interface.
 
Paolo
 

OK, will try different options.

 

As I mentioned in another discussion on this forum, we have not managed to use the wizard to use our existing database. Maybe this was because the database was empty, as you said, and not already populated. Our logs said that Cmdbuild always used the user «postgres», instead of our own user. Could it be a bug?

The "existing database" expects a CMDBuild database, and not an empty database (as from the other post you mentioned). Of course we could add other options in the wizard, like "existing empty database" but it's not planned at the moment. As for usual, the software is open source and we are open to external contributions if that is an issue in your organization. Otherwise, among other services, Tecnoteca (CMDBuild's maintainer) offers feature implementation services. For short, you can code the feature you are interested in and contribute to the project, wait for it to be included in a future release, or pay us to implement it and see it in the next release.
 
It's very unlikely that there is such a bug: last time I'm quite positive that I checked to be sure. You can alter manually the database.conf file before you start CMDBuild and see what user it uses.
 
Paolo
 
I forgot that there is another configuration that you should probably change. The logger configuration (WEB-INF/conf/log4j.conf) uses the ${catalina.home} variable to store the logs in the Tomcat log directory.
 
Paolo

Tecnoteca ha scritto:

I forgot that there is another configuration that you should probably change. The logger configuration (WEB-INF/conf/log4j.conf) uses the ${catalina.home} variable to store the logs in the Tomcat log directory.
 
Paolo

 

resin-debug.log says

:

 

[2012-10-05 13:41:03.729] {main} java.lang.ClassCastException: com.caucho.sql.DBPool cannot be cast to org.apache.tomcat.dbcp.dbcp.BasicDataSource

 

The app is configured with:

 

<class-loader>

          <library-loader path="/www/var/data/cmdbuild/lib"/>

</class-loader>

 

which contains:

 

$ ls -l /www/var/data/cmdbuild/lib

-rw-r--r-- 1 resin w3-core 402906 2012-08-08 10:55 postgresql-8.1-407.jdbc3.jar

-rw-r--r-- 1 resin w3-core 197443 2012-08-08 10:57 tomcat-dbcp.jar

 

Any hints?

 

--

Ståle

I submitted a reply to this a couple of weeks ago, apparently it is still waiting for approval.

 

--

Ståle