JBoss Community

Problems with JBoss 7 and remote-interface lookup with context

created by Hauke Gulich in JNDI and Naming - View the full discussion

Hello everyone,

 

I used to work with jboss 4.2.3 GA and there everything worked fine (at least calling the remote interface from the client side). Now I try to deploy that with Jboss 7.0.1 FINAL

I have (on the server project) this class:

@Remote(ConfigurationHelperRemote.class)
@Local(ConfigurationHelperLocal.class)
@Stateless
public class ConfigurationHelper implements ConfigurationHelperRemote,  ConfigurationHelperLocal {
  
...
}

and I have the remote Interface

@Remote
public interface ConfigurationHelperRemote {
 
...
}

Now I used to call the remote interface from the client side with the help of context like this:

configurationHelper = (ConfigurationHelperRemote) ctx.lookup("ear-1.0.0/ConfigurationHelper/remote");

But this isn't working anymore. Now I get this error message

javax.naming.NameNotFoundException: Name 'ear-1.0.0' not found in context ''

My ear file is called ear-1.0.0.ear and the  client inside is called client-1.0.0.war and the server is called server-1.0.0.jar.

This is the content of the application.xml inside the ear file

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
  
<display-name>ear</display-name>
    
<module>
     
<web>
      
<web-uri>client-1.0.0.war</web-uri>
      
<context-root>/client</context-root>
    
</web>
   
</module>
  
<module>
   
<ejb>server-1.0.0.jar</ejb>
  
</module>
</application>

Where do I need to configure the context name? Or what I am doing wrong?

 

I just printed out all JNDI Context Information, and there is only the datasource from the database. I did this:

      public static void showJndiContext( Context ctx, String name, String space )
  
{
     
if( null == name  ) name  = "";
     
if( null == space ) space = "";
     
try {
        
NamingEnumeration<NameClassPair> en = ctx.list( name );
        
while( en != null && en.hasMoreElements() ) {
           
String delim = ( name.length() > 0 ) ? "/" : "";
           
NameClassPair ncp = en.next();
           
System.out.println( space + name + delim + ncp );
           
if( space.length() < 40 )
               showJndiContext
( ctx, ncp.getName(), "    " + space );
        
}
     
} catch( javax.naming.NamingException ex ) {

     
}
  
}

Thanks a lot and many greetings,

Hauke

Reply to this message by going to Community

Start a new discussion in JNDI and Naming at Community