[EJB/JBoss] - Help! What type of bean?
by BigBoi
Hi all,
I've run into a snag that I've never encountered before...and I'm not sure what type of bean to use for this application.
Basically, the entire system is running on JBOSS (which is great BTW!), however we've run into an issue that we need to make a call to a legacy third-party software. Now, this isn't normally a problem, however this initialization for this product is just awful (time consuming). We still need to have it message driven, however I would like to avoid spawning new MDB's for the purpose of the application running at a higher pace. Therefore, we would still need to have it triggered by a message, but I would like to use a bean that is initialized only at startup with the server. In that case, we would still be able to access the third party software, and skip the initialization on every message coming in.
So...the bottom line is: What type of bean can be initialized at startup, and then access via a message? (I'm not opposed to using an MDB and another type of bean that is static)
Thanks all...anything helps!
-John
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965177#3965177
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965177
19 years, 10 months
[JBoss Seam] - Re: specific @SelectItem Question -
by mrohad
thanks for helping us!
well I am sure it doesn't call the factory I put a breakpoint there..
beforeI added @Scope(ScopeType.APPLICATION)
it did called the factory method but then I got NullPointerException
you can see that in my first Post
here is the Codes code:
|
| @Entity
| @Scope(ScopeType.SESSION)
| @Name("codes")
| @Table(name="codes")
|
| public class Codes implements java.io.Serializable {
|
|
| // Fields
|
| private int id;
| private String label;
| private String table;
| private String code;
| private String description;
| private Boolean disabled;
|
|
| // Constructors
|
| /** default constructor */
| public Codes() {
| }
|
| /** minimal constructor */
| public Codes(int id, String table, String code) {
| this.id = id;
| this.table = table;
| this.code = code;
| }
|
| /** full constructor */
| public Codes(int id, String label, String table, String code, String description, Boolean disabled) {
| this.id = id;
| this.label = label;
| this.table = table;
| this.code = code;
| this.description = description;
| this.disabled = disabled;
| }
|
|
|
| // Property accessors
| @Id
| @Column(name="ID", unique=true, nullable=false, insertable=true, updatable=true)
|
| public int getId() {
| return this.id;
| }
|
| public void setId(int id) {
| this.id = id;
| }
| @Column(name="LABEL", unique=false, nullable=true, insertable=true, updatable=true, length=2000)
|
| public String getLabel() {
| return this.label;
| }
|
| public void setLabel(String label) {
| this.label = label;
| }
| @Column(name="TABLE", unique=false, nullable=false, insertable=true, updatable=true, length=200)
|
| public String getTable() {
| return this.table;
| }
|
| public void setTable(String table) {
| this.table = table;
| }
| @Column(name="CODE", unique=false, nullable=false, insertable=true, updatable=true, length=100)
|
| public String getCode() {
| return this.code;
| }
|
| public void setCode(String code) {
| this.code = code;
| }
| @Column(name="DESCRIPTION", unique=false, nullable=true, insertable=true, updatable=true, length=2000)
|
| public String getDescription() {
| return this.description;
| }
|
| public void setDescription(String description) {
| this.description = description;
| }
| @Column(name="disabled", unique=false, nullable=true, insertable=true, updatable=true)
| public Boolean getDisabled() {
| return this.disabled;
| }
|
| public void setDisabled(Boolean disabled) {
| this.disabled = disabled;
| }
| }
|
here is the exception:
anonymous wrote :
| 09:08:48,767 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 1m:167ms
| 09:09:22,375 INFO [Pages] reading pages.xml
| 09:09:32,740 ERROR [STDERR] 15/08/2006 09:09:32 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/wb/JBoss/J404/server/default/tmp/deploy/tmp5228wb.ear-contents/wb-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
| 09:09:32,850 ERROR [STDERR] 15/08/2006 09:09:32 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/wb/JBoss/J404/server/default/tmp/deploy/tmp5228wb.ear-contents/wb-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
| 09:09:32,880 ERROR [STDERR] 15/08/2006 09:09:32 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/wb/JBoss/J404/server/default/tmp/deploy/tmp5228wb.ear-contents/wb-exp.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/seam.taglib.xml
| 09:09:32,940 ERROR [STDERR] 15/08/2006 09:09:32 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/wb/JBoss/J404/server/default/tmp/deploy/tmp5228wb.ear-contents/wb-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
| 09:09:33,050 ERROR [STDERR] 15/08/2006 09:09:33 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/wb/JBoss/J404/server/default/tmp/deploy/tmp5228wb.ear-contents/wb-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
| 09:09:33,110 ERROR [STDERR] 15/08/2006 09:09:33 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/wb/JBoss/J404/server/default/tmp/deploy/tmp5228wb.ear-contents/wb-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
| 09:09:34,442 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
| 09:09:34,442 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
| 09:09:34,442 INFO [MyfacesConfig] Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.
| 09:09:35,564 INFO [STDOUT] Hibernate: select codes0_.ID as ID1_, codes0_.TABLE as TABLE1_, codes0_.DESCRIPTION as DESCRIPT3_1_, codes0_.CODE as CODE1_, codes0_.LABEL as LABEL1_, codes0_.disabled as disabled1_ from wb.codes codes0_ where codes0_.TABLE=?
| 09:09:35,774 INFO [STDOUT] Hibernate: select codes0_.ID as ID1_, codes0_.TABLE as TABLE1_, codes0_.DESCRIPTION as DESCRIPT3_1_, codes0_.CODE as CODE1_, codes0_.LABEL as LABEL1_, codes0_.disabled as disabled1_ from wb.codes codes0_ where codes0_.TABLE=?
| 09:09:35,774 ERROR [STDERR] 15/08/2006 09:09:35 com.sun.facelets.FaceletViewHandler handleRenderException
| SEVERE: Error Rendering View[/login/register.xhtml]
| java.lang.IllegalArgumentException: Value binding '#{cLang}'of UISelectItems with component-path {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /login/register.xhtml][Class: javax.faces.component.html.HtmlForm,Id: _id38][Class: javax.faces.component.html.HtmlPanelGrid,Id: _id40][Class: javax.faces.component.html.HtmlSelectOneMenu,Id: _id51][Class: javax.faces.component.UISelectItems,Id: _id52]} does not reference an Object of type SelectItem, SelectItem[], Collection or Map but of type : null
| at org.apache.myfaces.shared_impl.util.SelectItemsIterator.hasNext(SelectItemsIterator.java:141)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.internalGetSelectItemList(RendererUtils.java:477)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getSelectItemList(RendererUtils.java:453)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.internalRenderSelect(HtmlRendererUtils.java:277)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.renderMenu(HtmlRendererUtils.java:251)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlMenuRendererBase.encodeEnd(HtmlMenuRendererBase.java:54)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:442)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:216)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:98)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| 09:09:35,834 INFO [STDOUT] Hibernate: select codes0_.ID as ID1_, codes0_.TABLE as TABLE1_, codes0_.DESCRIPTION as DESCRIPT3_1_, codes0_.CODE as CODE1_, codes0_.LABEL as LABEL1_, codes0_.disabled as disabled1_ from wb.codes codes0_ where codes0_.TABLE=?
|
in the last line it looks like it does called the factory method but there is 2 bp there...
and bk on other places in the code do work for me
any idea?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965176#3965176
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965176
19 years, 10 months
[Management, JMX/JBoss] - NPE -- jboss 4.0.4RC1
by michael.wang
>From time to time I have got exception as follows:
00:46:40,050 ERROR [[HtmlAdaptor]] Servlet.service() for servlet HtmlAdaptor threw exception
java.lang.NullPointerException: null name
at javax.management.ObjectName.init(ObjectName.java:567)
at javax.management.ObjectName.(ObjectName.java:341)
at org.jboss.jmx.adaptor.control.Server.getMBeanData(Server.java:97)
at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.inspectMBean(HtmlAdaptorServlet.java:201)
at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:96)
at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doGet(HtmlAdaptorServlet.java:77)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)
Please advice, thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965173#3965173
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965173
19 years, 10 months