Hi List :-) !

I changed from TC3.2.1 to TC4b3 and experienced a strange
problem: after restarting a webapplication/the server I got the following
Error:
| HTTP Status 503 - This application is not currently
| available
|
|The requested service (This application is not currently available) is not 
|currently available.

So I searched the log-files -> and found the following test-cases:

case A) with a data-source section in struts-config.xml
=======================================================
after calling startup.sh the log says

2001-05-05 01:13:52 action: init
2001-05-05 01:13:52 action: Loading application resources from resource
org.apache.struts.example.Quis
2001-05-05 01:13:52 action: Initializing configuration from resource path
/WEB-INF/struts-config.xml
2001-05-05 01:13:52 action: Initializing application data source
org.apache.struts.action.DATA_SOURCE
2001-05-05 01:13:53 action: Process servletName=action, urlPattern=*.do
2001-05-05 01:13:53 action: Mapping for servlet 'action' = '*.do'

[playing around and creating a session]

after calling shutdown.sh the log says

2001-05-05 01:26:53 StandardHost[localhost]: standardHost.stop /quis
2001-05-05 01:26:53 Manager[/quis]: Cannot serialize session attribute
itemForm for session B1F2D2E20324816389E27719D5B2E592
2001-05-05 01:26:53 action: Finalizing this controller servlet
2001-05-05 01:26:53 action: Finalizing application data source
org.apache.struts.action.DATA_SOURCE
2001-05-05 01:26:53 ssi: destroy

when i startup tomcat now and call my webapp I get the message mentioned
above:
| HTTP Status 503 - This application is not currently
| available
|
|The requested service (This application is not currently available) is not 
|currently available.

and the log says:

2001-05-05 01:28:38 StandardHost[localhost]: Installing web application at
context path /quis from URL file:/usr/local/jakarta-tomcat-4.0-b3/webapps/quis
2001-05-05 01:28:38 Manager[/quis]: Seeding random number generator class
java.security.SecureRandom
2001-05-05 01:28:38 Manager[/quis]: Seeding of random number generator has
been completed
2001-05-05 01:28:38 StandardContext[/quis]: Exception loading sessions from
persistent storage
java.io.WriteAbortedException: Writing aborted by exception;
java.io.NotSerializableException: AT.ac.akhwien.quis.ItemSelectAction
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:445)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
        at java.util.HashMap.readObject(HashMap.java:840)
        at java.lang.reflect.Method.invoke(Native Method)
       [deleted]
2001-05-05 01:28:38 StandardContext[/quis]: Context startup failed due to
previous errors


The webapplication only works again after deleting SESSIONS.ser in the 
folder $TOMCAT_HOME/work/localhost/quis/

case B)  no data-source - section in struts-config.xml
======================================================

after calling startup.sh the log says

2001-05-04 23:15:54 action: init
2001-05-04 23:15:54 action: Loading application resources from resource
org.apache.struts.example.Quis
2001-05-04 23:15:54 action: Initializing configuration from resource path
/WEB-INF/struts-config.xml
2001-05-04 23:15:54 action: Process servletName=action, urlPattern=*.do
2001-05-04 23:15:54 action: Mapping for servlet 'action' = '*.do'

[playing around and creating a session]

after calling shutdown.sh the log says

2001-05-04 23:20:30 StandardHost[localhost]: standardHost.stop /quis
2001-05-04 23:20:31 StandardContext[/quis]: Exception unloading sessions to
persistent storage
java.lang.NoClassDefFoundError: javax/sql/DataSource
        at java.lang.Class.getMethods0(Native Method)
        at java.lang.Class.getDeclaredMethods(Class.java:1039)
        at
java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:873)
       [deleted]
2001-05-04 23:20:31 action: Finalizing this controller servlet


why is there "java.lang.NoClassDefFoundError: javax/sql/DataSource" when 
there is no data-source section defined?

So I asked myself: "Why do I get an error - and not the example?"
There is no data-source section in struts-example - and there is
no Error message when tomcat is finalizing struts-example!

2001-05-04 23:20:31 ssi: destroy
2001-05-04 23:20:31 StandardHost[localhost]: standardHost.stop /struts-example
2001-05-04 23:20:31 database: Finalizing database servlet
2001-05-04 23:20:31 database: Unloading database to
'/usr/local/jakarta-tomcat-4.0-b3/bin/../webapps/struts-example/WEB-INF/data
base.xml'
2001-05-04 23:20:31 action: Finalizing this controller servlet

BUT: Changing the scopes in struts-config.xml from request to session
[starting - playing - stopping]
brings up this log:

2001-05-05 01:07:31 ssi: destroy
2001-05-05 01:07:31 StandardHost[localhost]: standardHost.stop /struts-example
2001-05-05 01:07:31 StandardContext[/struts-example]: Exception unloading
sessions to persistent storage
java.lang.NoClassDefFoundError: javax/sql/DataSource
        at java.lang.Class.getMethods0(Native Method)
        at java.lang.Class.getDeclaredMethods(Class.java:1039)
        at
java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:873)
       [deleted]
2001-05-05 01:07:31 database: Finalizing database servlet
2001-05-05 01:07:31 database: Unloading database to
'/usr/local/jakarta-tomcat-4.0-b3/bin/../webapps/struts-example/WEB-INF/data
base.xml'
2001-05-05 01:07:31 action: Finalizing this controller servlet

After changing the scope of my webapp from session to request 
everything works fine: no 503 Status, no errors in the log 
AND (of course) no SESSIONS.ser in the work-folder.

---------------------------------------------------------------------------
Further: 

- Tomcat 3.2.1 cant have these problems since it does not serialize (right?)
- Tomcat 4.0b3 serializing mechanism seems to work fine with session-beans and
  pure jsp (no struts-action calls and no struts-session-beans).
- Using Tomcat 4.0 nightly build from 20010503 helps - but does not really 
  solve the problem: although the webapp does respond correctly after restart 
  (there is no "HTTP Status 503 - This application is not currently
available" 
   message)
  the errormessages are still the same in the log-file
  shutdown: "cannot serialize"
  starup: "Exception loading sessions from persistent storage"

My conclusion:
For me it seems as if it is a struts bug (that there is something 
wrong with storing the datasource in a session bean) but since
I have not much experience with all this (serialization + genericdatasource)
I would appreciate some feedback :-) 

Anybody out there who has an idea what is going on here?


Thanx in advance - I hope I could help you, too :-)
Yours
Harald

Reply via email to