Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 585 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 46 Data Integration
- 46 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 667 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 Portuguese
jndi unknown source with jms

932533
Member Posts: 8
I am trying jms example but i have problen while in lookup ,i could not find the resource running in the sun app server.
the below is the code
import javax.jms.*;
import javax.naming.*;
import java.util.*;
public class SimpleTopicPublisher {
/**
* Main method.
*
* @param args the topic used by the example and,
* optionally, the number of messages to send
*/
public static void main(String[] args) {
String topicName = null;
Context jndiContext = null;
TopicConnectionFactory topicConnectionFactory = null;
TopicConnection topicConnection = null;
TopicSession topicSession = null;
Topic topic = null;
TopicPublisher topicPublisher = null;
TextMessage message = null;
final int NUM_MSGS;
if ( (args.length < 1) || (args.length > 2) ) {
System.out.println("Usage: java " +
"SimpleTopicPublisher <topic-name> " +
"[<number-of-messages>]");
System.exit(1);
}
topicName = new String(args[0]);
System.out.println("Topic name is " + topicName);
if (args.length == 2){
NUM_MSGS = (new Integer(args[1])).intValue();
} else {
NUM_MSGS = 1;
}
/*
* Create a JNDI API InitialContext object if none exists
* yet.
*/
try {
// String url = "mq://INBANN0L3CT171.ap01.lucent.com:7676/";
// Properties p = new Properties();
//p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.appserv.naming.S1ASCtxFactory");
// p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
//p.put(Context.PROVIDER_URL, url);
//ctx = new InitialContext(p);
jndiContext = new InitialContext();
} catch (NamingException e) {
System.out.println("Could not create JNDI API " +
"context: " + e.toString());
e.printStackTrace();
System.exit(1);
}
/*
* Look up connection factory and topic. If either does
* not exist, exit.
*/
try {
topicConnectionFactory = (TopicConnectionFactory)
jndiContext.lookup("jms/myjms");
topic = (Topic) jndiContext.lookup(topicName);
} catch (NamingException e) {
System.out.println("JNDI API lookup failed: " +
e.toString());
e.printStackTrace();
System.exit(1);
}
/*
* Create connection.
* Create session from connection; false means session is
* not transacted.
* Create publisher and text message.
* Send messages, varying text slightly.
* Finally, close connection.
*/
try {
topicConnection =
topicConnectionFactory.createTopicConnection();
topicSession =
topicConnection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
topicPublisher = topicSession.createPublisher(topic);
message = topicSession.createTextMessage();
for (int i = 0; i < NUM_MSGS; i++) {
message.setText("This is message " + (i + 1));
System.out.println("Publishing message: " +
message.getText());
topicPublisher.publish(message);
}
} catch (JMSException e) {
System.out.println("Exception occurred: " +
e.toString());
} finally {
if (topicConnection != null) {
try {
topicConnection.close();
} catch (JMSException e) {}
}
}
}
}
and below is the error while running
\>java SimpleTopicPublisher mytopic 3
Topic name is mytopic
Apr 23, 2012 5:03:48 PM com.sun.enterprise.v3.server.CommonClassLoaderServiceIm
l findDerbyClient
INFO: Cannot find javadb client jar file, derby jdbc driver will not be availab
e by default.
JNDI API lookup failed: javax.naming.NamingException: Lookup failed for 'java:c
mp/env/jms/myjms' in SerialContext[myEnv={java.naming.factory.initial=com.sun.e
terprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com
sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presenta
ion.rmi.JNDIStateFactoryImpl} [Root exception is javax.naming.NamingException:
nvocation exception: Got null ComponentInvocation ]
javax.naming.NamingException: Lookup failed for 'java:comp/env/jms/myjms' in Se
ialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.Se
ialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.naming,
ava.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactor
Impl} [Root exception is javax.naming.NamingException: Invocation exception: Go
null ComponentInvocation ]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:455)
at javax.naming.InitialContext.lookup(Unknown Source)
at SimpleTopicPublisher.main(SimpleTopicPublisher.java:112)
Caused by: javax.naming.NamingException: Invocation exception: Got null Compone
tInvocation
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.getCompone
tId(GlassfishNamingManagerImpl.java:873)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(Gla
sfishNamingManagerImpl.java:742)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.
ava:169)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:498)
... 3 more
\>javac SimpleTopicPublisher.java
\>java SimpleTopicPublisher mytopic 3
Topic name is mytopic
Apr 23, 2012 5:09:28 PM com.sun.enterprise.v3.server.CommonClassLoaderServiceIm
l findDerbyClient
INFO: Cannot find javadb client jar file, derby jdbc driver will not be availab
e by default.
java.lang.ClassCastException
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(Portable
emoteObject.java:262)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at com.sun.enterprise.naming.impl.SerialContext$ProviderCacheKey.getNam
Service(SerialContext.java:1244)
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(Seria
Context.java:410)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialConte
t.java:346)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:504)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:455)
at javax.naming.InitialContext.lookup(Unknown Source)
at SimpleTopicPublisher.main(SimpleTopicPublisher.java:112)
Caused by: java.lang.ClassCastException: Object is not of remote type com.sun.e
terprise.naming.impl.SerialContextProvider
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(Portable
emoteObject.java:254)
... 8 more
JNDI API lookup failed: javax.naming.NamingException: Lookup failed for 'jms/my
ms' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.nami
g.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterpris
.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIS
ateFactoryImpl} [Root exception is javax.naming.NamingException: Unable to acqu
re SerialContextProvider for SerialContext[myEnv={java.naming.factory.initial=c
m.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.
kgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.
resentation.rmi.JNDIStateFactoryImpl} [Root exception is java.lang.ClassCastExc
ption]]
javax.naming.NamingException: Lookup failed for 'jms/myjms' in SerialContext[my
nv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContex
Factory, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.fa
tory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root e
ception is javax.naming.NamingException: Unable to acquire SerialContextProvide
for SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming
impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.
aming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDISta
eFactoryImpl} [Root exception is java.lang.ClassCastException]]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:455)
at javax.naming.InitialContext.lookup(Unknown Source)
at SimpleTopicPublisher.main(SimpleTopicPublisher.java:112)
Caused by: javax.naming.NamingException: Unable to acquire SerialContextProvide
for SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming
impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.
aming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDISta
eFactoryImpl} [Root exception is java.lang.ClassCastException]
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialConte
t.java:351)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:504)
... 3 more
Caused by: java.lang.ClassCastException
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(Portable
emoteObject.java:262)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at com.sun.enterprise.naming.impl.SerialContext$ProviderCacheKey.getNam
Service(SerialContext.java:1244)
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(Seria
Context.java:410)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialConte
t.java:346)
... 4 more
Caused by: java.lang.ClassCastException: Object is not of remote type com.sun.e
terprise.naming.impl.SerialContextProvider
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(Portable
emoteObject.java:254)
... 8 more
plese help me in resolving...
the below is the code
import javax.jms.*;
import javax.naming.*;
import java.util.*;
public class SimpleTopicPublisher {
/**
* Main method.
*
* @param args the topic used by the example and,
* optionally, the number of messages to send
*/
public static void main(String[] args) {
String topicName = null;
Context jndiContext = null;
TopicConnectionFactory topicConnectionFactory = null;
TopicConnection topicConnection = null;
TopicSession topicSession = null;
Topic topic = null;
TopicPublisher topicPublisher = null;
TextMessage message = null;
final int NUM_MSGS;
if ( (args.length < 1) || (args.length > 2) ) {
System.out.println("Usage: java " +
"SimpleTopicPublisher <topic-name> " +
"[<number-of-messages>]");
System.exit(1);
}
topicName = new String(args[0]);
System.out.println("Topic name is " + topicName);
if (args.length == 2){
NUM_MSGS = (new Integer(args[1])).intValue();
} else {
NUM_MSGS = 1;
}
/*
* Create a JNDI API InitialContext object if none exists
* yet.
*/
try {
// String url = "mq://INBANN0L3CT171.ap01.lucent.com:7676/";
// Properties p = new Properties();
//p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.appserv.naming.S1ASCtxFactory");
// p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
//p.put(Context.PROVIDER_URL, url);
//ctx = new InitialContext(p);
jndiContext = new InitialContext();
} catch (NamingException e) {
System.out.println("Could not create JNDI API " +
"context: " + e.toString());
e.printStackTrace();
System.exit(1);
}
/*
* Look up connection factory and topic. If either does
* not exist, exit.
*/
try {
topicConnectionFactory = (TopicConnectionFactory)
jndiContext.lookup("jms/myjms");
topic = (Topic) jndiContext.lookup(topicName);
} catch (NamingException e) {
System.out.println("JNDI API lookup failed: " +
e.toString());
e.printStackTrace();
System.exit(1);
}
/*
* Create connection.
* Create session from connection; false means session is
* not transacted.
* Create publisher and text message.
* Send messages, varying text slightly.
* Finally, close connection.
*/
try {
topicConnection =
topicConnectionFactory.createTopicConnection();
topicSession =
topicConnection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
topicPublisher = topicSession.createPublisher(topic);
message = topicSession.createTextMessage();
for (int i = 0; i < NUM_MSGS; i++) {
message.setText("This is message " + (i + 1));
System.out.println("Publishing message: " +
message.getText());
topicPublisher.publish(message);
}
} catch (JMSException e) {
System.out.println("Exception occurred: " +
e.toString());
} finally {
if (topicConnection != null) {
try {
topicConnection.close();
} catch (JMSException e) {}
}
}
}
}
and below is the error while running

