Kai Karius

Greenhorn
+ Follow
since Feb 03, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kai Karius

Can it be that the session gets created with the first request and the Listener gets called THEN?
10 years ago
Hi people,

I created a HttpSessionListener that should create a folder on the HD everytime a session opens. Unfortunately that does not seem to work:



So, what am I doing wrong? Btw I started Tomcat as administrator.

Thank you!
10 years ago
Sigh. Yes. That was it.

Thank you!
15 years ago

The mentioned class is missing in the classpath of the runtime environment. Add it to the classpath of the runtime environment.



True. But it IS there, i will give you an overview of my deployment structure:

[tomcat]/webapps/Listener/WEB-INF/web.xml
[tomcat]/webapps/Listener/WEB-INF/com/example/Dog.class
tomcat]/webapps/Listener/WEB-INF/com/example/MyServletContextListener.class
tomcat]/webapps/Listener/WEB-INF/com/example/ListenerTester.class

So, whats the matter?
15 years ago
Hi Guys,

ok, i wrote a listener, here it is:



Its from the HF Servlet and JSP as some of you will guess. Its deployed in [tomcat]/webapps/Listener/WEB-INF/com/example. The DD is such:



Its deployed in tomcat]/webapps/Listener/WEB-INF

Now upon startup Tomcat 5 tells me very inconclusive stuff:

08.02.2009 17:52:48 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
08.02.2009 17:52:48 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
08.02.2009 17:52:49 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
08.02.2009 17:52:49 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
08.02.2009 17:52:50 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
08.02.2009 17:52:50 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
08.02.2009 17:53:37 org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
08.02.2009 17:53:39 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
08.02.2009 17:53:39 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
08.02.2009 17:53:42 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
08.02.2009 17:53:42 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
08.02.2009 17:53:42 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Error configuring application listener of class com.example.MyServletContextListener
java.lang.ClassNotFoundException: com.example.MyServletContextListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
08.02.2009 17:53:42 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Skipped installing application listeners due to previous error(s)
08.02.2009 17:53:44 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
08.02.2009 17:53:44 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()

Where seems to be the error?

TWERP
15 years ago
Hi!

Tanks, i checked the statement. Ofc, it should read:

<%@ page import="java.util.*" %>



Guess i was so glad to see some familiar Java that i didnt consider the differences.

Thank you very much,

TWERP
15 years ago
JSP
First off,

relax. I didnt fail completely . Its just the last step involving an actual JSP file that troubles me. My deployment structure is as given in the book. Each of the previous examples worked fine. Now, building in the result.jsp my fox gives me the following:



Now, i cant get smart of this....Here are my files:

Its the BeerExpert.java :



The BeerSelect.java



The web.xml



And, ofc. the result.jsp



Thanks in advance.
15 years ago
JSP