[Installation, Configuration & Deployment] - EAR is broken after redeployment
by carlsen
My EAR application (containing three sar archives, a war archive and a jar archive) deploys and runs like a dream.
However after I redeploy the ear, the application is broken. I get no errors on redeployment, but when I try to access the web part of the application I get the following error:
2006-08-09 11:20:16,352 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/dmmapp].[jsp]] Servlet.service() for servlet jsp threw exception
| java.lang.NullPointerException
| at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:327)
| at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
| at $Proxy2259.create(Unknown Source)
| at com.netmill.dmmbase.bean.presentation.EmployeeBean.getEmployeeManager(EmployeeBean.java:778)
| at com.netmill.dmmbase.bean.presentation.EmployeeBean.getEmployeeId(EmployeeBean.java:254)
| at com.netmill.dmmbase.bean.presentation.WebSessionBean.getEmployeeId(WebSessionBean.java:376)
| at com.netmill.dmmbase.bean.presentation.WebSessionBean.getEmployeeId(WebSessionBean.java:367)
| at com.netmill.dmmbase.bean.presentation.WebSessionBean.getLanguage(WebSessionBean.java:459)
| at org.apache.jsp.error.error500_jsp._jspService(org.apache.jsp.error.error500_jsp:106)
| at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
| 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:465)
| at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
| at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
| at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:362)
| at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:283)
| at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:227)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:134)
| 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:856)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
| 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)
Seems to me like I can no longer access the EJB beans for some reason.
Any help will be greatly appeciated...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963995#3963995
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963995
19 years, 9 months
[EJB/JBoss] - Ejb Session
by smix007
Hello,
Beginning in J2EE, I wish to develop my first applicationweb. I use for this JBoss 3.2.3 (for reasons of compatibility with the JDK 4 and it plug-in JBoss-IDE 1.4.0 of eclipse).
I succeeded in deploying the servlet. I am in stage of creation of Ejb Session.
I parameterized the file xdoclet-build.xml so that it generates me Remote interfaces and the Room interfaces and also the EJB and thanks to the target (@ejb.interface-method view-type="remote") added in my EjbReferenceBean.java
and while launching the xdoclet I generate:
EjbReferenceBeanRemoteHome.java, EjbReferenceBeanHome.java and EjbReferenceBeanBean.java in the repertory \Bureau\template\J2EE tutorial\generated-ejb\com\spim\ejb whereas my servlet and in the repertoire \Bureau\template\J2EE tutorial\src-web\com\spim\servlet
By adding the methods following in my servlet AccessServlet.java:
import com.spim.ejb.EjbReferenceBeanRemote;
import com.spim.ejb.EjbReferenceBeanRemoteHome;
private void initAccess(){
System.out.println("Entering Access.initAccess method()");
try{
ejbReferenceHome = getHome();
}catch (Exception e){
System.out.println("Exception in Access.initAcess method" + e);
}
System.out.println("Leaving Access.initAccess method()");
}
private EjbReferenceBeanRemoteHome getHome() throws NamingException {
Object result = getContext().lookup(EjbReferenceBeanRemoteHome.JNDI_NAME);
return ((EjbReferenceBeanRemoteHome)
javax.rmi.PortableRemoteObject.narrow(result, EjbReferenceBeanRemoteHome.class ));
}
private InitialContext getContext() throws NamingException {
Hashtable props = new Hashtable ();
props.put(
InitialContext.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(InitialContext.PROVIDER_URL,"jnp://127.0.0.1:1099");
InitialContext initialContext = new InitialContext (props);
return initialContext ;
}
protected void doPost(
HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String ref = request.getParameter("reference");
String choix = request.getParameter("choix");
try{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("Vous avez entré les informations suivantes :");
EjbReferenceBeanRemote erb = ejbReferenceHome.create();
out.println(erb.enregisterEtat(ref, choix));
}catch(Exception e){
System.out.println("Exception in Access.doPost method" + e);
}
}
The compiler does not manage to recognize the two following lines:
ejbReferenceHome = getHome();
and
EjbReferenceBeanRemote erb = ejbReferenceHome.create();
PS: my EjbReferenceBean.java is in the repertoire: \Bureau\template\J2EE tutorial\src-ejb\com\spim\ejb
Would somebody have an idea. I thank you in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963993#3963993
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963993
19 years, 9 months
[Persistence, JBoss/CMP, Hibernate, Database] - If I put @PersistenceContext(unitName=
by Renegade_xx
Hi!
I have a simple question.
I have an EJB3.0 Session bean (RegisterUserBean). If I try to configure an EntityManager in a following way:
| @PersistenceContext(unitName="rubis")
| protected EntityManager em;
|
I can't lookup with the following:
| InitialContext ctx = new InitialContext();
| cal = (RegisterUser) ctx.lookup("RubisBeanEAR/RegisterUserBean/remote");
|
becouse I get the next error msg:
| 10:50:54,421 ERROR [STDERR] javax.naming.NameNotFoundException: remote not bound
| 10:50:54,421 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| 10:50:54,421 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| 10:50:54,421 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| 10:50:54,421 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
| 10:50:54,421 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
| ...
|
Tools:
jboss-4.0.4RC1
jre1.5.0_06
MySql Server 5.0
If I don't use te annotation, ther is no error.
Please, help me.
Thank you very much
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963992#3963992
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963992
19 years, 9 months
[JBoss Seam] - Re: simeple create/edit user question
by bfo81
Stateless beans are only useful if you want to invoke one of their methods without doing anything else with them.
But if you have a state that should be held (e.g. user filled in fields) you need a STATEFUL bean. To distinguish between new and existing entities you can call two different actions - create and edit. There should be corresponding clickable buttons in your application.
I suggest it like that (pseudo code - in your case replace Entity by User):
| @Stateful
| @Scope(ScopeType.CONVERSATION)
| @Name(...)
| public class WhatEverBean implements WhatEver {
|
| private boolean newOne;
|
| @PersistenceContext(PersistenceContextType.EXTENDED)
| private EntityManager em;
|
| @In(required=false) @Out(required=false)
| private Entity entity;
|
| @Begin
| public String create() {
| newOne = true;
| entity = new Entity();
| return "editPageOutcome";
| }
|
| @Begin
| public String edit() {
| newOne = false;
|
| entity = em.find(Entity.class, theIdFromRequestParameter);
| OR: entity = getFromDataModelSelection...;
|
| return "editorPageOutcome";
| }
|
| @End
| public String save() {
| if (newOne)
| em.persist(entity);
| else
| em.merge(entity);
| return "toPreviousPageOutcome";
| }
| }
Ok, why do I suggest conversation scope? Cause the bean needs to live as long as the user edits the entity (including redisplays).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963990#3963990
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963990
19 years, 9 months
[Beginners Corner] - Jboss started but can not see JMX Console
by cagri
As you can see from below, Jboss started but can not see JMX console altought I was able to only yesterday. I reinstalled the program just in case and still the same problem.
Can not see it on http://localhost:8080/jmx-console/
Please help.
Thanks.
org.jboss.mx.util.JBossNotificationBroadcasterSupport.handleNotificat
ion(JBossNotificationBroadcasterSupport.java:127)
at org.jboss.mx.util.JBossNotificationBroadcasterSupport.sendNotificatio
n(JBossNotificationBroadcasterSupport.java:108)
at org.jboss.system.server.ServerImpl.sendNotification(ServerImpl.java:9
08)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:497)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:464)
at java.lang.Thread.run(Thread.java:595)
09:47:57,656 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 25s:625ms
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963988#3963988
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963988
19 years, 9 months