- This topic has 17 replies, 3 voices, and was last updated 21 years, 5 months ago by
Scott Anderson.
-
AuthorPosts
-
jcorbin4607MemberI was able to successfully run an EJB client program after deploying my ear to JBOSS 3.2.2RC1 using MyEclipse 2.6.2 and Eclipse 2.1.1. After upgrading my subscription and moving MyEclipse to 3.6 and Eclipse 3.0M3 I was unable to run the client and I get the following naming context error. I am not sure why it is happening now.
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.organizer.ejb.test.PetClient.main(PetClient.java:37)Any ideas?
J.D.
Scott AndersonParticipantJ.D.
Please check your JBoss preference page and make sure that you’ve entered everything exactly as you did in your 2.6.2 installation. Also, did your JBoss installation or JDK change in any way? The setting ‘java.naming.factory.initial’ is an environment property you need to provide when you create an InitialContext in order to tell your client what JNDI factory it should use. If you’re running your client in the same server (as is the case for an EAR-based webapp), just creating your context with ‘new InitialContext()’ should work fine. I know this was a bug in JBoss 3.0, referenced here (http://www.mail-archive.com/jboss-development@lists.sourceforge.net/msg36667.html), but it should be fixed in the version you’re running.
–Scott
MyEclipse Support
jcorbin4607MemberScott,
I verified my preference settings and none of the code changed. That is why I am confused by this. I am running a deployed ear and I have the jndi.properties set as I did before in JBOSS. The only thing I did was upgrade my subscription and downloaded and installed the latest version of Eclipse and MyEclipse IDE.
J.D.
support-michaelKeymasterJ.D.,
Scott and I have been consulting on your report. We still believe it is environmental or configuration in nature. This direction is based on the fact that there are no internal diffs between MyEclipse 2.x and MyEclipse 3.x. Let me confirm that you are running a standalone J2EE application-client program? If yes, is it separate Java project?
I’m extending 1 of our test cases to see if it will provide additional insights.
Michael
MyEclipse SupportI assume you have rebuilt the project, including XDoc
I’ll setup a test-case shortly to work from
jcorbin4607MemberGuys,
I wouldn’t be surprised if it is environmental. I just have no clue what I would have set in the previous version that I didn’t set when I upgraded my license and installed MyEclipseIde 3.6.x.
I have perused every setting I can imagine whether it is related to Eclipse, MyEclipseIDE or JBOSS with no luck.
I am attempting to run a client against my J2EE ear deployment and am using remote interface lookup calls.
One side note, and I believe I brought this up long ago, but I forgot how to fix it….
I created a session bean calling it PetBean and when I generate my remote interfaces through the XDoclet settings it generates the remote interface with the same name (PetBean). I cannot seem to remember which setting controls the naming of my remote and home interfaces. Can you guys provide this information?Thanks,
J.D.
p.s. I will keep looking into the original problem as I am getting closed to being stumped. 🙂
Scott AndersonParticipantJ.D.,
I cannot seem to remember which setting controls the naming of my remote and home interfaces. Can you guys provide this information?
The setting you’re looking for is ejbClassNameSuffix and its documentation is here: http://xdoclet.sourceforge.net/ant/xdoclet/modules/ejb/EjbDocletTask.html
To really compare the settings between two instances of Eclipse, you can dump the complete configuration by navigating to Help > About Eclipse Platform > Configuration Details. I believe if you compare the two environments you’ll be able to see where the difference lies.
Please keep us aprised of what you determine.
–Scott
MyEclipse Support
jcorbin4607MemberHow can I clear that configuration log? There are errors in it dating back from the 24th of September. I would like to clear it and restart MyEclipseIDE to see if they get generated each time.
Scott AndersonParticipantI assume you’re asking how to clear the error log portion. You can do this by simply shutting down Eclipse and deleting its log file which is located at:
<workspace>/.metadata/.log–Scott
MyEclipse Support
jcorbin4607MemberIn JBOSS there is a jndi.properties file that I hadn’t setup properly when I was running MyEclipseIDE 2.6.x. Once I set that up properly I was able to lookup remote EJB’s successulfMly through JBOSS. That file is still setup correctly but not getting recognized when running the JBOSS server within MyEclipseIDE. This file (jndi.properties in JBOSS installation) seems to play some part in the problem I am seeing. Not positive tho. Have you guys had any luck with your test case?
jcorbin4607MemberI did just find something interesting out….I was deploying to JBOSS as an exploded ear and it seemed to be deploying because I could see output scrolling when I deployed in the server console window. I switched to a packaged deployment and it doesn’t deploy the ear file to the /server/default/deploy directory. I cannot deploy my ear in JBOSS as a packaged archive in MyEclipseIDE 3.x.
jcorbin4607MemberSorry to throw so much at you guys, but there are some more issues I am running into….
I’ve verified that I have configured and setup JBOSS Server in the MyEclipseIDE preferences section. I was trying to remove an entry from the deployed application dialog (just have the ear deployment) and it fails saying that there are no configured servers (which is false because the prefences setup says it is). Something is hosed with my configuration. I might try reinstalling MyEclipseIDE into a fresh directory and instead of importing my existing projects, try creating them from scratch. It appears that my existing configuration is corrupted some how because the IDE doesn’t recognize settings correctly.
support-michaelKeymasterYou can test your server for proper configuration by attempting to start it from the toolbar. If it starts without complaint then it is a correct assumption that it is properly configured.
You can clear the deployment cache using the following steps:
1) Shutdown all appservers that may be running from Eclipse
2) Shutdown MyEclipse
3) Delete the file <workbench>/.metadata/.plugins/com.genuitec.eclipse.ast.deploy.core/pref_store.ini
4) Restart MyEclipse and attempt to deploy your applications.Also occasionally JBoss and several other servers will lock files such as a war or ear or files in your exploded deployment. When this happens you should observer a warning marker on project and/or in the deployment dialog.
Michael
MyEclipse Support
jcorbin4607MemberDo you have to specify the client jars for JBOSS in the classpath in MyEclipseIDE 3.6.x? I am getting a class not found exception for org.jnp.interfaces.NamingContextFactory and when I try to add the client jars from JBOSS to the append or prepend section of the JBOSS properties under App Servers, JBOSS fails to start properly.
If anyone has successfully gotten a JBOSS client ejb lookup against a Deployed EAR, I would love to hear how they setup MyEclipseIDE 3.x because I cannot figure it out.
J.D.
Scott AndersonParticipantJ.D.
Do you have to specify the client jars for JBOSS in the classpath in MyEclipseIDE 3.6.x?
That depends on where they’re located. JBoss will automatically load everything in the server’s lib directory because the jboss-service.xml file contains a line like this by default.
<classpath codebase="lib" archives="*"/>
If this doesn’t appear to be happening for you, please check your jboss-service.xml file to ensure it hasn’t been improperly edited.
You can add additional libraries to the JBoss launch by either adding them to the servers ‘lib’ directory or by adding another line similar to the one above to tell JBoss to load your libraries from another location. However, the recommended process for MyEclipse is to simply use our PATH configuration page to append the jars you need to the JBoss classpath on launch. Placing external jars in the ‘prepend’ area is really only necessary if you want to override some of JBoss’ functionality or if you’ve been shipped a patch of some sort (WebLogic used to use this mechanism). All other libraries should be added in the ‘append’ area.
when I try to add the client jars from JBOSS to the append or prepend section of the JBOSS properties under App Servers, JBOSS fails to start properly.
What errors are you seeing when you append the jars?
JBOSS client ejb lookup against a Deployed EAR
Are you asking about a client application that is outside the EAR, or deployed with it (like the war in the ear)?
–Scott
MyEclipse Support
jcorbin4607MemberJBOSS fails to startup when I specify client jars in the append to classpath section of the ApplicationServer/JBOSS configuration dialog. The errors are numerous but I’ve included a stack trace from the first error in the server log. JBOSS seems to startup fine as long as I don’t add any to the append class plath section.
So, to recap, I have added all the JBOSS client jars located in the client directory of the JBOSS installation and here is the first errors I am getting when I boot JBOSS.
Failed to boot JBoss:
java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.system.server.ServerInfo
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:160)
at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:159)
at org.jboss.mx.loading.UnifiedLoaderRepository3.loadClass(UnifiedLoaderRepository3.java:163)
at org.jboss.mx.loading.UnifiedLoaderRepository3.loadClass(UnifiedLoaderRepository3.java:551)
at javax.management.loading.DefaultLoaderRepository.loadClass(DefaultLoaderRepository.java:78)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:822)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:258)
at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:297)
at org.jboss.system.server.ServerImpl.createMBean(ServerImpl.java:411)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:342)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
at org.jboss.Main.boot(Main.java:150)
at org.jboss.Main$1.run(Main.java:388)
at java.lang.Thread.run(Thread.java:536)
07:37:13,560 ERROR [Server] Failed to start
java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.system.server.ServerInfo
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:160)
at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:159)
at org.jboss.mx.loading.UnifiedLoaderRepository3.loadClass(UnifiedLoaderRepository3.java:163)
at org.jboss.mx.loading.UnifiedLoaderRepository3.loadClass(UnifiedLoaderRepository3.java:551)
at javax.management.loading.DefaultLoaderRepository.loadClass(DefaultLoaderRepository.java:78)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:822)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:258)
at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:297)
at org.jboss.system.server.ServerImpl.createMBean(ServerImpl.java:411)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:342)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
at org.jboss.Main.boot(Main.java:150)
at org.jboss.Main$1.run(Main.java:388)
at java.lang.Thread.run(Thread.java:536) -
AuthorPosts