-
1. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
jaikiran Oct 2, 2013 11:43 AM (in response to kparasam)1 of 1 people found this helpful -
2. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
kparasam Oct 2, 2013 12:50 PM (in response to jaikiran)Thank you. Is there any other branch or something. Its failing to get dependencies.
[ERROR] Failed to execute goal on project jboss-remote-naming: Could not resolve dependencies for project org.jboss:jboss-remote-naming:jar:2.0.0.Beta
3-SNAPSHOT: Failure to find org.jboss.remoting:jboss-remoting:jar:4.0.0.Beta1 in http://repo.maven.apache.org/maven2 was cached in the local repositor
y, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project jboss-remote-naming: Could not resolve dependencies for proj
ect org.jboss:jboss-remote-naming:jar:2.0.0.Beta3-SNAPSHOT: Failure to find org.jboss.remoting:jboss-remoting:jar:4.0.0.Beta1 in http://repo.maven.apa
che.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are
forced
-
3. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
kparasam Oct 2, 2013 1:54 PM (in response to kparasam)I'm looking to set the client timeout - 5000L which is hard-coded here. I want a much faster way for the client to know in case of JBoss server failure.
RemoteNamingStore namingStore = getOrCreateNamingStore(env, findAndCreateClientProperties(env), OptionMap.EMPTY, 5000L, closeTasks);
Based on:
Caused by: java.lang.RuntimeException: Operation failed with status WAITING
at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:89)
at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)
at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)
at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)
at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)
Please reply. Thanks !
-
4. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
kparasam Oct 2, 2013 4:10 PM (in response to kparasam)Do you know which version went in for 7.1.1.Final ? I tried with 1.0.2.Final which looked closest - compiled and injected the InitialContextFactory.class file in jboss-client.jar. But, I'm getting some other exception mentioned below.
Caused by: java.lang.NoSuchMethodError: org.jboss.naming.remote.client.InitialContextFactory$AuthenticationCallbackHandler.<init>(Lorg/jboss/naming/remote/client/InitialContextFactory;Ljava/lang/String;[CLjava/lang/String;Lorg/jboss/naming/remote/client/InitialContextFactory$AuthenticationCallbackHandler;)V
Please let me know if I'm missing anything. Thanks !
-
5. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
jaikiran Oct 2, 2013 11:50 PM (in response to kparasam)It's not hardcoded. That's just the default value. The client application can pass the jboss.naming.client.connect.timeout property with an appropriate value, while creating the context, to change the timeout.
-
6. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
kparasam Oct 3, 2013 7:31 AM (in response to jaikiran)Ok. Thanks. I've already tried this, but it doesn't work.
..other env properties...
envProp.put("jboss.naming.client.connect.timeout", 2000); // or 2000L
initialContext = new InitialContext(envProp);
This is how I create the context. But, I always see the exception only after 5+ seconds. Please let me know what could be wrong.
[javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: Operation failed with status WAITING]]
-
7. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
jaikiran Oct 3, 2013 8:25 AM (in response to kparasam)Please post the exact code and the entire exception stacktrace. What would also help is if you put a System.out.println() to print the current time just before creating that InitialContext
-
8. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
thukprav2 Oct 3, 2013 9:28 AM (in response to jaikiran)HI Jaikiran,
I know this is not Right Thread to Post My Question. But I'm new to JBPM and heard that you are the Top most participant here...
I'm new to JBPM and i have created Basic work flow and i need to Integrate JBPM with UI(Which has developed in Java script+HTML) They are passing Object as JSON Object from UI. How can i take my JSON Object and Integrate with JBPM.
Please help me if u r in India i'm really ready to call you also as i have demo on next week
Will be waiting for your quick reply
-
9. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
kparasam Oct 3, 2013 9:51 AM (in response to kparasam)Here's my whole client code. The service is actually running on port 4447 but I'm trying to look up on 4448.
import java.util.Date;
import java.util.Properties;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class JMSClient
{
private Properties envProp = new Properties();
private String jmsHostIP = "";
private String connectToHost = "";
private String appUser = "";
private String appPwd = "";
private String destinationQueue = "";
private QueueConnection queCon;
private QueueSession session;
private Queue queue;
private QueueSender sender = null;
private InitialContext initialContext;
public JMSClient() throws JMSException, NamingException, Exception {
jmsHostIP = "10.0.40.169:4448";
connectToHost = "remote://"+jmsHostIP;
appUser = "jmsfpds";
appPwd = "jms4fpds";
destinationQueue = "jms/queue/fpds";
envProp.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
envProp.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
envProp.setProperty(Context.PROVIDER_URL, connectToHost);
envProp.put(Context.SECURITY_PRINCIPAL, appUser);
envProp.put(Context.SECURITY_CREDENTIALS, appPwd);
envProp.put("jboss.naming.client.connect.timeout", 2000);
initialContext = new InitialContext(envProp);
Object conObject = initialContext.lookup("jms/RemoteConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) conObject;
queCon = qcf.createQueueConnection(appUser, appPwd);
queue = (Queue) initialContext.lookup(destinationQueue);
queCon.start();
session = queCon.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE); // Create a session for the queue
sender = session.createSender(queue);
}
public void sendLogInfoToQueue(String message)
throws JMSException, NamingException, Exception {
// sender.send();
}
public static void main(String args[]) {
long t1 = 0;
long total = 0;
try{
t1 = (new Date()).getTime();
JMSClient c = new JMSClient();
c.sendLogInfoToQueue("message");
long t2 = (new Date()).getTime();
total += (t2-t1);
System.out.println("Sent: ");
System.out.println("Time: " + total);
}catch(Exception e) {
e.printStackTrace();
long t3 = (new Date()).getTime();
total += (t3-t1);
System.out.println("Not sent:");
System.out.println("Time for timeout: " + total);
}
}
}
StackTrace:
Oct 3, 2013 9:49:04 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.3.GA
Oct 3, 2013 9:49:04 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.3.GA
Oct 3, 2013 9:49:04 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.3.GA
javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: Operation failed with status WAITING]
at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)
at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at JMSClient.<init>(JMSClient.java:43)
at JMSClient.main(JMSClient.java:66)
Caused by: java.lang.RuntimeException: Operation failed with status WAITING
at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:89)
at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)
at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)
at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)
at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)
... 6 more
Not sent:
Time for timeout: 5221
-
10. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
kparasam Oct 4, 2013 9:19 AM (in response to kparasam)Any update on this ? Thanks !
-
11. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
jaikiran Oct 4, 2013 11:57 AM (in response to kparasam)I haven't fully looked at it, but could you quickly try it by updating your client classpath to use 1.0.7.Final version of jboss-remote-naming https://repository.jboss.org/nexus/content/repositories/releases/org/jboss/jboss-remote-naming/1.0.7.Final/
-
12. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
kparasam Oct 7, 2013 10:11 AM (in response to jaikiran)Getting a java.lang.NoClassDefFoundError: org/jboss/ejb/client/EJBClientContextIdentifier for 1.0.7.Final jboss-remote-naming.
-
13. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
kparasam Oct 7, 2013 5:48 PM (in response to kparasam)Any update ? Waiting for the reply. Thanks !
-
14. Re: Source code for - org.jboss.naming.remote.client.InitialContextFactory - jboss 7.1.1.Final
kparasam Oct 9, 2013 8:56 AM (in response to kparasam)I think that the EJBClientContextIdentifier class is not dependent for context lookup. The lookup still took 5+ seconds in case of wrong port. Can you please confirm if this is a bug in the client library ? What could be a possible solution ? I need to have it working ASAP. Thanks !