Facundo Contrera wrote:
Caused by: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
The method that gave my that exception is javax.naming.Context.lookup(String name)
What does your jndi.properties (if any) or the InitialContext properties that you use look like?
There isn't any jndi.properties, I just config the standalone.xml. The Context I use is "org.jnp.interfaces.NamingContextFactory" (the same I used for jboss-5.1.0.GA).
I think that the error is not because socket binding or port, or whatever... but because of that Naming Factory which doesn't recognize java:/Mail as a properly JNDI Name.
I saw that in the mail-service.xml in JBoss 5 we had to add the "<depends>jboss:service=Naming</depends>", but in JBoss 7.1 I haven't configurated anything in the subsystem "naming".
Does this make any sense?
From where are you trying to do jndi lookup? from inside the application that is deployed in AS7?
if that is the case you just use default NamingContextFactory. org.jnp.interfaces.NamingContextFactory does not exits anymore in AS7.
Here is sample code that will get you mail session:
InitialContext ic = new InitialContext(); Session s = (Session)ic.lookup("java:/Mail); ic.close();
that is all of the code needed (i have omited try catch), no special InitialContext setup and passing properties
can you try this?