1
votes

Cannot start server. Server instance is not configured. (It was what tomcat server told me)

Doing the tasks of integration between Apache and Tomcat I got 50%. I mean, I got Apache up and running(because when I loaded the browse was fine) after configuration, but when I started Tomcat I got an error as you can see below:

My products versions are:

  • Apache 2.2.25 (win32)
  • Tomcat 7.0.47 (w x86)
  • mod_jk.so 1.2.37

Apache httpd.conf:

LoadModule jk_module "C:\Program Files\Apache Software Foundation\Apache2.2\modules\mod_jk.so"
JkWorkersFile "C:\Program Files\apache-tomcat-7.0.47\conf\workers.properties"
JkLogFile "C:\Program Files\apache-tomcat-7.0.47\conf\from_apache_mod_jk.log"
JkLogLevel Info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
ServerName localhost
JkMount /examples ajp13
JkMount /examples/* ajp13

Tomcat server.xml:

<Listener className="org.apache.jk.config.ApacheConfig" modJk="C:\Program Files\Apache Software Foundation\Apache2.2\modules\mod_jk.so" />
</Engine>

Dump File:

Nov 25, 2013 11:35:24 PM org.apache.catalina.core.AprLifecycleListener init
Informações: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.4.8.
Nov 25, 2013 11:35:25 PM org.apache.catalina.core.AprLifecycleListener init
Informações: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Nov 25, 2013 11:35:25 PM org.apache.tomcat.util.digester.Digester startElement
Grave: Begin event threw exception
java.lang.ClassNotFoundException: org.apache.jk.config.ApacheConfig
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:144)
    at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:617)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)

Nov 25, 2013 11:35:25 PM org.apache.catalina.startup.Catalina load
Advertência: Catalina.start using conf/server.xml: Error at (141, 143) : org.apache.jk.config.ApacheConfig
Nov 25, 2013 11:35:25 PM org.apache.tomcat.util.digester.Digester startElement
Grave: Begin event threw exception
java.lang.ClassNotFoundException: org.apache.jk.config.ApacheConfig
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:144)
    at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:617)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:679)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)

Nov 25, 2013 11:35:25 PM org.apache.catalina.startup.Catalina load
Advertência: Catalina.start using conf/server.xml: Error at (141, 143) : org.apache.jk.config.ApacheConfig
Nov 25, 2013 11:35:25 PM org.apache.catalina.startup.Catalina start
Grave: Cannot start server. Server instance is not configured.
2
The server.xml is: <Listener className="org.apache.jk.config.ApacheConfig" modJk="C:\Program Files\Apache Software Foundation\Apache2.2\modules\mod_jk.so" /> </Engine> </Service> </Server> I mean, Looking for configurations I saw a lot of possibities to configure it. I prefered the instructions inside apache web site, but Tomcat doesn't load. Can someone help me?Marcos
I found out this document that explain, however I coundn't understand. How can I integrate Tomcat 7 and Apache 2.2 ? faqcluster.com/question1875309190Marcos

2 Answers

1
votes

Download tomcat-jk2.jar file and put it in Tomcat's lib folder.This will solve your problem. You can download tomcat-jk2.jar from here.

0
votes

Marcos,

that message you read is on the tomcat user mailing list. They are saying that the ApacheConfig class has been removed from tomcat7 so trying to configure a listener with it in the server.xml is going to throw the ClassNotFoundException. So essentially you have to remove that Listener config from your server.xml.

You have to put the 'mod_jk.conf' file, if you already have one, in the Apache config directory - I'm not sure about windows, but in linux there is a 'conf.d' or there is a mods-available directory (if you put it in the latter, you have to enable the module with a2enmod)

Failing that you can just add it to the bottom of your main Apache config file.

For what to put in the config there, check out configuring tomat's server.xml file with auto generating mod_jk.conf