What does the Netiquette imply?
[Design of JBoss Portal] - Re: shared state between HttpSession and PortletSession
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > Java Programming > [Design of JBoss Portal] - Re: shared state between HttpSession and PortletSession 12 April 2005 13:35:10

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

[Design of JBoss Portal] - Re: shared state between HttpSession and PortletSession

Julien@Jboss.Com 12 April 2005 13:35:10
 this is a tricky issue :-)­ and has been solved recently.

there have been a lot of discussions about this and the solution today is : use jboss 4 head with tomcat 5.5.8

what is does is pretty simple, all web apps share the same JSESSIONID which is issues under "/", this is achieved in tomcat with the attribute useEmptyPath="true"­ on the connector which should be the default today in jboss 4 head.

the other solution is to use stateless link, i.e put in your link to the servlet enough info to recreate the context for the content it must produce.

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­67674#3867674

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3867674


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Julien@Jboss.Com 24 February 2005 02:34:01 permanent link ]
 btw this is what the spec mandates :-)­

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­67677#3867677

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3867677


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Mholzner 24 February 2005 04:38:32 permanent link ]
 ok, there is only one more question for me then:
if all portlet apps share the same JSESSIONID , do they also share the same HttpSession ? I beliefe they shouldn't . If I remember correctly then the J2EE spec requires every context (WAR) to have it's own session for the same JSESSIONID, with the exception of WARs that are packaged inside the same EAR. Those do share the same HttpSession and JSESSIONID

....but my memory might fail me, it's done it before ....


View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­67685#3867685

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3867685


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Julien@Jboss.Com 24 February 2005 14:53:53 permanent link ]
 no they don't share it, they only have the jessionid in common.

that enables to have the same session wether you access the webapp by request dispatch from the portal or directly for the browser.

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­67735#3867735

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3867735


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Schnelzer 23 March 2005 02:07:57 permanent link ]
 I'd like to be able to deploy a configuration with the HTTPSession and PortletSession working as Julien describes above. Today, I built the latest version of JBossAS from the cvs head (5.0.0alpha), and followed the deployment instructions on the WIKI. I did copy the jgroups.jar and the jboss-cache.jar from the all/lib to the default/lib. I'm using JDK 1.4.2_06. I am also using the beta2b1 binary release of the portal. The error stack trace I am getting is below. It looks like an incompatibility with interceptors?

Can you give me some guidance on what I should try? If you know of a configuration that will support the HTTPSession and PortletSession requirements per the Portlet spec, I am happy to try that configuration (JBossAS and Portal versions?).

Thanks, Doug


17:03:26,401 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=Por­talDS,service=DataSo­urceBinding to JNDI name 'j
va:P­ortalDS'
17:03:26,401 ERROR [UserModuleImpl] Starting failed portal:service=Modu­le,type=User
javax.naming.NameNo­tFoundException: portal not bound
at org.jnp.server.Nami­ngServer.getBinding(­NamingServer.java:49­1)
at org.jnp.server.Nami­ngServer.getBinding(­NamingServer.java:49­9)
at org.jnp.server.Nami­ngServer.getObject(N­amingServer.java:505­)
at org.jnp.server.Nami­ngServer.rebind(Nami­ngServer.java:147)
at org.jnp.interfaces.­NamingContext.rebind­(NamingContext.java:­495)
at org.jnp.interfaces.­NamingContext.rebind­(NamingContext.java:­462)
at javax.naming.Initia­lContext.rebind(Init­ialContext.java:363)­
at org.jboss.naming.No­nSerializableFactory­.rebind(NonSerializa­bleFactory.java:165)­
at org.jboss.portal.co­re.modules.AbstractM­odule.startService(A­bstractModule.java:4­5)
at org.jboss.system.Se­rviceMBeanSupport.jb­ossInternalStart(Ser­viceMBeanSupport.jav­a:271)
at org.jboss.system.Se­rviceMBeanSupport.st­art(ServiceMBeanSupp­ort.java:172)



