Can not access resource after tomcat restart

Hi, all:

I got a weired problem on my web site, after I restart the Tomcat server, the images are not accessible even though a user session exist

If I put those jsp pages inside member only security-constrains, those pages are not accessble after server restart, right now the images inside those jsp pages are not showning since I put only put login page in the restricted resource. I don't see how to fix this.

What I am trying to do is to servive server failover, user use the web site same as before the server restart.

Any genius? I stuck here, and my web site is hosting right now.

[621 byte] By [nwa001a] at [2007-11-26 13:34:07]
# 1

> I got a weired problem on my web site, after I

> restart the Tomcat server, the images are not

> accessible even though a user session exist

Those two phrases are mutually exclusive.

After a restart there are no sessions.

Perhaps you meant after reconnecting you have verified that a new session has been created?

If yes then specifically what error are you getting when you try to access the resources?

jschella at 2007-7-7 22:15:16 > top of Java-index,Archived Forums,Socket Programming...
# 2

Session restored after tomcat restart, I can find the objects bind in a session. I didn't get any error, jus tthose member restricted images and jar files are not accessible, those pictures are not showing when I click on a page,here is my web.xml:

<security-constraint>

<web-resource-collection>

<web-resource-name>Member only</web-resource-name>

<url-pattern>/index.jsp</url-pattern>

<url-pattern>/select.jsp</url-pattern>

<url-pattern>/search.jsp</url-pattern>

<url-pattern>/applet/m.jar</url-pattern>

<url-pattern>/applet/i.jar</url-pattern>

<url-pattern>/images/active.jpg</url-pattern>

<url-pattern>/images/bgred.jpg</url-pattern>

<url-pattern>/images/delete.jpg</url-pattern>

<url-pattern>/images/checkout.jpg</url-pattern>

<url-pattern>/images/computer.jpg</url-pattern>

<url-pattern>/images/graybar.jpg</url-pattern>

<url-pattern>/images/doubt.jpg</url-pattern>

<http-method>GET</http-method>

<http-method>PUT</http-method>

<http-method>POST</http-method>

<http-method>DELETE</http-method>

</web-resource-collection>

<auth-constraint>

<role-name>member</role-name>

</auth-constraint>

</security-constraint>

-

since a user has access right, why can it access those resource after tomcat restart, so weired, how can a web application servive a failover if an user can not access the resource he can access before tomcat restart.

Help!!!

nwa001a at 2007-7-7 22:15:16 > top of Java-index,Archived Forums,Socket Programming...
# 3
> Session restored after tomcat restart, How exactly was the session restored?
jschella at 2007-7-7 22:15:16 > top of Java-index,Archived Forums,Socket Programming...
# 4
Tomcat persist session by server itself, it restored after restart.
nwa001a at 2007-7-7 22:15:16 > top of Java-index,Archived Forums,Socket Programming...
# 5

> Tomcat persist session by server itself, it restored

> after restart.

I don't have enough experience with that but I don't believe that works.

As I understand it a session is basically between a single running instance and client. If that instance disappears then at least some session information is lost.

An application can restore specific information about a session but that doesn't mean that the client does not have to be refreshed in some manner and that is what creates the actual session. The stored information (if it was persisted) is loaded into that session. That is how, for example, you can use shopping cart software to keep track of your order even if you close the browser.

So recapping....

1. The client creates a connection.

2. The server creates a session.

3. The server goes down - the session ceases to exist.

To restore a session.

1. The client restarts or refreshes

2. The server creates a session (same as above.)

3. The server, optionally, loads persisted state data about the previous session.

4. The user continues doing what they were doing.

Failover doesn't maintain the session. What it does do is maintain persisted data and to allow many clients to continue to connect (create new sessions.)

As I said though I might not understand it correctly. You could try re-asking (and re-phrasing) your question in the j2ee forum.

jschella at 2007-7-7 22:15:16 > top of Java-index,Archived Forums,Socket Programming...
# 6

Could be!

But since the data is restored and user can continue use the same session, means client is authenticated, why not able to access the restricted resource in the web.xml

it's the same username/password role name and security constraints.

what has made it not able to do that after server restart and reload the web.xml?

nwa001a at 2007-7-7 22:15:16 > top of Java-index,Archived Forums,Socket Programming...
# 7

> Could be!

> But since the data is restored and user can continue

> use the same session, means client is authenticated,

> why not able to access the restricted resource in the

> web.xml

I specifically said that wasn't the case.

Unless the user restarts the session it will not exist.

jschella at 2007-7-7 22:15:16 > top of Java-index,Archived Forums,Socket Programming...
# 8
I bound the a name to the session, I can get it after server restart!!every server has failover function. I think the security constraints conflict with tomcat's session persistance.
nwa001a at 2007-7-7 22:15:16 > top of Java-index,Archived Forums,Socket Programming...
# 9
> I bound the a name to the session, I can get it after> server restart!!> every server has failover function. I think the> security constraints conflict with tomcat's session> persistance.Well good luck then.
jschella at 2007-7-7 22:15:16 > top of Java-index,Archived Forums,Socket Programming...
# 10
Everyone has any idea? It's very serious I hosted my web site, when it fails at the hosting company, no one can re enter the web site, it suppose to be able to re access the web site right away!
nwa001a at 2007-7-7 22:15:16 > top of Java-index,Archived Forums,Socket Programming...