aspose file tools*
The moose likes JBoss/WildFly and the fly likes Jboss7 IIOP-Client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Jboss7 IIOP-Client" Watch "Jboss7 IIOP-Client" New topic
Author

Jboss7 IIOP-Client

Gary Dux
Greenhorn

Joined: Aug 14, 2008
Posts: 5
Hello together,

investigating "getting started" for Jboss7 i have an example for an IIOP-Configuration: jboss-as-quickstart-master\jts\application-component-2(https://github.com/jboss-jdf/jboss-as-quickstart)

there i found an jboss-ejb3.xml with configuration:
<?xml version="1.0" encoding="UTF-8"?>
<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:iiop="urn:iiop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
http://java.sun.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-spec-2_0.xsd
urn:iiop jboss-ejb-iiop_1_0.xsd"
version="3.1"
impl-version="2.0">
<assembly-descriptor>
<iiop:iiop>
<ejb-name>CounterBean</ejb-name>
<iiop:binding-name>org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean</iiop:binding-name>
</iiop:iiop>
</assembly-descriptor>
</jboss:ejb-jar>

And the Code calling this EJB from a Container would be like this:
@EJB(lookup = "corbaname:iiop:localhost:3628#org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean")
RemoteCounter counterBean;

My Question is, how would be the jndi.properies or else for the Client like this?

public static RemoteCounter lookupRemoteStatefulCounter() throws NamingException {
final Hashtable jndiProperties = new Hashtable();
jndiProperties.put(Context.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming");

//jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");
// jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
//jndiProperties.put(Context.PROVIDER_URL,"corbaloc::localhost:3528/JBoss/Naming/root");
// jndiProperties.put(Context.OBJECT_FACTORIES,"org.jboss.tm.iiop.client.IIOPClientUserTransactionObjectFactory");

final Context context = new InitialContext(jndiProperties);
String iiopJNDI = "corbaname:iiop:localhost:3528#org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean";

return (RemoteCounter) context.lookup(iiopJNDI);
}

My many attempts do not led to any success.

I know there is another way to "lookup" an ejb on Jboss7 but i need it on this way. Please do not come with answer from the same sample-collection(f.e. ejb-remote).








 
Consider Paul's rocket mass heater.
 
subject: Jboss7 IIOP-Client
 
Similar Threads
Error in
EJB3 - NullPointerException with @EJB Injection
javax.naming.NameNotFoundException: MyQueueName not bound
Problem of dependency injection in jboss
EJB3 Stateless Session Bean deployment failure on JBOSS 5.1.0 GA