Unable to start JasperReports Server on Linux Ubuntu (Tomcat7 and MySQL 5.5)

Hi,

I've installed JasperReports Server from the WAR file distribution jasperreports-server-cp-5.0.0-bin.zip on Ubuntu running Tomcat7 and MySQL 5.5.29.

I had to override the instructions of installation (annex A.8.5) about the settings in default-master.properties:

 

# Tomcat app server root dir
# appServerDir = C:\\Program Files\\Apache Software Foundation\\Tomcat 7.0
appServerDir = /var/lib/tomcat7
# if linux package managed tomcat instance, set two properties below
CATALINA_HOME = /usr/share/tomcat7
CATALINA_BASE = /var/lib/tomcat7
 
It seems to be ok. The installation is going well, with OK. The databases are created...
I found a directory jasperserver in /var/lib/tomcat7/webapps/jasperserver
 
But I can't start Jasperserver: there is not ctrlscript.sh (nowhere !).
I went to Tomcat page (localhost:8080) and to the Manager (localhost:8080/manager).
The manager finds jasperserver but when I hit the button "Start" it says (in French) : L'application pour le chemin de contexte /jasperserver n'a pas pu être démarrée (i.e. : Unable to start the application for context path /jasperserver, or something like that).
If I go to localhost:8080/jasperserver, I receive an error message HTTP Status 404 (the requested resource is not available).
 
What can I do ?
 
Thanks.
 
Rémi

 

ideo's picture
37
Joined: Jan 25 2013 - 1:20am
Last seen: 10 years 1 month ago
does the tomcat log file indicate some errors, like db not available? have there ben any errors during the installation?
mrcaffeine - 10 years 1 month ago
Thanks for your comment. Please see my answer below. Rémi
ideo - 10 years 1 month ago
I have the same problem using tomcat 6.0.35 on osx (macports tomcat) with PostgreSQL. My other webapps are working. I've "heard" (using google) that tomcat-dbcp.jar is out of date, that tomcat is supposed to use commons-dbcp.jar instead. If I try to copy tomcat-dbcp.jar into the lib directory it breaks my other webapps.
jabraham - 10 years 1 month ago

4 Answers:

[Answer to mrcaffeine:]

- No errors during the installation.

- /var/log/tomcat7/catalina.[date].log :

 

Jan 26, 2013 7:43:39 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.tonbeller.com/jpivot/core is already defined
Jan 26, 2013 7:43:39 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined
Jan 26, 2013 7:43:39 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined
Jan 26, 2013 7:43:39 AM org.apache.catalina.core.NamingContextListener addResource
WARNING: Failed to register in JMX: javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]
Jan 26, 2013 7:43:39 AM org.apache.catalina.core.NamingContextListener addResource
WARNING: Failed to register in JMX: javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]
Jan 26, 2013 7:43:39 AM org.apache.catalina.core.NamingContextListener addResource
WARNING: Failed to register in JMX: javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]
Jan 26, 2013 7:43:49 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Jan 26, 2013 7:43:49 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/jasperserver] startup failed due to previous errors
Jan 26, 2013 7:43:49 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/jasperserver] appears to have started a thread named [Thread-8] but has failed to stop it. This is very likely to create a memory leak.
 
