EJB Context



Reviewing some EJBs I started to play with some attributes of the Context.

//this returns java.naming.factory.initial:
//this returns java.naming.provider.url:


EJB Port

The default http port is 8080, given in .

So if you use an offset <port-offset=”${jboss.socket.binding.port-offset:100}”> change Context.PROVIDER_URL,”remote+http://localhost:8180″);  the otherwise, you will get a connection refused:

javax.naming.CommunicationException: WFNAM00018: Failed to connect to remote host [Root exception is java.net.ConnectException: Connection refused]
at (…)

at javax.naming.InitialContext.listBindings(InitialContext.java:472)
at StandaloneJNDI.main(StandaloneJNDI.java:27)
Caused by: java.net.ConnectException: Connection refused

EJB context




context.unbiding will return:

21:26:16,717 INFO [org.wildfly.naming] (default task-1) WildFly Naming version 1.0.11.Final-redhat-00001
21:26:16,746 WARN [org.wildfly.naming] (default task-2) WFNAM00036: Unexpected internal error: java.lang.UnsupportedOperationException:  : Naming context is read-only
at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:160)
at org.jboss.as.naming.WritableServiceBasedNamingStore.unbind(WritableServiceBasedNamingStore.java:131)
at org.jboss.as.naming.NamingContext.unbind(NamingContext.java:318)

The code is on Github


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s