• Enterprise 6.3.0 Install 404 - requested resource not avail

  • Problems with installing OpenKM? No problemo, the solution is closer than you think.
Problems with installing OpenKM? No problemo, the solution is closer than you think.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #30737  by three-bears
 
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
  • Ubuntu Linux 12.04
    Apache Tomcat 7
    Oracle Java JDK 7
So far, I have had to make the following changes to the OpenKM deployment to resolve errors in Tomcat. It is worth noting to other users that I have had to fish through multiple Tomcat-related log files to find clues, and I have also turned up log levels in Tomcat to DEBUG or FINE anywhere that I could find a relevant log setting.

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
xsi:schemaLocation="http://www.springframework.org/schema/beans
                                 http://www.springframework.org/schema/beans/spring-beans-3-x.xsd
to
Code: Select all
xsi:schemaLocation="http://www.springframework.org/schema/beans
                                 http://www.springframework.org/schema/beans/spring-beans.xsd
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:
/var/lib/tomcat7/webapps/OpenKM/WEB-INF
Code: Select all
<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">
Next I made the following sets of changes to configuration files.

Add log4j Listener - also created the logging.properites file referenced (see below)
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/web.xml
Code: Select all
  <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>
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/classes/logging.properties
Code: Select all
# 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
Change reference to OpenKM.xml to use hard-link relative to directory rather than $file variable.
/var/lib/tomcat7/webapps/OpenKM/WEB-INF/web.xml
Code: Select all
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
      /WEB-INF/applicationContext.xml
      /WEB-INF/classes/OpenKM.xml
    </param-value>
  </context-param>
Modify hibernate configuration to use MySQL5InnoDBDialect
/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
   <beans:bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <beans:property name="jndiName" value="java:comp/env/jdbc/OpenKMDS"/>
Declare GlobalNamingResource - the dataSource is created in MySQL and credentials verified via mysql CLI
/usr/share/tomcat7/conf/server.xml

Code: Select all
 <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
Active Tomcat Connectors
/usr/share/tomcat7/conf/server.xml
Code: Select all
<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" />
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.

Thank you in advance for your help.
 #30755  by jllort
 
You're deploying OpenKM.war into existing tomcat. Is that the scenario ?
At $Tomcat home you must copy OpenKM.cfg and OpenKM.xml files ( also take a look at our tomcat/lib folder to be sure you got all libraries into your own tomcat )
 #30763  by three-bears
 
Correct - I am deploying the OpenKM.war into existing Tomcat.

For those readers unfamiliar with Tomcat, a running instance of Tomcat will "explode" the .war file once the .war file is moved to the tomcat-instance/webapps directory. Or, Tomcat will explode the .war file when Tomcat is started, either manually by script (e.g. startup.sh) or automatically (e.g. at boot), if the .war file has been moved to the tomcat-instance/webapps directory.

So after Tomcat explodes the OpenKM.war file, I can access the files that I described in my initial post. By the way, I am familiar with building .war files using Maven, and plan to re-create the environment with the devloper install after understanding the administrator's deployment.

I plan to download your bundled software, unzip it, and expect to see the OpenKM.cfg and "stock" OpenKM.xml files, correct? I will find out soon anyways :) Please advise me if I should be doing something else; otherwise, I will report back when I have an update.

A question I have is whether I need to be running OpenKM to fully understand how to re-create the environment with existing Tomcat. So other users may wish to know that I may either deploy the bundled OpenKM to another PC or to a virtual machine.
 #30777  by jllort
 
In OpenKM Bundle you'll find out all files you needed. I think with this three files is enought ( there's some minimal changes in server.xml and log4j.properties files, I think you should take a fast look into these too ).
About using VM is good practice for testing environments rather than server with a lot of mixed software configurations.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.