- /var/log/tomcat7/localhost.[date].log : a long text full or messages I don't understand
Jan 26, 2013 7:43:19 AM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
Jan 26, 2013 7:43:24 AM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: start: Starting web application '/jasperserver'
Jan 26, 2013 7:43:39 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jan 26, 2013 7:43:39 AM org.apache.catalina.core.ApplicationContext log
INFO: Set web app root system property: 'jasperserver.root' = [/var/lib/tomcat7/webapps/jasperserver/]
Jan 26, 2013 7:43:39 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing log4j from [/var/lib/tomcat7/webapps/jasperserver/WEB-INF/log4j.properties]
Jan 26, 2013 7:43:39 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 26, 2013 7:43:49 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'themeSource' defined in ServletContext resource [/WEB-INF/applicationContext-themes.xml]: Cannot resolve reference to bean 'themeCache' while setting bean property 'themeCache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'themeCache' defined in ServletContext resource [/WEB-INF/applicationContext-themes.xml]: Cannot resolve reference to bean 'unsecureRepositoryService' while setting bean property 'repositoryService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateRepositoryService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'accessContext' while setting bean property 'accessContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accessContext' defined in ServletContext resource [/WEB-INF/applicationContext-events-logging.xml]: Cannot resolve reference to bean 'loggingContextProvider' while setting bean property 'loggingContextProvider'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loggingContextProvider' defined in ServletContext resource [/WEB-INF/applicationContext-events-logging.xml]: Cannot resolve reference to bean 'loggingEventsService' while setting bean property 'loggingService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loggingEventsService' defined in ServletContext resource [/WEB-INF/applicationContext-events-logging.xml]: Cannot resolve reference to bean 'accessService' while setting bean property 'routingMap' with key [TypedStringValue: value [com.jaspersoft.jasperserver.api.logging.access.domain.AccessEvent], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accessService' defined in ServletContext resource [/WEB-INF/applicationContext-events-logging.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext-webapp.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Could not create resource factory instance [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]
 
(It's only the first lines...)
 
I've noticed this line:

INFO: Set web app root system property: 'jasperserver.root' = [/var/lib/tomcat7/webapps/jasperserver/]

How do I set the "web app root system property" ?

And it seems to be a problem with ClassPath...

Any idea how to find my way?

 

Thanks,

 

Rémi

ideo's picture
37
Joined: Jan 25 2013 - 1:20am
Last seen: 10 years 1 month ago

There seems to be something wrong with the tomcat setup.

The class not found is a tomcat class:   org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory

It is used for the tomcat's connection pooling. And the jasperserver webapp uses the connection that tomcat provides.

Two things to check would be the following:

  /conf/Catalina/Localhost/jasperserver.xml

    (take a look inside this file and see if the database credentials and url look good)

    (you can delete the file above and tomcat will put a fresh in in place)

  The file above is copied (by tomcat) from this location (this is a kind of dumb tomcat thing)

   /webapps/jasperserver/META-INF/context.xml

Also, check:

  /lib

   (make sure that you see a JDBC driver in there from postrgresql)

Here is a list of jars from my apache-tomcat-6.0.35/lib

annotations-api.jar
catalina-ant.jar
catalina-ha.jar
catalina.jar
catalina-tribes.jar
ecj-3.7.jar
el-api.jar
jasper-el.jar
jasper.jar
jsp-api.jar
postgresql-9.0-801.jdbc4.jar
servlet-api.jar
tomcat-coyote.jar
tomcat-dbcp.jar
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
tomcat-i18n-ja.jar

Notice >> tomcat-dbcp.jar

Needs to be in place.

tkavanagh's picture
14400
Joined: Jul 7 2006 - 8:54am
Last seen: 8 years 6 months ago

Same problem. I tried dropping tomcat-dbcp.jar into my lib directory, but it broke another webapp. Apparently tomcat apps are supposed to use commons-dbcp now, not tomcat-dbcp, or that's what I read on the Internets.

I'll keep looking, but something is broken.

I'm using tomcat 6.0.35 from macports.

jabraham - 10 years 1 month ago

Here is a tomcat bug about missing dbcp jar:

https://bugs.launchpad.net/ubuntu/+source/tomcat6/+bug/283852

Maybe similar issue?

tkavanagh's picture
14400
Joined: Jul 7 2006 - 8:54am
Last seen: 8 years 6 months ago

Thanks a lot, folks!

It works! I had only to put tomcat-dbcp.jar into /usr/share/tomcat7/lib/

Rémi

ideo's picture
37
Joined: Jan 25 2013 - 1:20am
Last seen: 10 years 1 month ago
Feedback
randomness