what is exact version of AS 7.1.x that you are using? there ware some bugs in CR1, all should be fixed in nightly builds after first week of january.
can you paste the stacktrace?
and you are sure that smtp is listening and accepting connection on localhost 25?
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?
1 of 1 people found this helpful
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?
That was the error! The context in AS7 has to be "org.jboss.as.naming.InitialContextFactory" instead of "org.jnp.interfaces.NamingContextFactory".
Thanks for all your help!