[EJB/JBoss] - Singleton EJB
by ahachmann
Hello,
I realized, that the Singleton Pattern seems not to be such a common one.
I tried the workaround with the Poolsize.
This is my jboss.xml:
| <?xml version="1.0"?>
| <jboss>
| <enterprise-beans>
| <session>
| <ejb-name>SessionLogCacheImpl</ejb-name>
| <configuration-name>Standard Singleton Stateless SessionBean</configuration-name>
| </session>
| </enterprise-beans>
| <container-configurations>
| <container-configuration extends="Standard Stateless SessionBean">
| <container-name>Standard Singleton Stateless SessionBean</container-name>
| <container-pool-conf>
| <MaximumSize>1</MaximumSize>
| <strictMaximumSize>true</strictMaximumSize>
| </container-pool-conf>
| </container-configuration>
| </container-configurations>
| </jboss>
But this does not work properly.
I need this singleton for the reason that i want to store objects in a single set from every Client. First I tried to use static sets. This worked out.
But i read that static should not be used in EJB.
Forther more this EJB has a timer. So when I have more than one EJB in the pool, the Timer will be called more than once.
The only way i see to get this working is using singleton. But aint getting this to work.
Has anyone any suggestion?
Thanks for your Help,
Alexander
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986628#3986628
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986628
19Â years, 7Â months
[JBoss Portal] - Re: Restricting link & form actions within the same portlet
by girishramagiri
Hi Thomas,
Thanks for your input.
Inorder to use PortletURL, I need to extend PortalJSP & use portlet taglib in the jsp which has the buttons.
After extending the PortalJSP & incorporating portlet taglib, the existing jsp along with the existing tags looks as below:
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
| <%@ page language="java" pageEncoding="UTF-8"%>
|
| <%@ page import="com.myapp.web.user.bean.User" %>
| <%@ page import="com.myapp.web.utility.apputils.component.AppConstants" %>
| <%@ page import="com.myapp.web.utility.apputils.component.ActionConstants"%>
| <%@ page import="com.myapp.web.resources.ApplicationProperties;"%>
|
| <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
| <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
| <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
| <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
| <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
| <%@ taglib uri="/WEB-INF/struts/tld/struts-nested.tld" prefix="nested" %>
As soon as the jsp loads, NullPointerException is thrown as follows:
2006-11-16 22:06:20,677 DEBUG [org.apache.catalina.loader.WebappClassLoader] Loading class from local repository
|
| 2006-11-16 22:06:20,677 INFO [STDOUT] ERROR [jsp].error:119 - Servlet.service() for servlet jsp threw exception
|
| java.lang.NullPointerException
|
| at org.jboss.portal.core.servlet.jsp.PortalJsp.service(PortalJsp.java:140)
|
| at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
|
| at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
|
| at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
|
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
|
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
|
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
|
| at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
|
| at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
|
| at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
|
| at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
|
| at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
|
| at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
|
| at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
|
| at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
|
| at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
|
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
|
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
|
Is this because the portlet tags will not work if the jsp contains other functionality tags?
However I noticed that when I remove PortalJSP & portlet taglib code, the jsp compiles without any error & also loads the contents.
Many Thanks in Advance,
Girish
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986619#3986619
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986619
19Â years, 7Â months