You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-user@ws.apache.org by Bruno Harbulot <Br...@manchester.ac.uk> on 2006/05/03 15:47:23 UTC

Factory pattern and naming context

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_LOCATION) ;
  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:804)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:155)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:815)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at 
org.apache.ws.resource.example.filesystemfactory.FilesystemfactoryService.createFileSystemResource(FilesystemfactoryService.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-unsubscribe@ws.apache.org
For additional commands, e-mail: wsrf-user-help@ws.apache.org


Re: Factory pattern and naming context

Posted by Bruno Harbulot <Br...@manchester.ac.uk>.
Indeed, it works fine with version 1.0!

Thanks,

Bruno.


Campana Jr., Salvatore J wrote:
> Bruno,
> 
> It seems as though you are using the WSRF 1.1 release...Please use the
> WSRF 1.0 release as 1.1 made many changes which we've wanted to
> revert...
> 
> Since we will be having a contribution from IBM which will move this
> stuff towards the latest specs and provide a pluggable layer for other
> implementations..that will be the way to go moving forward...until we
> get them on board you should work with 1.0... 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: wsrf-user-unsubscribe@ws.apache.org
For additional commands, e-mail: wsrf-user-help@ws.apache.org


RE: Factory pattern and naming context

Posted by "Campana Jr., Salvatore J" <sa...@hp.com>.
Bruno,

It seems as though you are using the WSRF 1.1 release...Please use the
WSRF 1.0 release as 1.1 made many changes which we've wanted to
revert...

Since we will be having a contribution from IBM which will move this
stuff towards the latest specs and provide a pluggable layer for other
implementations..that will be the way to go moving forward...until we
get them on board you should work with 1.0... 

-----Original Message-----
From: Bruno Harbulot [mailto:Bruno.Harbulot@manchester.ac.uk] 
Sent: Wednesday, May 03, 2006 9:47 AM
To: wsrf-user@ws.apache.org
Subject: Factory pattern and naming context

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_LOCATION) ;
  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:804)
         at
org.apache.naming.NamingContext.lookup(NamingContext.java:155)
         at
org.apache.naming.NamingContext.lookup(NamingContext.java:815)
         at
org.apache.naming.NamingContext.lookup(NamingContext.java:168)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at 
org.apache.ws.resource.example.filesystemfactory.FilesystemfactoryServic
e.createFileSystemResource(FilesystemfactoryService.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-unsubscribe@ws.apache.org
For additional commands, e-mail: wsrf-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: wsrf-user-unsubscribe@ws.apache.org
For additional commands, e-mail: wsrf-user-help@ws.apache.org