Skip to main content

Admin Object Resource not found

1 reply [Last post]
RobertAshworth
Offline
Joined: 2012-02-21
Points: 0

Using GlassFish 3.1 build 43

If I create an Admin Object Resource using a command line call of asadmin, then my Java application can successfully find it (by lookup).

If I create it using the administrator with the same properties , the lookup fails.

is there a known problem with the administrator ?

The call of asadmin I use is as follows:

call asadmin create-admin-object --echo=true --interactive=false --restype javax.jms.Queue --raname HostTalkJMS --property QueueSpaceName=QSLARGE:QueueName=ACNTSUMM SIMPLES

'HostTalkJMS' is the name of my resource adapter.

The Java code to find this object is as follows : Note that it successfully looks up a deployed connection factory.

factoryName = "eis/TPMQ/BANK";
queueName = "SIMPLES";

try
{

initialContext = new InitialContext() ;
myEnv = (Context)initialContext.lookup("");

logName = factoryName;
qCXFactory = (QueueConnectionFactory)myEnv.lookup(factoryName);
log(className,"connect", "class of Connection Factory is " + qCXFactory.getClass().toString());
logName = queueName;
mQueue = (Queue)myEnv.lookup(queueName);
log(className,"connect","Queue object returned for coded name " + queueName + " is " + mQueue.toString());
log(className,"connect", "class of queue is " + mQueue.getClass().toString());
}
catch (NamingException e)
{
mess = "Unable to lookup name - " + logName + CRLF+ e.toString();
log(className,method,mess);
throw new Exception(mess);
}

The logging when the lookup fails is as follows:

[#|2012-02-21T10:46:14.035+0000|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=765;_ThreadName=Thread-1;|JMSSessionBean . connect . Unable to lookup name - SIMPLESnulljavax.naming.NamingException: Lookup failed for 'SIMPLES' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: SIMPLES not found]|#]

Attahed is a screenshot showing 'SIMPLES' as created using the administrator. It looks exactly the same if created by command line.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
RobertAshworth
Offline
Joined: 2012-02-21
Points: 0

Second attempt to attach the screenshot.