Topic name is mytopic
Apr 23, 2012 5:03:48 PM com.sun.enterprise.v3.server.CommonClassLoaderServiceIm
l findDerbyClient
INFO: Cannot find javadb client jar file, derby jdbc driver will not be availab
e by default.
JNDI API lookup failed: javax.naming.NamingException: Lookup failed for 'java:c
mp/env/jms/myjms' in SerialContext[myEnv={java.naming.factory.initial=com.sun.e
terprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com
sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presenta
ion.rmi.JNDIStateFactoryImpl} [Root exception is javax.naming.NamingException:
nvocation exception: Got null ComponentInvocation ]
javax.naming.NamingException: Lookup failed for 'java:comp/env/jms/myjms' in Se
ialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.Se
ialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.naming,
ava.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactor
Impl} [Root exception is javax.naming.NamingException: Invocation exception: Go
null ComponentInvocation ]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:455)
at javax.naming.InitialContext.lookup(Unknown Source)
at SimpleTopicPublisher.main(SimpleTopicPublisher.java:112)
Caused by: javax.naming.NamingException: Invocation exception: Got null Compone
tInvocation
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.getCompone
tId(GlassfishNamingManagerImpl.java:873)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(Gla
sfishNamingManagerImpl.java:742)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.
ava:169)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:498)
... 3 more


