Hello,
After following instructions for OpenKM-6.3.0 installation, I get a 404 - requested resource not availble error from Tomcat, while attempting to access the URL http://localhost:8080/OpenKM/.
My sense is that my environment differs enough from the documented deployment environments that I should ask for help.
Please note that I am deploying the application independent of any IDE (eg Eclispe) and to a server with an existing instance of Tomcat.
Please also note that the existing Tomcat installation uses Oracle Java JDK 7 rather than OpenJDK 7.
Lastly please also note that I lack familiarity with JBoss and am confused about whether I need to somehow implement the JBoss framework or parts of it.
Server Details
First and foremost I had to download the latest log4j-x.x.xx.jar and copy it to /WEB-INF/lib.
Next, I had to find and remove all references to specific versions of spring schemaLocations. For example, I had to change declarations like
/var/lib/tomcat7/webapps/OpenKM/WEB-INF
Add log4j Listener - also created the logging.properites file referenced (see below)
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/web.xml
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/web.xml
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/classes/hibernate.cfg.xml
Add bean for JNDI dataSource - dataSource is declared as Tomcat GlobalNamingResource
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/applicationContext.xml
/usr/share/tomcat7/conf/server.xml
/usr/share/tomcat7/conf/server.xml
Thank you in advance for your help.
After following instructions for OpenKM-6.3.0 installation, I get a 404 - requested resource not availble error from Tomcat, while attempting to access the URL http://localhost:8080/OpenKM/.
My sense is that my environment differs enough from the documented deployment environments that I should ask for help.
Please note that I am deploying the application independent of any IDE (eg Eclispe) and to a server with an existing instance of Tomcat.
Please also note that the existing Tomcat installation uses Oracle Java JDK 7 rather than OpenJDK 7.
Lastly please also note that I lack familiarity with JBoss and am confused about whether I need to somehow implement the JBoss framework or parts of it.
Server Details
- Ubuntu Linux 12.04
Apache Tomcat 7
Oracle Java JDK 7
First and foremost I had to download the latest log4j-x.x.xx.jar and copy it to /WEB-INF/lib.
Next, I had to find and remove all references to specific versions of spring schemaLocations. For example, I had to change declarations like
Code: Select all
toxsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3-x.xsd
Code: Select all
Then, I had to find and remove all references to specific versions of javaee, in particular in the XML documents' web-app declaration. For example, the resulting xmlns declaration in web.xml looks like:xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
/var/lib/tomcat7/webapps/OpenKM/WEB-INF
Code: Select all
Next I made the following sets of changes to configuration files.<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
Add log4j Listener - also created the logging.properites file referenced (see below)
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/web.xml
Code: Select all
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/classes/logging.properties
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/logging.properties</param-value>
</context-param>
Code: Select all
Change reference to OpenKM.xml to use hard-link relative to directory rather than $file variable.# Set the root logger to DEBUG.
log4j.rootLogger=DEBUG
# MonitorLog - used to log messages in the Monitor.log file.
log4j.appender.MonitorAppender=org.apache.log4j.FileAppender
log4j.appender.MonitorAppender.File=${catalina.home}/logs/MonitorLog.log
log4j.appender.MonitorAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.MonitorAppender.layout.ConversionPattern= %-4r [%t] %-5p %c %x - %m%n
# Use the MonitorAppender to log all messages.
log4j.logger.*=DEBUG,MonitorAppender
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/web.xml
Code: Select all
Modify hibernate configuration to use MySQL5InnoDBDialect<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
/WEB-INF/classes/OpenKM.xml
</param-value>
</context-param>
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/classes/hibernate.cfg.xml
Code: Select all
<!-- hibernate dialect -->
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<!-- DataSource properties (begin) -->
<property name="hibernate.connection.datasource">jdbc/OpenKMDS</property>
<property name="hibernate.hbm2ddl.auto">create</property>
<!-- DataSource properties (end) -->
Add bean for JNDI dataSource - dataSource is declared as Tomcat GlobalNamingResource
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/applicationContext.xml
Code: Select all
Declare GlobalNamingResource - the dataSource is created in MySQL and credentials verified via mysql CLI <beans:bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<beans:property name="jndiName" value="java:comp/env/jdbc/OpenKMDS"/>
/usr/share/tomcat7/conf/server.xml
Code: Select all
Active Tomcat Connectors <Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
username="openkm" password="*secret*" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/okmdb?autoReconnect=true&useUnicode=true&charac
/usr/share/tomcat7/conf/server.xml
Code: Select all
Could you please help me understand why I may still be getting a 404 - requested resource not availble error? Please also advise on anything else you have noticed or wish to inquire about my configuration - e.g. logging, dataSource and hibernate, Tomcat connections, Java environment.<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
Thank you in advance for your help.