# Help! Can't get Apache and Tomcat working together

## lazloman

I have both installed, Apache runs just fine, but when I start Tomcat, I get this error:

```

Mar 2, 2010 10:14:50 PM org.apache.catalina.core.StandardContext listenerStart

SEVERE: Error configuring application listener of class listeners.SessionListener

java.lang.ClassNotFoundException: listeners.SessionListener

    at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source)

    at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source)

    at org.apache.catalina.core.StandardContext.listenerStart(Unknown Source)

    at org.apache.catalina.core.StandardContext.start(Unknown Source)

    at org.apache.catalina.core.ContainerBase.addChildInternal(Unknown Source)

    at org.apache.catalina.core.ContainerBase.addChild(Unknown Source)

    at org.apache.catalina.core.StandardHost.addChild(Unknown Source)

    at org.apache.catalina.startup.HostConfig.deployDirectory(Unknown Source)

    at org.apache.catalina.startup.HostConfig.deployDirectories(Unknown Source)

    at org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)

    at org.apache.catalina.startup.HostConfig.start(Unknown Source)

    at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source)

    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown Source)

    at org.apache.catalina.core.ContainerBase.start(Unknown Source)

    at org.apache.catalina.core.StandardHost.start(Unknown Source)

    at org.apache.catalina.core.ContainerBase.start(Unknown Source)

    at org.apache.catalina.core.StandardEngine.start(Unknown Source)

    at org.apache.catalina.core.StandardService.start(Unknown Source)

    at org.apache.catalina.core.StandardServer.start(Unknown Source)

    at org.apache.catalina.startup.Catalina.start(Unknown Source)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:616)

    at org.apache.catalina.startup.Bootstrap.start(Unknown Source)

    at org.apache.catalina.startup.Bootstrap.main(Unknown Source)

Mar 2, 2010 10:14:50 PM org.apache.catalina.core.StandardContext listenerStart

SEVERE: Skipped installing application listeners due to previous error(s)

```

Output of java-config -J

```
/opt/icedtea6-bin-1.6.2/bin/java
```

```

JAVAC=/etc/java-config-2/current-system-vm/bin/javac

JAVA_HOME=/etc/java-config-2/current-system-vm

JDK_HOME=/etc/java-config-2/current-system-vm

```

I did a search for the listener files and found only the .java files, co class files.

What else do I need to post to help solve this?

Is there any Gentoo documentation on how to get these working?

Thanks

----------

## sam.reader

 *Quote:*   

> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 
>     at java.lang.reflect.Method.invoke(Method.java:616)
> 
>     at org.apache.catalina.startup.Bootstrap.start(Unknown Source)
> ...

 

Your installation had an error

Try to remove it completely and the reinstall it without any programs running in the side

IF the same problem persists get back here

Will try to do get some help

----------

## lazloman

I was able to get it working against port 8080, but I want Apache to use mod_jk to handle jsp requests sent to it. I found this thread:

https://forums.gentoo.org/viewtopic-t-789411-highlight-modjk.html

But the user doesn't say what settings he used. What do I need to do to get mod_jk to handle requests and do I need to have Tomcat installed/running to have it work?

Thanks

----------

## gerdesj

 *lazloman wrote:*   

> I was able to get it working against port 8080, but I want Apache to use mod_jk to handle jsp requests sent to it. I found this thread:
> 
> https://forums.gentoo.org/viewtopic-t-789411-highlight-modjk.html
> 
> But the user doesn't say what settings he used. What do I need to do to get mod_jk to handle requests and do I need to have Tomcat installed/running to have it work?
> ...

 

Don't use mod_jk use mod_proxy instead.

Here's an example for a GroupWise web access system - it really is this simple!

<Location "/gw/">

         proxypass               ajp://host.example.com:9010/gw/

</Location>

(there's a bit more for this particular system but the above should get you started)

Cheers

Jon

----------

## mno

Sorry for digging up an old thread, but what's the disadvantage of mod_jp and how is mod_proxy better?

Thanks!

----------

## lostinspace2011

Looks like a tomcat problem to me. I am using mod_jk and it is working fine. Maybe try to re-emerge your tomcat and check all the configuration files are updated. Since it is not able to resolve a class which which JAR should have this jar in it, can then verify your classpath

Have fun

Alex

----------

## mno

mod_jk works for me too, but as per the earlier comment from a few years back, I saw suggestion to use mod_proxy instead, and wanted to know why so. The original thread is oooold, so I think the original poster doesn't care much anymore  :Smile: 

----------

