Thanks, however... This gets me *another* context. What is the expected pattern of usage? Create n Contexts and use? Or do as the Axis System/AxisServLet does and cache the Context for future use. It seems a better usage in my world to access the WarBasedAxisConfigurator created Context.
Is there a reason not too? Are there risks involved in having multiple contexts floating around? Do they all get consistently built based upon the web.xml init params and axis.xml file? -----Original Message----- From: Davanum Srinivas [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 30, 2008 2:26 PM To: [email protected] Subject: Re: ConfigurationContext -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 rename address.mar as addressing.jar and drop it into WEB-INF/lib. Kurt Kavanaugh wrote: | Background: | | | | Java: 1.5 | | Tomcat 5.25 | | Mod_JK Connector | | Apache web server | | Axis 2 | | | | IDE: Intellij 7.x | | | | We have non-standard web layout, I am using the init-params and params | in the axis.xml to explicitly set up the contexts and other entry | points. | | | | I have some experience with Axis back in 2001/2 at Swingtide when we | were building a SOAP inference engine, handlers building SOAP | endpoints,etc. | | | | I have the axis kernel sources setup in my IDE so I can step through and | learn more.... | | | | Goal(s): | | | | We are using, or more correctly put, going to be using, axis2 in a | legacy web environment. (I.e. We are using Axis2 in an embedded mode). | I/we are going to be using Document Style SOAP to integrate with other | distributed applications. | | | | I like the ability to programmatically introduce new services but I do | not see an easy way, or a pattern for accessing the | ConfigurationContext. In stepping through the code it is obvious that it | is fairly expensive operation to create one. Even if were not expensive | I would like, in a singleton way to access the Configuration Context, as | created by the AxisServlet and install new Java services as they come to | fruition. | | | | public static void install() | | { | | try | | { | | | | ConfigurationContext context = | ConfigurationContextFactory.createConfigurationContextFromFileSystem( | "<OurPath>\\conf", null ); | | HashMap services = | context.getAxisConfiguration().getServices(); | | if ( ! services.containsKey( | BuildingController.class.getName() )) | | { | | AxisService service = AxisService.createService( | BuildingController.class.getName(), context.getAxisConfiguration() ); | | context.getAxisConfiguration().addService( service ); | | } | | | | } | | catch ( Exception e ) | | { | | Trace.error("Problem adding service: " + e.getMessage(), e | ); | | } | | | | Problem: | | | | I am encountering the below exception which I am getting ready to debug. | But I was hoping to access same configuration context, unless this is | not an accepted usage, or is is not thread-safe, or... | | | | ERROR 2008-04-30 14:15:18,344 [Thread-1] - Problem adding service: The | system is attempting to engage a module that is not available: | addressing | | org.apache.axis2.AxisFault: The system is attempting to engage a module | that is not available: addressing | | at | org.apache.axis2.engine.AxisConfiguration.engageModule(AxisConfiguration | .java:440) | | at | org.apache.axis2.engine.AxisConfiguration.engageGlobalModules(AxisConfig | uration.java:567) | | at | org.apache.axis2.deployment.DeploymentEngine.engageModules(DeploymentEng | ine.java:589) | | at | org.apache.axis2.deployment.FileSystemConfigurator.engageGlobalModules(F | ileSystemConfigurator.java:141) | | at | org.apache.axis2.context.ConfigurationContextFactory.createConfiguration | Context(ConfigurationContextFactory.java:77) | | at | org.apache.axis2.context.ConfigurationContextFactory.createConfiguration | ContextFromFileSystem(ConfigurationContextFactory.java:180) | | | | Thanks for reading and considering | | | | Kurt | | | | | | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) iD8DBQFIGLmzgNg6eWEDv1kRAqx6AJ9W9fnH2M9SK0WU8b57DQhCKLWKAACg5jyr wc0oDWo/KYp6EJOG6NtdUL4= =L6yN -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
