List Info

Thread: Factory pattern and naming context




Factory pattern and naming context
user name
2006-05-03 13:47:23
Hello,

I'm trying to build a factory for the filesystem example
provided with 
Apache WSRF. In my FilesystemfactoryService, method 
createFileSystemResource is written along the lines of this:

  Context initialContext = new InitialContext();
  FilesystemHome home = 
(FilesystemHome)initialContext.lookup(FilesystemHome.HOME_LO
CATION) ;
  FilesystemResource fsresource = new FilesystemResource() ;
  fsresource.setID("ABC1") ;  // Just to test...
  fsresource.init() ;
  home.add(fsresource) ;


(FilesystemHome.HOME_LOCATION contains
"wsrf/services/filesystem/home").

This follows more or less the resourceadmin example in the
MUSE example.


When invoking this operation, I get the following exception:
javax.naming.NameNotFoundException: Name services is not
bound in this 
Context
         at
org.apache.naming.NamingContext.lookup(NamingContext.java:80
4)
         at
org.apache.naming.NamingContext.lookup(NamingContext.java:15
5)
         at
org.apache.naming.NamingContext.lookup(NamingContext.java:81
5)
         at
org.apache.naming.NamingContext.lookup(NamingContext.java:16
8)
         at
javax.naming.InitialContext.lookup(InitialContext.java:351)
         at 
org.apache.ws.resource.example.filesystemfactory.Filesystemf
actoryService.createFileSystemResource(FilesystemfactoryServ
ice.java:58)



Did I miss something? How is the factory supposed to get
hold of the 
instance of FilesystemHome to add new instances?


I also noticed that the examples in WSRF were using
wsrf-config.xml and 
the springBeansXmlMerger ant task whereas the MUSE examples
were using 
jndi-config.xml and the jndiUpdater ant task. Although the
principles of 
the configuration files seem similar, they are different.
Could this 
have an influence on the NamingContext problem?


Regards,


Bruno.

------------------------------------------------------------
---------
To unsubscribe, e-mail: wsrf-user-unsubscribews.apache.org
For additional commands, e-mail: wsrf-user-helpws.apache.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )