[EJB 3.0] - Re: Can you Inject Local EJB from separate ear file?
by jfrankman
Yes, the NexusEventDefinition class exists in both Jars.
I did try to use the jmx console, but when I invoked the listClasses method I got an error saying:
"Information
Not loaded in repository cache"
I could use the verbose setting, but do I really need to? I already know I have the same class deployed in two separate projects. I just need to know what I can do about it.
My research thus far shows that other people when confronted with this situation, removed the classes from both ear projects and packaged them into a separate jar file and deployed it on the jboss lib directory. I would prefer if there was a better way to to handle this than by splitting it.
I tried some suggestions on the wiki that said to use the jboss-app.xml file, but I could not add the changes because these files are alread configured for jboss seam:
<jboss-app>
| <loader-repository>
| seam.jboss.org:loader=NexusEvents
| </loader-repository>
|
| </jboss-app>
How can I tell JBoss to load a single NexusEventDefinition class but have it referenced from two different ears?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163925#4163925
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163925
17 years, 11 months
[EJB 3.0] - Re: Can you Inject Local EJB from separate ear file?
by jaikiran
anonymous wrote : NexusEventDefinition is a POJO with and @Entity annotation. The method on my session bean returns this pojo. I do not have an interface for it. Should I create an interface and modify the Session bean to return the interface instead of the class?
|
I had (incorrectly) assumed that nexusEventsService.findNexusEventDefinitionByName returns an bean interface. If its a POJO then you need not create an interface.
anonymous wrote :
| The packaging is as follows.
| 1. I have two ear projects: NexusEvents.ear and KeyB.ear.
| 2. I have a message driven bean in the KeyB.ear that I want to be able to call a session bean deployed in the NexusEvents.ear to return an instance of NexusEventDefinition.
| 3. I have exported the session bean interface and the NexusEventDefinition class out of my NexusEvents project into a jar named nexusevents.jar and have deployed it with the KeyB.ear.
Does the NexusEvents.ear too have the NexusEventDefinition class?
Also did the jmx-console method in that wiki help in identifying the jar which was being used to pick up this class? The other way to figure out which jar is being used to load this NexusEventDefinition class, is to add the -verbose:class option to the run.bat and pass it as a JVM option. This will print to STDOUT (i would recommend redirecting it too a file since the output will be a lot) the classes that are being loaded in the JVM and also the jars that are being used to load these classes. In that output, search for this NexusEventDefinition class and see which jar(s) are being used.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163918#4163918
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163918
17 years, 11 months
[JNDI/Naming/Network] - Re: Data Source JNDI lookup fails in a WAR
by jaikiran
anonymous wrote : org.springframework.jndi.JndiTemplate context = new org.springframework.jndi.JndiTemplate();
| context.lookup("java:TestDB");
Sorry, i dont have any experience with Spring. So i wont be able to provide much help on that part.
anonymous wrote : I already tried the InitialContext but it didn't work, I got a null.
That's real strange. I wouldn't expect a NULL to be returned from the lookup.
anonymous wrote : It have to be something with the differences between the EAR and WAR deploying but I didn't figure out what.
|
Looking up from a WAR or an EAR should not make a difference. Unless there are configuration files in your WAR application which might be messing up the lookup.
At this point, i am actually running out of ideas. How about trying this:
Properties props= new Properties();
|
| props.put(InitialContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
| props.put(InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099");
|
| Context ctx = new InitialContext(props);
| ctx.lookup("java:/TestDB");
|
I remember a similar issue in these forums, where a user was having problems getting the datasource lookup to work with Spring. Let me see if i can find that thread.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163914#4163914
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163914
17 years, 11 months