-
1. Re: Remote EJB connection failed after migrating from AS7.1.0 to EAP6.1.0
wdfink Apr 21, 2013 10:33 AM (in response to totempole)You need to post a bit more information how you try to connect the EJB and show how the EJB is registered at server side.
-
2. Re: Remote EJB connection failed after migrating from AS7.1.0 to EAP6.1.0
wdfink Apr 21, 2013 10:34 AM (in response to totempole)Also I move the thread to the EAP6.1.Alpha forum
-
3. Re: Remote EJB connection failed after migrating from AS7.1.0 to EAP6.1.0
totempole Apr 22, 2013 12:12 AM (in response to wdfink)On the client side, the EJB client is proxied by Spring, like this,
<jee:remote-slsb id="bpmTaskListServiceRemote"
business-interface="***.***.***.BpmTaskListServiceRemote"
jndi-name="***-services-ear/BpmTaskListService/remote" cache-home="false" lookup-home-on-startup="true" expose-access-context="true"
resource-ref="false" refresh-home-on-connect-failure="true" environment-ref="jndiEnvironment" />
<util:properties id="jndiEnvironment">
<prop key="java.naming.factory.initial">${Jndi.Context.BusTier.java.naming.factory.initial}</prop>
<prop key="java.naming.factory.url.pkgs">${Jndi.Context.BusTier.java.naming.factory.url.pkgs}</prop>
<prop key="java.naming.provider.url">${Jndi.Context.BusTier.java.naming.provider.url}</prop>
<prop key="jboss.naming.client.ejb.context">${Jndi.Context.BusTier.jboss.naming.client.ejb.context}</prop>
<prop key="java.naming.security.principal">${Jndi.Context.BusTier.java.naming.security.principal}</prop>
<prop key="java.naming.security.credentials">${Jndi.Context.BusTier.java.naming.security.credentials}</prop>
</util:properties>
In my jboss-ejb-client.properties file,
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port=4447
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
Obviously, the same client works fine with the EAR deployed on AS7.1.0. While invoking the exact same EAR deployed on EAP6.1.0, I received the following error,
... nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.sprin
gframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.b
eans.factory.BeanCreationException: Error creating bean with name 'bpmTaskListServiceRemote': Invocation of init method failed; ne
sted exception is javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException
: Operation failed with status WAITING]
Note it is the exact same client on JBoss Portal 2.6.5GA, and the same EAR deployed to AS7.1.0 and EAP6.1.0. Tried different jboss-client.jar from AS7.1.0 and EAP6.1.0, I don't see any difference in the outcome. To rule out possible configuration issues, I tested a remote EJB client example in EAP quick start projects, and it worked with no issues. I didn't even tried "ejb-security-interceptors" in the above test case.
Any help will be greatly appreciated.
-
4. Re: Remote EJB connection failed after migrating from AS7.1.0 to EAP6.1.0
ctomc Apr 22, 2013 6:02 AM (in response to totempole)Hi,
change should be in xnio-*.jar and jboss-remoting.jar not in jboss-client.jar
check if this ones are newer / match the newer version of server.
--
tomaz
-
5. Re: Remote EJB connection failed after migrating from AS7.1.0 to EAP6.1.0
totempole Apr 22, 2013 9:18 AM (in response to ctomc)Thanks for the insight.
I tried declaring "jboss-as-ejb-client-bom" as a maven dependency, which ended up as a bunch of JARs including xnio-*.jar and jboss-remoting.jar. Later on, I realized that the holistic jboss-client.jar has everything inside, including the same xnio-*.jar and jboss-remoting.jar packages. However, despite how I swapped these JARs from AS7.1.0 and EAP6.1.0, the results are always the same error message.
-
6. Re: Remote EJB connection failed after migrating from AS7.1.0 to EAP6.1.0
totempole May 2, 2013 11:34 PM (in response to totempole)More findings to share with the community,
1. java.lang.IllegalStateException: No EJB receiver available for handling.
This error suggests a missing jboss-ejb-client.properties file. This thread discusses how to avoid the properties file, https://community.jboss.org/message/745410#745410.
2. Operation Failed with status WAITING
This message suggests a mismatch of Jboss remoting jars. It happened to me when I used AS7.1.0 jboss-client.jar to invoke ejbs on EAP6.1.0.
3. Failed to connect to any server. Servers tried: [remote://localhost:4447]
This error gave me a real hard time. I am not sure the exact cause of the error. However, it appears that the jboss-client.jar coming along with EAP6.1.0 only takes requests with "org.jboss.ejb.client.naming", meaning the jndi name must have an "ejb:/" prefix. I received the above vague message when "ejb:/" prefix is not specified. In the case that "org.jboss.ejb.client.naming" is not provided in the properties of InitialContext, I always received the same error, despite the ejb prefix was added or not. Is this a bug in EAP6.1.0?
-
7. Re: Remote EJB connection failed after migrating from AS7.1.0 to EAP6.1.0
wdfink May 3, 2013 3:31 AM (in response to totempole)totempole schrieb:
3. Failed to connect to any server. Servers tried: [remote://localhost:4447]
This error gave me a real hard time. I am not sure the exact cause of the error. However, it appears that the jboss-client.jar coming along with EAP6.1.0 only takes requests with "org.jboss.ejb.client.naming", meaning the jndi name must have an "ejb:/" prefix. I received the above vague message when "ejb:/" prefix is not specified. In the case that "org.jboss.ejb.client.naming" is not provided in the properties of InitialContext, I always received the same error, despite the ejb prefix was added or not. Is this a bug in EAP6.1.0?
There are several options to lookup the proxy.
The remote-naming (which I do not recomend to use fro ejb's) use the lookup name without 'ejb:' prefix and is initialized with InitialContext properties only. ProviderURL start with 'remote:'
Other posibility is to use the jboss-ejb-client.properties or the scoped-context which is initialized with InitialContext properies. Both need to have the "org.jboss.ejb.client.naming" property and the 'ejb:' prefix for lookup.
I think this is not a bug.
-
8. Re: Remote EJB connection failed after migrating from AS7.1.0 to EAP6.1.0
totempole May 3, 2013 11:03 AM (in response to wdfink)There are several options to lookup the proxy.
The remote-naming (which I do not recomend to use fro ejb's) use the lookup name without 'ejb:' prefix and is initialized with InitialContext properties only. ProviderURL start with 'remote:'
Other posibility is to use the jboss-ejb-client.properties or the scoped-context which is initialized with InitialContext properies. Both need to have the "org.jboss.ejb.client.naming" property and the 'ejb:' prefix for lookup.
I think this is not a bug.
The test is extremely simple. I took the "RemoteCalculator" example from jboss-eap-6.1.0.Alpha1-quickstarts projects. The sample standalone client makes use of "org.jboss.ejb.client.naming" with "ejb:/" jndi prefix, and it works with the ejb deployed on EAP6.1.0. Below is the code snippet to create the InitialContext,
private static RemoteCalculator lookupRemoteStatelessCalculator() 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.PROVIDER_URL, "remote://localhost:4447");
jndiProperties.put(Context.SECURITY_PRINCIPAL, "vwcadmin");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "vwc@admin1");
// jndiProperties.put("jboss.naming.client.ejb.context", "true");
final Context context = new InitialContext(jndiProperties);
return (RemoteCalculator) context.lookup(
"ejb:/jboss-as-ejb-remote-server-side/CalculatorBean!" + RemoteCalculator.class.getName()
);
}
Here is the jboss-ejb-client.properties file inside the client jar "jboss-as-ejb-remote-client.jar".
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port=4447
remote.connection.default.username=vwcadmin
remote.connection.default.password=vwc@admin1
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
To make use of "remote-naming", I made the following changes, and received the error "Failed to connect to any server. Servers tried: [remote://localhost:4447]"
private static RemoteCalculator lookupRemoteStatelessCalculator() 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.PROVIDER_URL, "remote://localhost:4447");
jndiProperties.put(Context.SECURITY_PRINCIPAL, "vwcadmin");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "vwc@admin1");
// jndiProperties.put("jboss.naming.client.ejb.context", "true");
final Context context = new InitialContext(jndiProperties);
return (RemoteCalculator) context.lookup(
"jboss-as-ejb-remote-server-side/CalculatorBean!" + RemoteCalculator.class.getName()
);
}
No changes were made to the jboss-ejb-client.properties file.
Any thought?
-
9. Re: Remote EJB connection failed after migrating from AS7.1.0 to EAP6.1.0
totempole May 3, 2013 4:25 PM (in response to totempole)totempole wrote:
There are several options to lookup the proxy.
The remote-naming (which I do not recomend to use fro ejb's) use the lookup name without 'ejb:' prefix and is initialized with InitialContext properties only. ProviderURL start with 'remote:'
Other posibility is to use the jboss-ejb-client.properties or the scoped-context which is initialized with InitialContext properies. Both need to have the "org.jboss.ejb.client.naming" property and the 'ejb:' prefix for lookup.
I think this is not a bug.
The test is extremely simple. I took the "RemoteCalculator" example from jboss-eap-6.1.0.Alpha1-quickstarts projects. The sample standalone client makes use of "org.jboss.ejb.client.naming" with "ejb:/" jndi prefix, and it works with the ejb deployed on EAP6.1.0. Below is the code snippet to create the InitialContext,
private static RemoteCalculator lookupRemoteStatelessCalculator() 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.PROVIDER_URL, "remote://localhost:4447");
jndiProperties.put(Context.SECURITY_PRINCIPAL, "vwcadmin");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "vwc@admin1");
// jndiProperties.put("jboss.naming.client.ejb.context", "true");
final Context context = new InitialContext(jndiProperties);
return (RemoteCalculator) context.lookup(
"ejb:/jboss-as-ejb-remote-server-side/CalculatorBean!" + RemoteCalculator.class.getName()
);
}
Here is the jboss-ejb-client.properties file inside the client jar "jboss-as-ejb-remote-client.jar".
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port=4447
remote.connection.default.username=vwcadmin
remote.connection.default.password=vwc@admin1
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
To make use of "remote-naming", I made the following changes, and received the error "Failed to connect to any server. Servers tried: [remote://localhost:4447]"
private static RemoteCalculator lookupRemoteStatelessCalculator() 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.PROVIDER_URL, "remote://localhost:4447");
jndiProperties.put(Context.SECURITY_PRINCIPAL, "vwcadmin");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "vwc@admin1");
// jndiProperties.put("jboss.naming.client.ejb.context", "true");
final Context context = new InitialContext(jndiProperties);
return (RemoteCalculator) context.lookup(
"jboss-as-ejb-remote-server-side/CalculatorBean!" + RemoteCalculator.class.getName()
);
}
No changes were made to the jboss-ejb-client.properties file.
Any thought?
Interesting enough, the second test case now works with EAP6.1.0 Beta, which was just released today!
What I did is deploying the exact same app jboss-as-ejb-remote-server-side.jar to EAP6.1.0 Beta, and there is no touch on the client side whatsoever.
-
10. Re: Remote EJB connection failed after migrating from AS7.1.0 to EAP6.1.0
totempole May 6, 2013 10:36 AM (in response to totempole)Nailed down the problem eventually. The highlighted element was missing from our standalone.xml file. Once added back, the problem is gone.
<subsystem xmlns="urn:jboss:domain:naming:1.2">
<remote-naming/>
</subsystem>
However, AS7.1.1Final doesn't seem to be affected by the missing <remote-naming/> element at all. It simply works without the <remote-naming/>.
Thanks