HttpSession wird immer wieder neu erzeugt!! HELFT MIR BITTE!!!

C

che

Hi!

Ich arbeite gerade mit JSP und EJB 3.0.

Ich habe eine EJB 3.0 - EJB - Webshop-Anwendung erstellt, und
eigentlich läuft auch alles gut, bis auf die Tatsache, dass wenn ich
die Anwendung lokal aufrufe, die HttpSession immer wieder neu erzeugt
wird. Kennt jemand das Problem?

Details:

Ich habe meherer JSPs die immer wieder einen ControllerServlet
aufrufen, welches ihnen die angeforderten Objekte (EJB 3.0 Beans)
besorgt und diese Ihnen in den JSP Seiten (im Request und Session
Scope) anzeigt.

Die EJB 3.0 Beans: 5 Entities, 1 Stateful Session Bean (der Warenkorb)
und einige Stateless Session Beans...


Ich arbeite mit JBoss als AppServer, und der WEbserver ist der in
Jboss integrierte Tomcat.

ICh arbeite an zwei Rechnern. Auf dem PC habe ich JBoss installiert und
die Anwendung darin deployed. Von meinem Notebook aus rufe ich die
Anwendung so auf:

http://192.168.2.2:8080/petshop

und alles ist OK!

Wenn ich aber lokal auf die Anwendung zugreifen will, also mit dem
Aufruf:
http://localhost:8080/petshop
ODER
http://127.0.0.1:8080/petshop

dann wird das Session Objekt immer wieder neu erzeugt, wenn ich das
Controller Servlet aufgerufen wird.

Kennt jemand den Grund dafür?

Ich wäre für jeden Tipp dankbar.
 
R

Roedy Green

Hi!

Ich arbeite gerade mit JSP und EJB 3.0.

Ich habe eine EJB 3.0 - EJB - Webshop-Anwendung erstellt, und
eigentlich läuft auch alles gut, bis auf die Tatsache, dass wenn ich
die Anwendung lokal aufrufe, die HttpSession immer wieder neu erzeugt
wird. Kennt jemand das Problem?

Details:

Ich habe meherer JSPs die immer wieder einen ControllerServlet
aufrufen, welches ihnen die angeforderten Objekte (EJB 3.0 Beans)
besorgt und diese Ihnen in den JSP Seiten (im Request und Session
Scope) anzeigt.

Die EJB 3.0 Beans: 5 Entities, 1 Stateful Session Bean (der Warenkorb)
und einige Stateless Session Beans...


Ich arbeite mit JBoss als AppServer, und der WEbserver ist der in
Jboss integrierte Tomcat.

ICh arbeite an zwei Rechnern. Auf dem PC habe ich JBoss installiert und
die Anwendung darin deployed. Von meinem Notebook aus rufe ich die
Anwendung so auf:

http://192.168.2.2:8080/petshop

und alles ist OK!

Wenn ich aber lokal auf die Anwendung zugreifen will, also mit dem
Aufruf:
http://localhost:8080/petshop
ODER
http://127.0.0.1:8080/petshop

dann wird das Session Objekt immer wieder neu erzeugt, wenn ich das
Controller Servlet aufgerufen wird.

Kennt jemand den Grund dafür?

Ich wäre für jeden Tipp dankbar.

Here is my crude translation, designed primarily to stimulate German
speakers to provide a decent one:

I work with JSP and EJB 3.0. I wrote an EJB 3.0 - EJB - to Webshop
application, and everything runs fine , except for when I call the
application, it keeps creating a new HTTP session. Does someone know
what could be causing this? Detail: I have several JSPs which call
ControllerServlet again and again.

This gets the requested objects (EJB 3,0 Beans) which are inserted
into the JSP (in the Request and session Scope). The EJB 3.0 Beans: 5
Entities, 1 Stateful session Bean (the shoppingcart) and some
Stateless session Beans. I work with JBoss as AppServer, and the Web
server is Tomcat integrated into Jboss. I work on two computers. On
the PC I installed JBoss and the application. From my Notebook I call
application like this: http://192.168.2.2:8080/petshop and everything
is OK! If I, however, I want to access application locally, like this
with: http://localhost:8080/petshop OR http://127.0.0.1:8080/petshop
then the session is created again and again if the CONTROLLER Servlet
is called. Does someone know the reason for it? I would be for
grateful for any anwswer.


----------------------------

One thought. You should have a line like this in your hosts file. It
should not affect the 127.0.0.1, though, but you never know.

127.0.0.1 localhost

see http://mindprod.com/jgloss/hosts.html
 
C

che

Thank you Roedy.
I have checked the entries in that file, but the 127.0.0.1 localhost
entry exists there alreadey. It should be something else.
 
S

schulzp

Hallo,

ich kann dir bei deinem Problem leider nicht helfen,
da ich mich selber gerade in EJB, JSP und Struts einarbeite!
Ich versuche auch einen Webshop mit diesen Technologien
zu erstellen! Hast du vielleich ein paar Grundlegende Tipps
für die vorgehensweise?

Danke

Patrick Schulz
 
S

schulzp

Hallo,


ich kann dir bei deinem Problem leider nicht helfen,
da ich mich selber gerade in EJB, JSP und Struts einarbeite!
Ich versuche auch einen Webshop mit diesen Technologien
zu erstellen! Hast du vielleich ein paar grundlegende Tipps
für die Vorgehensweise?


Danke


Patrick Schulz
 
D

Dag Sunde

Hallo,

ich kann dir bei deinem Problem leider nicht helfen,
da ich mich selber gerade in EJB, JSP und Struts einarbeite!
Ich versuche auch einen Webshop mit diesen Technologien
zu erstellen! Hast du vielleich ein paar Grundlegende Tipps
für die vorgehensweise?

Jada Patrik, klart jeg vi hjelpe deg. Men du får nok mye
bedre respons hvis du skiver på et språk de fleste forstår!

(The above is in Norwegian, and says: "Of course we can
help you. But you will get a much better response if you
write in a language most people understand!)
 
S

schulzp

I also try to build a Webshop with EJB, JSP and Struts,
but I haven´t worked with these technologies yet.
Perhaps you can give me an approach?

Thanks
 
D

Dag Sunde

I also try to build a Webshop with EJB, JSP and Struts,
but I haven´t worked with these technologies yet.
Perhaps you can give me an approach?

Ouch...

That is a tall order if you never worked with it before.
I think you should rethink your decision about J2EE if
you don't absolutely *know* that you're going to need it.

Anyway, here is a link to the whitepapers about some
different core aspects of J2EE:

http://java.sun.com/j2ee/reference/whitepapers/index.html

Also take a look at the last chapter of this doc:
(But read the whole thing)
http://java.sun.com/j2ee/reference/whitepapers/j2ee_guide.pdf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top