Hi! I am updating a pre-existing EJB enterprise application. In that there is an EAR file which contains two web modules and one ejb module. In the web modules it is accessing stateless EJBs from the ejb modules. Now when it looks up the stateless ejb, there is a NameNotFoundException. The name that it uses to access the bean is
and the error is beanName not bound.
Now I am new to EJB 3. The book that I read from declared ejb-ref tag in web.xml to declare the EJBs in the web module. But this application is not declaring any ejb-ref tags. The application uses jBoss server and the web module has no context path so it can be accessed directly.
So basically is there a need to define the EJB in the client module. If yes, then can this configuration be given globally in the server configurations.
I have checked the jmx-console and I cannot find any binding with the name of the EJB. What can I do to solve this problem.
Please help in any way that you can. I am very hopeful that you fellow ranchers will help me. :roll: :roll:
There is no need for ejb-ref in JBoss AS and what you are describing is very achievable. The fact that the EJBs are not in JMX means that the deployment did not happen. Try taking a look at some of the recent threads. You will likely find some answers quicker than having to wait for folks to repeat what they have posted recently :-).
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
As I have pointed out, the web module doesn't uses any context name. That I have marked in bold. I don't know if that makes a difference. [ November 13, 2008: Message edited by: Ankit Garg ]
Joined: Feb 01, 2005
I think Jaikiran can take it from here. The web context does not make a difference. Looks like your bean did not deploy. I would look at the log output to see what might be going on. You may have an error or the EAR/EJB-JAR packaging might not be quite right.
Originally posted by Ankit Garg: But Two of the beans are there in the jmx list (as I made bold in my previous post). Why are others not in the list???
Reza is right. The beans aren't deployed. What you are seeing in the JNDI tree is a NamingContext under which the proxies would have been registered with a different jndi name, if the beans were deployed.
Ankit, which version of JBoss and Java do you use? I have seen some issues reported with JDK 1.6 when used with a particular version of JBoss. You even mention that you are using NetBeans. Do the beans deploy properly if you manually deploy the application in JBoss instead of deploying through the IDE?
Actually I am confused very much. jBoss service is running automatically without my permission. I don't know what is happening. Something is terribly wrong. I downloaded jBoss from sourceforge and started using it straight away using Netbeans without setting the JBOSS_HOME environment variable.
As per your recommendation, I started the server manually and when jBoss was deploying my application, this error came
The DefaultDS comes by default in JBoss through the hsql-ds.xml file. In your mysql-ds.xml you are trying to create the DefaultDS again. I would recommend that you change the mysql-ds.xml to use a different JNDI name instead of
To deploy the application (EAR, WAR, JAR or any other recognized application format) all you have to do is place it in the %JBOSS_HOME%/server/< serverName>/deploy folder. The server will pick up the application and deploy it.
Originally posted by Ankit Garg: OK here's my last bet. If this doesn't work then I may loose my job
First, calm down
Second, i can't access those logs. My office firewall block access to those files.
Originally posted by Ankit Garg: Jaikiran, Reza or anyone else PLEASE HELP ME!!!
Let's take this one step at a time. Let's forget about any IDE for a moment.
1) Download JBoss. You have already done this. So this step can be ignored. 2) Do not change anything on the clean installation of JBoss 3) Install JDK 1.5 or 1.6. You already have JDK 1.6. So again you can ignore this step 4) Create an EAR which you want to deploy. I believe you have scripts (maybe Ant scripts) which generates the EAR. 5) You might even need a datasource. I think you already have this (fixed) mysql-ds.xml. 6) Place the mysql-ds.xml in %JBOSS_HOME%/server/default/deploy folder 7) Place the EAR in %JBOSS_HOME%/server/default/deploy folder 8) Open a command prompt and 'cd' to %JBOSS_HOME%/bin 9) Run run.bat 10) Wait for the server to start.
Post the logs that you see on the console (command prompt).
As i said, let's not jump to next steps before we have completed these steps.
Well there was a Mapping problem in the code. One of the entity bean was using the mappedBy annotation param to define a non existing type. So I removed it. Still the code shows this error on deployment. This is the console output when I start the server. I have removed redundant information for beans that I thought are not relevant. I have used :: in such places. But if required, I will post the whole code.
OK, my problem was solved. I installed jBoss 4.0.4 and then it worked. Actually the problem was that jBoss 4.2.3 was not recognizing a OneToMany relationship's mappedBy property from a super class of the referenced class which had a @MappedSuperclass annotation.
Anyways thanks Jaikiran for helping me . Without you I couldn't have solved this problem. When I read the console output all the things became clear.