Topic name is mytopic
Apr 23, 2012 5:09:28 PM com.sun.enterprise.v3.server.CommonClassLoaderServiceIm
l findDerbyClient
INFO: Cannot find javadb client jar file, derby jdbc driver will not be availab
e by default.
java.lang.ClassCastException
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(Portable
emoteObject.java:262)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at com.sun.enterprise.naming.impl.SerialContext$ProviderCacheKey.getNam
Service(SerialContext.java:1244)
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(Seria
Context.java:410)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialConte
t.java:346)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:504)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:455)
at javax.naming.InitialContext.lookup(Unknown Source)
at SimpleTopicPublisher.main(SimpleTopicPublisher.java:112)
Caused by: java.lang.ClassCastException: Object is not of remote type com.sun.e
terprise.naming.impl.SerialContextProvider
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(Portable
emoteObject.java:254)
... 8 more
JNDI API lookup failed: javax.naming.NamingException: Lookup failed for 'jms/my
ms' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.nami
g.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterpris
.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIS
ateFactoryImpl} [Root exception is javax.naming.NamingException: Unable to acqu
re SerialContextProvider for SerialContext[myEnv={java.naming.factory.initial=c
m.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.
kgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.
resentation.rmi.JNDIStateFactoryImpl} [Root exception is java.lang.ClassCastExc
ption]]
javax.naming.NamingException: Lookup failed for 'jms/myjms' in SerialContext[my
nv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContex
Factory, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.fa
tory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root e
ception is javax.naming.NamingException: Unable to acquire SerialContextProvide
for SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming
impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.
aming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDISta
eFactoryImpl} [Root exception is java.lang.ClassCastException]]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:455)
at javax.naming.InitialContext.lookup(Unknown Source)
at SimpleTopicPublisher.main(SimpleTopicPublisher.java:112)
Caused by: javax.naming.NamingException: Unable to acquire SerialContextProvide
for SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming
impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.
aming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDISta
eFactoryImpl} [Root exception is java.lang.ClassCastException]
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialConte
t.java:351)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.ja
a:504)
... 3 more
Caused by: java.lang.ClassCastException
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(Portable
emoteObject.java:262)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at com.sun.enterprise.naming.impl.SerialContext$ProviderCacheKey.getNam
Service(SerialContext.java:1244)
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(Seria
Context.java:410)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialConte
t.java:346)
... 4 more
Caused by: java.lang.ClassCastException: Object is not of remote type com.sun.e
terprise.naming.impl.SerialContextProvider
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(Portable
emoteObject.java:254)
... 8 more
plese help me in resolving...
Answers
-
I suspect that if you use the code you have commented out it will work. You're running a standalone client, which isn't in the Sun app-server environment, so the default InitialContext and the "jms/myjms" namespace don't exist the way they do in the app server.
-
i am still getting the same error, please tell me what should be the url for InitialContext?
// String url = "mq://INBANN0L3CT171.ap01.lucent.com:7676/";*
// Properties p = new Properties();
//p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.appserv.naming.S1ASCtxFactory");
// p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
//p.put(Context.PROVIDER_URL, url);
//ctx = new InitialContext(p);
in the above code what should be the correct url?
since i am running the client instead in app server...
Thanks
Srinivasula Reddy -
How would I know? It's your system.
-
You say you're using using the Sun application server. That's been called GlassFish for several years. I recommend using the latest version, 3.2.
Your code is trying to look up a TopicConnectionFactory from JNDI, using
topicConnectionFactory = (TopicConnectionFactory) jndiContext.lookup("jms/myjms");
and it is trying to look up a Topic object from JNDI using
topic = (Topic) jndiContext.lookup(topicName);
where you previous set topicName to some value using some code I didn't follow. This needs to be another JNDI name. Let's call it "jms/myTopic" for the purpose of discussion.( Note that the JNDI name where you lookup a Topic is not the same as the name of the topic)
The first thing you need to do is to go into the GlassFish administration console and manually use it to create the Topic and TopicConnectionFactory objects and bind them into JNDI using the names above. When you create the Topic object you'll need to supply both the name of the topic and the name of the JNDI location where you are storing it.
Now you can try to run your client which will create an InitialContext and use it to look the objects you have just created. The GlassFish documentation explains how to configure an InitialContext to connect to GlassFish's built-in JNDI provider. Here it is:
http://docs.oracle.com/cd/E18930_01/html/821-2418/gkusn.html
("Developing clients without the ACC")
This covers creating an InitialContext and using it to look up EJBs, but the same settings apply yo looking up other JNDI objects. If you scroll down to the section "To access a JMS resource from a stand-alone client" there's some additional information about looking up JMS resources, but the way you configure the InitialContext is the same.
If you have more problems using GlassFish I'd suggest asking on the GlassFish user forum at http://www.java.net/forums/glassfish/glassfish
Nigel -
The OP's client consists of a main() method which does not execute in the Glassfish environment.
As already stated. -
EJP wrote:The link I gave above takes you to the place in the GlassFish documentation which describes how to access GlassFish JNDI resources (such as connection factories and topics) from a ordinary client with its own main() method.
The OP's client consists of a main() method which does not execute in the Glassfish environment.
Nigel -
the folloing is the error in finding out the iiop port
\Documents and Settings\test>asadmin get "configs.config.server-config.iiop-se
rvice.iiop-listener.orb-listener-1.*"
No matches resulted from the wildcard expression.
CLI137 Command get failed.\Documents and Settings\test>
String url = "iiop://135.250.22.167:3700";
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.appserv.naming.S1ASCtxFactory");
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
p.put(Context.PROVIDER_URL, url);
jndiContext = new InitialContext(p);
and the following is the error\>java SimpleTopicPublisher jms/MyTopic 3
Topic name is jms/MyTopic
Apr 25, 2012 4:24:28 PM com.sun.enterprise.v3.server.CommonClassLoaderServiceImp
l findDerbyClient
INFO: Cannot find javadb client jar file, derby jdbc driver will not be availabl
e by default.
org.omg.CORBA.COMM_FAILURE: FINE: IOP00410001: Connection failure: socketType: I
IOP_CLEAR_TEXT; hostname: localhost; port: 3700 vmcid: OMG minor code: 1 comp
leted: No
at sun.reflect.GeneratedConstructorAccessor29.newInstance(Unknown Source
)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException
(CorbaExtension.java:248)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException
(CorbaExtension.java:95)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging
(WrapperGenerator.java:387)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(Wrappe
rGenerator.java:107)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperG
enerator.java:511)
at com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.inv
oke(CompositeInvocationHandlerImpl.java:99)
at $Proxy24.connectFailure(Unknown Source)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(
SocketOrChannelConnectionImpl.java:257)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(
SocketOrChannelConnectionImpl.java:270)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.create
Connection(SocketOrChannelContactInfoImpl.java:129)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.begin
Request(CorbaClientRequestDispatcherImpl.java:223)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaC
lientDelegateImpl.java:228)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClie
ntDelegateImpl.java:393)
at org.omg.CORBA.portable.ObjectImpl._is_a(Unknown Source)
at org.omg.CosNaming.NamingContextHelper.narrow(Unknown Source)
at com.sun.enterprise.naming.impl.SerialContext$ProviderCacheKey.getName
Service(SerialContext.java:1239)
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(Serial
Context.java:410)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContex
t.java:346)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.jav
a:504)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.jav
a:455)
at javax.naming.InitialContext.lookup(Unknown Source)
at SimpleTopicPublisher.main(SimpleTopicPublisher.java:112)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection ref
used: connect
at org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createSocket(
IIOPSSLSocketFactory.java:339)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(
SocketOrChannelConnectionImpl.java:242)
... 14 more
Caused by: java.net.ConnectException: Connection refused: connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility
.java:110)
at org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createSocket(
IIOPSSLSocketFactory.java:324)
... 15 more
JNDI API lookup failed: javax.naming.NamingException: Lookup failed for 'jms/MyJ
ms' in SerialContext[myEnv={java.naming.provider.url=iiop://135.250.22.167:3700,
java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory,
java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.sta
te=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception
is javax.naming.NamingException: Unable to acquire SerialContextProvider for Ser
ialContext[myEnv={java.naming.provider.url=iiop://135.250.22.167:3700, java.nami
ng.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.nami
ng.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun
.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is org.omg
.CORBA.COMM_FAILURE: FINE: IOP00410001: Connection failure: socketType: IIOP_CLE
AR_TEXT; hostname: localhost; port: 3700 vmcid: OMG minor code: 1 completed:
No]]
javax.naming.NamingException: Lookup failed for 'jms/MyJms' in SerialContext[myE
nv={java.naming.provider.url=iiop://135.250.22.167:3700, java.naming.factory.ini
tial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.url
.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl
.presentation.rmi.JNDIStateFactoryImpl} [Root exception is javax.naming.NamingEx
ception: Unable to acquire SerialContextProvider for SerialContext[myEnv={java.n
aming.provider.url=iiop://135.250.22.167:3700, java.naming.factory.initial=com.s
un.enterprise.naming.SerialInitContextFactory, java.naming.factory.url.pkgs=com.
sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentat
ion.rmi.JNDIStateFactoryImpl} [Root exception is org.omg.CORBA.COMM_FAILURE: FIN
E: IOP00410001: Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: local
host; port: 3700 vmcid: OMG minor code: 1 completed: No]]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.jav
a:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.jav
a:455)
at javax.naming.InitialContext.lookup(Unknown Source)
at SimpleTopicPublisher.main(SimpleTopicPublisher.java:112)
Caused by: javax.naming.NamingException: Unable to acquire SerialContextProvider
for SerialContext[myEnv={java.naming.provider.url=iiop://135.250.22.167:3700, j
ava.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, j
ava.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state
=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is
org.omg.CORBA.COMM_FAILURE: FINE: IOP00410001: Connection failure: socketType:
IIOP_CLEAR_TEXT; hostname: localhost; port: 3700 vmcid: OMG minor code: 1 com
pleted: No]
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContex
t.java:351)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.jav
a:504)
... 3 more
Caused by: org.omg.CORBA.COMM_FAILURE: FINE: IOP00410001: Connection failure: so
cketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700 vmcid: OMG minor co
de: 1 completed: No
at sun.reflect.GeneratedConstructorAccessor29.newInstance(Unknown Source
)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException
(CorbaExtension.java:248)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException
(CorbaExtension.java:95)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging
(WrapperGenerator.java:387)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(Wrappe
rGenerator.java:107)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperG
enerator.java:511)
at com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.inv
oke(CompositeInvocationHandlerImpl.java:99)
at $Proxy24.connectFailure(Unknown Source)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(
SocketOrChannelConnectionImpl.java:257)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(
SocketOrChannelConnectionImpl.java:270)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.create
Connection(SocketOrChannelContactInfoImpl.java:129)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.begin
Request(CorbaClientRequestDispatcherImpl.java:223)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaC
lientDelegateImpl.java:228)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClie
ntDelegateImpl.java:393)
at org.omg.CORBA.portable.ObjectImpl._is_a(Unknown Source)
at org.omg.CosNaming.NamingContextHelper.narrow(Unknown Source)
at com.sun.enterprise.naming.impl.SerialContext$ProviderCacheKey.getName
Service(SerialContext.java:1239)
at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(Serial
Context.java:410)
at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContex
t.java:346)
... 4 more
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection ref
used: connect
at org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createSocket(
IIOPSSLSocketFactory.java:339)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(
SocketOrChannelConnectionImpl.java:242)
... 14 more
Caused by: java.net.ConnectException: Connection refused: connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility
.java:110)
at org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createSocket(
IIOPSSLSocketFactory.java:324)
... 15 more\>
Edited by: 929530 on Apr 25, 2012 3:25 AM -
929530 wrote:Works for me. I get
the folloing is the error in finding out the iiop port\Documents and Settings\test>asadmin get "configs.config.server-config.iiop-se
rvice.iiop-listener.orb-listener-1.*"
No matches resulted from the wildcard expression.
CLI137 Command get failed.\Documents and Settings\test>
C:\GlassFish\glassfish-3.1.2\glassfish3\bin>asadmin get "configs.config.server-config.iiop-service.iiop-listener.orb-listener-1.*"
configs.config.server-config.iiop-service.iiop-listener.orb-listener-1.address=0.0.0.0
configs.config.server-config.iiop-service.iiop-listener.orb-listener-1.enabled=true
configs.config.server-config.iiop-service.iiop-listener.orb-listener-1.id=orb-listener-1
configs.config.server-config.iiop-service.iiop-listener.orb-listener-1.lazy-init=true
configs.config.server-config.iiop-service.iiop-listener.orb-listener-1.port=3700
configs.config.server-config.iiop-service.iiop-listener.orb-listener-1.security-enabled=false
Command get executed successfully.
C:\GlassFish\glassfish-3.1.2\glassfish3\bin>
Nigel -
now i am getting the below error
please help me...\Documents and Settings\test>asadmin
Use "exit" to exit and "help" for online help.
asadmin> get "configs.config.server-config.iiop-service.iiop-listener.orb-liste
ner-1.*"
HTTP connection failed with code 404, message: /__asadmin/get
Command get failed.
asadmin> -
is there any problem with
com.sun.enterprise.naming.SerialInitContextFactory
with iiop what should be the Context.INITIAL_CONTEXT_FACTORY?
This discussion has been closed.