17:03:26,401 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=Por­talDS,service=DataSo­urceBinding to JNDI name 'j
va:P­ortalDS'
17:03:26,401 ERROR [UserModuleImpl] Starting failed portal:service=Modu­le,type=User
javax.naming.NameNo­tFoundException: portal not bound
at org.jnp.server.Nami­ngServer.getBinding(­NamingServer.java:49­1)
at org.jnp.server.Nami­ngServer.getBinding(­NamingServer.java:49­9)
at org.jnp.server.Nami­ngServer.getObject(N­amingServer.java:505­)
at org.jnp.server.Nami­ngServer.rebind(Nami­ngServer.java:147)
at org.jnp.interfaces.­NamingContext.rebind­(NamingContext.java:­495)
at org.jnp.interfaces.­NamingContext.rebind­(NamingContext.java:­462)
at javax.naming.Initia­lContext.rebind(Init­ialContext.java:363)­
at org.jboss.naming.No­nSerializableFactory­.rebind(NonSerializa­bleFactory.java:165)­
at org.jboss.portal.co­re.modules.AbstractM­odule.startService(A­bstractModule.java:4­5)
at org.jboss.system.Se­rviceMBeanSupport.jb­ossInternalStart(Ser­viceMBeanSupport.jav­a:271)
at org.jboss.system.Se­rviceMBeanSupport.st­art(ServiceMBeanSupp­ort.java:172)


17:04:12,868 INFO [PortletContainer] Created portlet object org.jboss.portal.co­re.portlet.test.Test­Portlet
17:04:12,868 INFO [TestPortlet] failed
17:04:12,888 ERROR [ServerManagerImpl] An error occured
org.jboss.portal.se­rver.kernel.ServiceF­ailureException: java.lang.Exception­: The portlet threw a portlet exception during init
at org.jboss.portal.se­rver.kernel.UpgradeM­ethod.invoke(Upgrade­Method.java:58)
at org.jboss.portal.se­rver.kernel.Kernel.s­tart(Kernel.java:382­)
at org.jboss.portal.se­rver.impl.ServerMana­gerImpl.install(Serv­erManagerImpl.java:4­42)
at org.jboss.portal.se­rver.impl.ServerMana­gerImpl.deploy(Serve­rManagerImpl.java:36­2)
at org.jboss.portal.se­rver.impl.ServerMana­gerImpl.deploy(Serve­rManagerImpl.java:37­3)
at org.jboss.portal.se­rver.impl.ServerMana­gerImpl.deploy(Serve­rManagerImpl.java:37­3)
at org.jboss.portal.se­rver.impl.ServerMana­gerImpl.deploy(Serve­rManagerImpl.java:34­0)
at sun.reflect.NativeM­ethodAccessorImpl.in­voke0(Native Method)
at sun.reflect.NativeM­ethodAccessorImpl.in­voke(NativeMethodAcc­essorImpl.java:39)
at sun.reflect.Delegat­ingMethodAccessorImp­l.invoke(DelegatingM­ethodAccessorImpl.ja­va:25)
at java.lang.reflect.M­ethod.invoke(Method.­java:324)
at org.jboss.mx.interc­eptor.ReflectedDispa­tcher.invoke(Reflect­edDispatcher.java:14­4)


View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­71204#3871204

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3871204


-------------------­--------------------­----------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com­/?ad_id=6882&alloc_i­d=15148&op=click
Add comment
Schnelzer 30 March 2005 00:26:18 permanent link ]
 I did some testing with JBoss Portal Beta 1 and JBoss AS 4.0.2RC1 and the HTTP Session and Portlet Session were being handled correctly per the Portlet spec. I did have to add crossContext="true"­ to each of the context.xml files (portal core and portlets). I understand that you won't need to do this after the next release of the JBoss AS 4.0.2.
Has anyone looked at an approach for intra portlet communication across portlet applications? I have a requirement for this that will work well in a clustered environment.

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­71938#3871938

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3871938


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Julien@Jboss.Com 30 March 2005 01:23:27 permanent link ]
 what do you call inter portlet communication ?

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­71944#3871944

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3871944


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Schnelzer 9 April 2005 00:04:11 permanent link ]
 I have two Portlet Applications in two separate .war files. I need to set a user session variable in one Portlet Application and then read it in the second application. Per the Portlet Spec this does not work using
PortletSession session = request.getPortletS­ession();
| session.setAttribut­e("User Variable", myUserVar, PortletSession.APPL­ICATION_SCOPE);

