wood burning stoves 2.0*
The moose likes BEA/Weblogic and the fly likes Deployment time NameNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Deployment time NameNotFoundException" Watch "Deployment time NameNotFoundException" New topic
Author

Deployment time NameNotFoundException

Mark Herschberg
Sheriff

Joined: Dec 04, 2000
Posts: 6037
I'm trying to deploy my EJBs to WebLogic 7.0, using JBuilder 8.0 (Enterprise). For some reason,
I'm getting a NameNotFoundException during deployment. I'd expect to see these at
runtime, but at deployment time, it suggests I have some configuration setting wrong--but I can't
find any. A co-worker has been able to successfuly deploy to and run his EJBs on the server.
Any ideas?

Log file:


Exception:

I do have an EJB named OrderCrosser in trading.jar (along with a few other beans, session, entity, and message-driver), however I never named it, placed it, or otherwise referenced it by app/ejb/trading.jar#OrderCrosser I'm guessing that's something WebLogic did and some setting is misconfigured.
--Mark

(Hmm, looks like the password is included in the error log, I better fix that :-)
[ December 17, 2002: Message edited by: Mark Herschberg ]
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Actually my first guess would be JBuilder 8 did something funny with the descriptors. It would be helpful to see the actual ejb-jar.xml and weblogic-ejb-jar.xml that gets generated by JBuilder.
Personally, I don't think you should use JBuilder to deploy your ejbs (and other J2EE components). It makes it very hard to create builds that are exactly reproduceable among all team members. You should look into using ANT to build your components to be deployed. This way all the team members can use the same build process and errors will be easily traceable. You can even use your ANT scripts to kick off Unit Tests. This can also lead itself easily to automation and allow you to take advantage of XP practices such as continous integration. I find continous integration extremely useful at identifying errors early.
As it is, you could merely have a difference in your JBuilder settings compared to your co-worker. This could be what is causing all of your problems.
Your problem could also result from the order of your deployments. Are you deploying separate ejb jars or just a single jar?
Last question, have you tried running ejbc on your jar outside of JBuilder? Does is pass compile correctly?
Mark Herschberg
Sheriff

Joined: Dec 04, 2000
Posts: 6037
First, thanks for replying, Chris.
Originally posted by Chris Mathews:
Actually my first guess would be JBuilder 8 did something funny with the descriptors. It would be helpful to see the actual ejb-jar.xml and weblogic-ejb-jar.xml that gets generated by JBuilder.

I was debating including them, I'll list them below.
Originally posted by Chris Mathews:
Personally, I don't think you should use JBuilder to deploy your ejbs (and other J2EE components). It makes it very hard to create builds that are exactly reproduceable among all team members. You should look into using ANT to build your components to be deployed. This way all the team members can use the same build process and errors will be easily traceable. You can even use your ANT scripts to kick off Unit Tests. This can also lead itself easily to automation and allow you to take advantage of XP practices such as continous integration. I find continous integration extremely useful at identifying errors early.

I would generally agree with you. However, We have only a 2 person development team, so coordinating settings shouldn't be too difficult. JBuilder has some nice features, like one-click deploy (and one-click unit testing, too), that make it very attractive, especially for small projects. We will probably ultimately switch to Ant at the end of development, so future iterations aren't tied to JBuilder, of course, event hen JBuilder can create the Ant files for us (I'll be sure to check them to make sure they are not JBuilder dependent).
Originally posted by Chris Mathews:
As it is, you could merely have a difference in your JBuilder settings compared to your co-worker. This could be what is causing all of your problems.
Your problem could also result from the order of your deployments. Are you deploying separate ejb jars or just a single jar?
Last question, have you tried running ejbc on your jar outside of JBuilder? Does is pass compile correctly?

Yes, it could be setting--although we haven't found anything yet.
Order of deployments? I'm deploying a single jar. Do you think I should put each bean into its own jar?
No, I haven't tried compiling seperately, but that's a good idea.
What we did find was some JBuilder idosynchrocies. In one case I accidentally had the bean set to "remote interface" as opposed to "local interface." I changed it using the EJB designer, but I didn't seem to update the descriptor files consistently with the other EJBs. We ultimately checked each JNDI name and interface name by hand to make sure we were calling the names to which they were set.

Here are the descriptor files:
ejb-jar.xml:


weblogic-ejb-jar.xml:

--Mark
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Mark Herschberg
I'm deploying a single jar. Do you think I should put each bean into its own jar?

Keep them all in one jar. They will be easier to maintain and an ejb-jar with N ejbs deploys faster than N ejb-jars.
Mark Herschberg
What we did find was some JBuilder idosynchrocies.

This is another reason I prefer using a build tool like Ant.
Mark Herschberg
JBuilder can create the Ant files for us

Are you sure? I know JBuilder supports Ant (only the $3000 version mind you) but I wasn't aware it supported generating Ant scripts for projects.
Onward to your problem...
Your deployment descriptors look fine to me, except that you do not specify the WebLogic JMS Queue for your MDB in your weblogic-ejb-jar.xml.
Looking in Google Groups it appears others have had this same problem, most during runtime though. There is at least one post of someone having this problem during deployment and he was using JBuilder to deploy. JBuilder has had deployment bugs with WebLogic in the past, so that could be an issue.
Have you done a diff between your DDs and your co-workers? If they are the same then the only other thing I can suggest is to delete all of WebLogic's working directories (.wlstaging, .wlnotdelete, etc.) and try to manually deploy the ejb-jar. Drop the jar into your Application directory and deploy thru the Admin console. If that does not work, then try to deploy your co-worker's ejb-jar (which works right?) on your WebLogic Server. At this point you should be able to tell if it is your build or your server that is causing the problems.
Mark Herschberg
Sheriff

Joined: Dec 04, 2000
Posts: 6037
Well, we're still not 100% certain of the cause, but it seems to be fixed. All I did was start over, and recreate the first bean. but the settings are all as before. My best guess is some bits didn't get switched when I switched some settings in the bean designer. Lesson learned: deploy one bean at a time. Thanks for your help, Chris.
--Mark
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Originally posted by Mark Herschberg:
Well, we're still not 100% certain of the cause, but it seems to be fixed. All I did was start over, and recreate the first bean. but the settings are all as before. My best guess is some bits didn't get switched when I switched some settings in the bean designer. Lesson learned: deploy one bean at a time. Thanks for your help, Chris.
--Mark

That is why I dislike using tools like JBuilder that hide settings for the sake of simplicity. Things are great and wonderful... until they break.
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Originally posted by Chris Mathews:

That is why I dislike using tools like JBuilder that hide settings for the sake of simplicity. Things are great and wonderful... until they break.

I just want to qualify my statements. I am referring to JBuilder's wizards, not JBuilder as an editor. I have used JBuilder since version 3.0 and it was my favorite IDE up until the first time I used IntellJ IDEA. IDEA is the best IDE I have ever used, regardless of platform (I have never worked with Smalltalk though).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deployment time NameNotFoundException