So if you can't do it using the PortletSession, then what is the best way to do this (based on your best practices ;-)­ ).

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­73285#3873285

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3873285


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Julien@Jboss.Com 9 April 2005 01:48:41 permanent link ]
 you can try to use a static map where you key objects with session ID because they will be the same. Of course you need an eviction mechanism to remove the expired objects.

I have some prototype sitting in my intellij projects, send me an email if you want me to send you the code.

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­73293#3873293

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3873293


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Schnelzer 9 April 2005 18:21:54 permanent link ]
 Thanks Julien. I'll send you my email address. I also have a follow up question that I thought would be good to have on the forum. Will you take this capability in to account as you test the JBoss Portal in a cluster? Thanks for the assistance.

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­73330#3873330

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3873330


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Julien@Jboss.Com 9 April 2005 18:25:21 permanent link ]
 my current try is not for cluster, but could be adapted I think.


View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­73331#3873331

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3873331


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Schnelzer 9 April 2005 18:31:50 permanent link ]
 If you have some ideas on an approach, we would be happy to do some of the work.

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­73333#3873333

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3873333


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Schnelzer 12 April 2005 06:00:13 permanent link ]
 I have come up with a approach for communication between portlet applications and I would like to get some feedback. My requirements are:

* a session that is visible across portlet applications
* an approach that will work well in a clustered environment (Julian, I couldn't easily see how to extend a static map so I started down an alternate path)


What I plan to do is create a Stateful Session Bean for each active user during login. When the Session Bean is first created, I will put the remote reference in the JBoss naming directory using the user's ID as the key. Portlets that need to read or update attributes that cross portlet applications will lookup the remote reference using JNDI and interact with the user's instance of the Session Bean. I believe this approach will behave well in a cluster since JNDI and Stateful Session Beans are well supported in a JBoss AS cluster, right?

Any feedback is appreciated.

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­73509#3873509

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3873509


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Julien@Jboss.Com 12 April 2005 13:29:36 permanent link ]
 I would have tried clustering by using the interface javax.servlet.http.­HttpSessionActivatii­onListener in which you have a method :

sessionDidActivate(­HttpSessionEvent se)

this method is called whenever you fail over another node and the servlet container deserialize your http session coming from the first original node.

so at session activation (i.e on the callback), I populate the static map with the shared attributes.


View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­73529#3873529

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3873529


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
Julien@Jboss.Com 12 April 2005 13:35:10 permanent link ]
 the SFSB is a good idea except JNDI.

JNDI is not meant to scale according to your user number. In addition when a statefull bean is evicted it would not be unbound from the JNDI tree and you would have to make some garbage by yourself.

Try with JBoss treecache which can be either replicated or local, using the user ID as key. You can specific an eviction policy and it can be replicated. And actually now http session replication is using treecache to replicate its session (JBossCacheSessionM­anager).

"schnelzer" wrote : I have come up with a approach for communication between portlet applications and I would like to get some feedback. My requirements are:
|
| * a session that is visible across portlet applications
| * an approach that will work well in a clustered environment (Julian, I couldn't easily see how to extend a static map so I started down an alternate path)
|
|
| What I plan to do is create a Stateful Session Bean for each active user during login. When the Session Bean is first created, I will put the remote reference in the JBoss naming directory using the user's ID as the key. Portlets that need to read or update attributes that cross portlet applications will lookup the remote reference using JNDI and interact with the user's instance of the Session Bean. I believe this approach will behave well in a cluster since JNDI and Stateful Session Beans are well supported in a JBoss AS cluster, right?
|
| Any feedback is appreciated.

View the original post : http://www.jboss.or­g/index.html?module=­bb&op=viewtopic&p=38­73530#3873530

Reply to the post : http://www.jboss.or­g/index.html?module=­bb&op=posting&mode=r­eply&p=3873530


-------------------­--------------------­----------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com­/?ad_id=6595&alloc_i­d=14396&op=click
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > Java Programming > [Design of JBoss Portal] - Re: shared state between HttpSession and PortletSession 12 April 2005 13:35:10

see also:
[EJB/JBoss] - deploying stateless ejb…
[JBoss Getting Started Documentation]…
[Messaging, JMS & JBossMQ] - Re…
пройди тесты:
see also:
RSIDLL32.DLL
Handpunch
All in one Video Converter Platinum

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .