ConfigurationContext
Hi, I have deployed axis, with spring and jsf. I want to create a custom page for listing the available services using jsf. For this I need to retreive the list of services, a saw that this is posible if I could find a way to create an ConfigurationContext, but for this I need an instance of ServletConfig. Does anyone knows how to get the servletConfig instance from a facesContext, or some other way to retreive de list of available services in an aplication? I hope someone could hel me. -- View this message in context: http://www.nabble.com/ConfigurationContext-tp21484808p21484808.html Sent from the Axis - User mailing list archive at Nabble.com.
ConfigurationContext
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( "\\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
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( | "\\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]
RE: ConfigurationContext
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: axis-user@ws.apache.org 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( | "\\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]
[Axis2] ConfigurationContext configuration
Hi all, I've already seen this document [1] and I would like to know if there's any way to create a ConfigurationContext, without loading it from a file, with all default parameters apart from the http server port. Thanks, Michele [1] http://wso2.org/library/585 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ConfigurationContext and servletContext
Hi, I work on a webapp and I write my own transport (transportListener and transportSender) I use an axisServlet configured with axis2.xml. i need to obtain the servlet context during the configuration of my transport (init() method) Is it possible to obtain the servlet context by using ConfigurationContext of axis...? my transport is configure with some values which are not static, so i can't put them in a file -> i would like to use the servlet Context. thanks, Mat
[AXIS2] Class ConfigurationContext...
Hi All... Someone, please, can give-me some explanation about some methods of the class ConfigurationContext... ( the javadoc of Axis2 1.3 is empty )... The methods are: |*cleanupContexts *()|? |*finalize *()|? |*terminate *()|? I have a simple client with rampart "inside" another service,,, evething works fine without rampart,,, but if I try use the client more than once ( like the service need invoke my client more than once ) I receive many exceptions I think that I need "clean" the client configuration each time,,, I think... but,,, with what method? or,,, what I need to do? PS: My methods and variables are NOT "static"... and, inside the "services.xml" ( ) I don't use the parameter "scope=application" or something like this... Thanks in advance ( and sorry my poor english,,, I hope be clear in my doubts ) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Axis2] ConfigurationContext configuration
Michele - I don't know if this will help, but I modify values in the AxisConfiguration using code like this: MessageContext msgContext = MessageContext.getCurrentMessageContext(); AxisConfiguration axisConfig = msgContext.getConfigurationContext() .getAxisConfiguration(); Parameter param = axisConfig.getParameter(Constants.Configuration.CACHE_ATTACHMENTS); param.setValue("true"); Betsy -Original Message- From: Michele Mazzucco [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 8:00 AM To: axis2 Subject: [Axis2] ConfigurationContext configuration Hi all, I've already seen this document [1] and I would like to know if there's any way to create a ConfigurationContext, without loading it from a file, with all default parameters apart from the http server port. Thanks, Michele [1] http://wso2.org/library/585 - 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]
RE: [Axis2] ConfigurationContext configuration
Betsy, thanks. However I would like to change the parameters on the client side. Any clue? Michele On Thu, 2007-03-29 at 08:13 -0700, Betsy Frey wrote: > Michele - > I don't know if this will help, but I modify values in the AxisConfiguration > using code like this: > > MessageContext msgContext = MessageContext.getCurrentMessageContext(); > AxisConfiguration axisConfig = msgContext.getConfigurationContext() > .getAxisConfiguration(); > Parameter param = > axisConfig.getParameter(Constants.Configuration.CACHE_ATTACHMENTS); > param.setValue("true"); > > Betsy > > -Original Message- > From: Michele Mazzucco [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 29, 2007 8:00 AM > To: axis2 > Subject: [Axis2] ConfigurationContext configuration > > Hi all, > > I've already seen this document [1] and I would like to know if there's > any way to create a ConfigurationContext, without loading it from a > file, with all default parameters apart from the http server port. > > Thanks, > Michele > > > [1] http://wso2.org/library/585 > > > - > 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] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Axis2] ConfigurationContext configuration
Michele, I use code like this on the client: Options options = new Options(); options.setProperty(Constants.Configuration.CACHE_ATTACHMENTS, Constants.VALUE_TRUE); serviceClient.setOptions(options); Betsy -Original Message- From: Michele Mazzucco [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 8:34 AM To: axis-user@ws.apache.org Subject: RE: [Axis2] ConfigurationContext configuration Betsy, thanks. However I would like to change the parameters on the client side. Any clue? Michele On Thu, 2007-03-29 at 08:13 -0700, Betsy Frey wrote: > Michele - > I don't know if this will help, but I modify values in the AxisConfiguration > using code like this: > > MessageContext msgContext = MessageContext.getCurrentMessageContext(); > AxisConfiguration axisConfig = msgContext.getConfigurationContext() > .getAxisConfiguration(); > Parameter param = > axisConfig.getParameter(Constants.Configuration.CACHE_ATTACHMENTS); > param.setValue("true"); > > Betsy > > -Original Message- > From: Michele Mazzucco [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 29, 2007 8:00 AM > To: axis2 > Subject: [Axis2] ConfigurationContext configuration > > Hi all, > > I've already seen this document [1] and I would like to know if there's > any way to create a ConfigurationContext, without loading it from a > file, with all default parameters apart from the http server port. > > Thanks, > Michele > > > [1] http://wso2.org/library/585 > > > - > 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] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
NoSuchMethodError by creating ConfigurationContext
Hey, I tryed to use the nightly build to test my Webservice Client. By using the command: ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("http://localhost/MyService/Service.asmx";, "iJCli.axis2.xml"); I got an NoSuchMethodError, and I have realy no idea what I am doing wrong... Exception in thread "main" java.lang.NoSuchMethodError: org.apache.axis2.description.HandlerDescription.(Ljavax/xml/namespace/QName;)V at org.apache.axis2.security.handler.WSDoAllHandler.(WSDoAllHandler.java:38) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.axis2.deployment.util.Utils.getHandlerClass(Utils.java:199) at org.apache.axis2.deployment.util.Utils.addFlowHandlers(Utils.java:59) at org.apache.axis2.deployment.DeploymentEngine.addNewModule(DeploymentEngine.java:311) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597) at org.apache.axis2.deployment.RepositoryListener.loadClassPathModules(RepositoryListener.java:122) at org.apache.axis2.deployment.RepositoryListener.(RepositoryListener.java:61) at org.apache.axis2.deployment.DeploymentEngine.loadFromClassPath(DeploymentEngine.java:116) at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:118) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:61) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:171) at start.iTernityHelper.getConfigContext(iHelper.java:202) Thank you, -- Daniel Wehrle - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ConfigurationContext and servletContext
mathieu fabre wrote: Hi, I work on a webapp and I write my own transport (transportListener and transportSender) I use an axisServlet configured with axis2.xml. i need to obtain the servlet context during the configuration of my transport (init() method) Is it possible to obtain the servlet context by using ConfigurationContext of axis...? Yes you can using the following code, ServletContext contxt = configContext.getProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT); Thanks Deepal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [AXIS2] Class ConfigurationContext...
Arlindo- Did you engage the module e.g. ServiceClient serviceClient = new ServiceClient(); serviceClient.engageModule("rampart"); ? Martin- - Original Message - Wrom: SZLKBRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMH To: Sent: Sunday, March 02, 2008 8:02 PM Subject: [AXIS2] Class ConfigurationContext... > Hi All... > > Someone, please, can give-me some explanation about some methods of the > class ConfigurationContext... > ( the javadoc of Axis2 1.3 is empty )... > The methods are: > |*cleanupContexts > *()|? > |*finalize > *()|? > |*terminate > *()|? > > I have a simple client with rampart "inside" another service,,, evething > works fine without rampart,,, but if I try use the client more than once > ( like the service need invoke my client more than once ) I receive many > exceptions > > I think that I need "clean" the client configuration each time,,, I > think... > but,,, with what method? or,,, what I need to do? > > PS: My methods and variables are NOT "static"... > and, inside the "services.xml" ( ) I don't > use the parameter "scope=application" or something like this... > > Thanks in advance > ( and sorry my poor english,,, I hope be clear in my doubts ) > > > - > 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]
Re: [AXIS2] Class ConfigurationContext...
Hi Martin,,, Many Thanks for your attention.. Answer: Yes... I am using the archive of configuration::: ConfigurationContextFactory.createConfigurationContextFromFileSystem (MyPath, MyPath + "conf\\MyAxis2.xml"); with the module enganged... The first invocation, the module is ok,,, ( perfect,,, ex: Timestamp, Sign, Cipher ),,, send and receive... ( I saw this in the TCPMON )... But,,, in a second invocation,,, without restart the container,,, it is like if something had remain... Because of this I ask about the methods ( finalize (); terminate (); cleanupContexts () ) to force the container "dump/clean"... Thanks Again... ( and sorry my poor english,,, I hope be clear in my doubts ) [EMAIL PROTECTED] escreveu: Arlindo- Did you engage the module e.g. ServiceClient serviceClient = new ServiceClient(); serviceClient.engageModule("rampart"); ? Martin- - Original Message - Wrom: SZLKBRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMH To: Sent: Sunday, March 02, 2008 8:02 PM Subject: [AXIS2] Class ConfigurationContext... Hi All... Someone, please, can give-me some explanation about some methods of the class ConfigurationContext... ( the javadoc of Axis2 1.3 is empty )... The methods are: |*cleanupContexts *()|? |*finalize *()|? |*terminate *()|? I have a simple client with rampart "inside" another service,,, evething works fine without rampart,,, but if I try use the client more than once ( like the service need invoke my client more than once ) I receive many exceptions I think that I need "clean" the client configuration each time,,, I think... but,,, with what method? or,,, what I need to do? PS: My methods and variables are NOT "static"... and, inside the "services.xml" ( ) I don't use the parameter "scope=application" or something like this... Thanks in advance ( and sorry my poor english,,, I hope be clear in my doubts ) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Arlindo Luis Marcon Junior E-mail: [EMAIL PROTECTED] Internet Web Page: http://lattes.cnpq.br/6483462042489662 ICQ: 138864173 Curitiba - Paraná - Brasil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Axis2- question on creating ConfigurationContext
On my Axis2 client, I am using the following code to create ConfigurationContext so that I can engage the rampart. I understand we have to use absolute path for the module and axis2.xml. Is there anyway I can load those from my classpath ? I have an tomcat server running and I am wondering if I can put those file in a jar file and be part of my classpath. Thanks John
OutOfMemory in stub if reusing ConfigurationContext
Hi, I am using Axis2 1.4 XMLBeans client stubs with shared Commons HttpClient. I get OutOfMemory errors, if I reuse ConfigurationContext previously generated by: configurationContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); The stub instance is created before each call and will not be reused itself pseudo-code: loop { stub = new TestCallServiceStub(configurationContext, url); stub.call(); } If I just use: loop { stub = new TestCallServiceStub(url); } no OOM occurs, but I am afraid, that performance will decrease. Please could you tell me, if this is a bug in Axis2 or just misuse by myself? Greetings, Christoph -- GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen! Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
get current ConfigurationContext with embedded tomcat
Hi! I'm developing an application with an embedded tomcat. I want to deploy a Axis2-Webservice at runtime. My problem is: How do i get the current ConfigurationContext to add the service to it? I can create a new ConfigurationContext and add the service, but that does not have any effect. ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem("c:/axis2-1.3/conf/axis2.xml"); InputStream in = new FileInputStream("c:/workspace/mywebservice/services.xml"); AxisService service = DeploymentEngine.buildService(in, configContext); configContext.getAxisConfiguration().addService(service); configContext.getAxisConfiguration().startService("SMARTService"); Regards, Martin -- Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Axis2- question on creating ConfigurationContext
On my Axis2 client, I am using the following code to create ConfigurationContext so that I can engage the rampart. I understand we have to use absolute path for the module and axis2.xml. Is there anyway I can load those from my classpath ? I have an tomcat server running and I am wondering if I can put those file in a jar file and be part of my classpath. ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("c: /client_repo", "c:/client_repo/conf/axis2.xml"); Thanks John
Re: OutOfMemory in stub if reusing ConfigurationContext
hope this has fixed the following issue. https://issues.apache.org/jira/browse/AXIS2-3870 please have a look at a nightly build. thanks, Amila. On Mon, Jun 30, 2008 at 9:35 PM, <[EMAIL PROTECTED]> wrote: > Hi, > > I am using Axis2 1.4 XMLBeans client stubs with shared Commons HttpClient. > I get OutOfMemory errors, if I reuse ConfigurationContext previously > generated by: > > configurationContext = > ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, > null); > > The stub instance is created before each call and will not be reused itself > > pseudo-code: > > loop { > stub = new TestCallServiceStub(configurationContext, url); > stub.call(); > } > > If I just use: > > loop { > stub = new TestCallServiceStub(url); > } > > no OOM occurs, but I am afraid, that performance will decrease. > > Please could you tell me, if this is a bug in Axis2 or just misuse by > myself? > > Greetings, > Christoph > > > -- > GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen! > Jetzt dabei sein: > http://www.shortview.de/[EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Amila Suriarachchi, WSO2 Inc.
Re: OutOfMemory in stub if reusing ConfigurationContext
Hi Amila, thanks for your fast response. When do you think, the fix will be released (Axis2 1.5)? Please could you confirm, that using a Stub and the ConfigurationContext only one-time is a workaround, until the fix goes into production? Regards, Christoph Original-Nachricht > Datum: Tue, 1 Jul 2008 13:36:25 +0530 > Von: "Amila Suriarachchi" <[EMAIL PROTECTED]> > An: axis-user@ws.apache.org > Betreff: Re: OutOfMemory in stub if reusing ConfigurationContext > hope this has fixed the following issue. > > https://issues.apache.org/jira/browse/AXIS2-3870 > > please have a look at a nightly build. > > thanks, > Amila. > > On Mon, Jun 30, 2008 at 9:35 PM, <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > I am using Axis2 1.4 XMLBeans client stubs with shared Commons > HttpClient. > > I get OutOfMemory errors, if I reuse ConfigurationContext previously > > generated by: > > > > configurationContext = > > > ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, > > null); > > > > The stub instance is created before each call and will not be reused > itself > > > > pseudo-code: > > > > loop { > > stub = new TestCallServiceStub(configurationContext, url); > > stub.call(); > > } > > > > If I just use: > > > > loop { > > stub = new TestCallServiceStub(url); > > } > > > > no OOM occurs, but I am afraid, that performance will decrease. > > > > Please could you tell me, if this is a bug in Axis2 or just misuse by > > myself? > > > > Greetings, > > Christoph > > > > > > -- > > GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen! > > Jetzt dabei sein: > > http://www.shortview.de/[EMAIL PROTECTED] > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > Amila Suriarachchi, > WSO2 Inc. -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemory in stub if reusing ConfigurationContext
On Tue, Jul 1, 2008 at 3:42 PM, <[EMAIL PROTECTED]> wrote: > > Hi Amila, > > thanks for your fast response. When do you think, the fix will be released > (Axis2 1.5)? yes. currently it is on the trunk. > > > Please could you confirm, that using a Stub and the ConfigurationContext > only one-time is a workaround, until the fix goes into production? yes > > > Regards, > Christoph > > Original-Nachricht > > Datum: Tue, 1 Jul 2008 13:36:25 +0530 > > Von: "Amila Suriarachchi" <[EMAIL PROTECTED]> > > An: axis-user@ws.apache.org > > Betreff: Re: OutOfMemory in stub if reusing ConfigurationContext > > > hope this has fixed the following issue. > > > > https://issues.apache.org/jira/browse/AXIS2-3870 > > > > please have a look at a nightly build. > > > > thanks, > > Amila. > > > > On Mon, Jun 30, 2008 at 9:35 PM, <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > > I am using Axis2 1.4 XMLBeans client stubs with shared Commons > > HttpClient. > > > I get OutOfMemory errors, if I reuse ConfigurationContext previously > > > generated by: > > > > > > configurationContext = > > > > > > ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, > > > null); > > > > > > The stub instance is created before each call and will not be reused > > itself > > > > > > pseudo-code: > > > > > > loop { > > > stub = new TestCallServiceStub(configurationContext, url); > > > stub.call(); > > > } > > > > > > If I just use: > > > > > > loop { > > > stub = new TestCallServiceStub(url); > > > } > > > > > > no OOM occurs, but I am afraid, that performance will decrease. > > > > > > Please could you tell me, if this is a bug in Axis2 or just misuse by > > > myself? > > > > > > Greetings, > > > Christoph > > > > > > > > > -- > > > GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen! > > > Jetzt dabei sein: > > > http://www.shortview.de/[EMAIL PROTECTED] > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > Amila Suriarachchi, > > WSO2 Inc. > > -- > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! > Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Amila Suriarachchi, WSO2 Inc.
AXIS2 - How global is the global configurationContext?
We use AXIS2 as a web service client. We have an axis2.xml and we have engaged the addressing module. The addressing module must be engaged at global level. global in this context, is that VM level? Or can we create multiple global ConfigurationContext's, with different configurations and run it within one VM instance? Because of the stateless architecture of AXIS2 I would assume that multiple ConfigurationContext's should work. However, I couldn't find a statement that this is supported, and if it applies to all modules. -- View this message in context: http://www.nabble.com/AXIS2---How-global-is-the-global-configurationContext--tp23444760p23444760.html Sent from the Axis - User mailing list archive at Nabble.com.
Re: get current ConfigurationContext with embedded tomcat
I can't, because MessageContext.getCurrentMessageContext() is null. Original-Nachricht > Datum: Tue, 29 Jan 2008 09:13:32 -0500 > Von: "Martin Gainty" <[EMAIL PROTECTED]> > An: [EMAIL PROTECTED] > Betreff: Re: get current ConfigurationContext with embedded tomcat > Martin > > did you try obtaining the CONTEXT property from MessageContext? > MessageContext.getProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT) > > Does this help? > Martin-- > - Original Message - > From: "Martin Philippi" <[EMAIL PROTECTED]> > To: > Sent: Tuesday, January 29, 2008 8:40 AM > Subject: get current ConfigurationContext with embedded tomcat > > > > Hi! > > I'm developing an application with an embedded tomcat. > > I want to deploy a Axis2-Webservice at runtime. > > My problem is: How do i get the current ConfigurationContext to add the > service to it? > > I can create a new ConfigurationContext and add the service, but that > does > not have any effect. > > > > ConfigurationContext configContext = > ConfigurationContextFactory.createConfigurationContextFromFileSystem("c:/axi > s2-1.3/conf/axis2.xml"); > > InputStream in = new > FileInputStream("c:/workspace/mywebservice/services.xml"); > AxisService service = DeploymentEngine.buildService(in, configContext); > > configContext.getAxisConfiguration().addService(service); > > configContext.getAxisConfiguration().startService("SMARTService"); > > > > Regards, > > Martin > > -- > > Pt! Schon vom neuen GMX MultiMessenger gehört? > > Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: get current ConfigurationContext with embedded tomcat
Hi! I'm developing an application with an embedded tomcat. I want to deploy a Axis2-Webservice at runtime. My problem is: How do i get the current ConfigurationContext to add the service to it? I can create a new ConfigurationContext and add the service, but that does not have any effect. ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem("c:/axis2-1.3/conf/axis2.xml"); InputStream in = new FileInputStream("c:/workspace/mywebservice/services.xml"); AxisService service = DeploymentEngine.buildService(in, configContext); configContext.getAxisConfiguration().addService(service); configContext.getAxisConfiguration().startService("SMARTService"); You can do the following (But this depend on how you start Axis2 , if you use AxisServlet then the following works) ListenerManager.defaultConfigurationContext Thanks Deepal Regards, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: get current ConfigurationContext with embedded tomcat
This totally depends on the way you decide to implement it. You may maintain the configuration context as a static attribute or a property in a ServletContext etc. MessageContext.getCurrentMessageContext will return the correct message context only if a relevant flow was initiated through a Web service request. e.g. Like in WSAS (which uses embedded Tomcat), you can have an Admin service which can be invoked to do something like this. Here is a service implementation class. public class ServiceAdderAdmin { public void deployService(){ MessageContext msgCtx = MessageContext.getCurrentMessageContext (); AxisConfigruation axisConfig = msgCtx.getRootContext ().getAxisConfiguration(); AxisService service = new AxisService(); ... axisConfig.addService(axisService); } } HTH Azeez On Tue, Jan 29, 2008 at 7:10 PM, Martin Philippi <[EMAIL PROTECTED]> wrote: > Hi! > I'm developing an application with an embedded tomcat. > I want to deploy a Axis2-Webservice at runtime. > My problem is: How do i get the current ConfigurationContext to add the > service to it? > I can create a new ConfigurationContext and add the service, but that does > not have any effect. > > ConfigurationContext configContext = > ConfigurationContextFactory.createConfigurationContextFromFileSystem > ("c:/axis2-1.3/conf/axis2.xml"); > InputStream in = new > FileInputStream("c:/workspace/mywebservice/services.xml"); > AxisService service = DeploymentEngine.buildService(in, configContext); > configContext.getAxisConfiguration().addService(service); > configContext.getAxisConfiguration().startService("SMARTService"); > > Regards, > Martin > -- > Pt! Schon vom neuen GMX MultiMessenger gehört? > Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Thanks Afkham Azeez http://azeez78.blogspot.com http://www.wso2.org GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760
Re: get current ConfigurationContext with embedded tomcat
I'm not really sure how i start axis. I'm doing something like this in embedded tomcat. Context context_axis2 = embedded.createContext("/axis2", getPath() + "/webapps/axis2"); host.addChild(context); But this does not seem to be the right way (although axis is working). How do i start it by using AxisServlet? Thanks Martin Original-Nachricht > Datum: Wed, 30 Jan 2008 10:08:45 +0530 > Von: Deepal jayasinghe <[EMAIL PROTECTED]> > An: axis-user@ws.apache.org > Betreff: Re: get current ConfigurationContext with embedded tomcat > > > Hi! > > I'm developing an application with an embedded tomcat. > > I want to deploy a Axis2-Webservice at runtime. > > My problem is: How do i get the current ConfigurationContext to add the > service to it? > > I can create a new ConfigurationContext and add the service, but that > does not have any effect. > > > > ConfigurationContext configContext = > ConfigurationContextFactory.createConfigurationContextFromFileSystem("c:/axis2-1.3/conf/axis2.xml"); > > InputStream in = new > FileInputStream("c:/workspace/mywebservice/services.xml");AxisService > service = DeploymentEngine.buildService(in, > configContext); > > configContext.getAxisConfiguration().addService(service); > > configContext.getAxisConfiguration().startService("SMARTService"); > > > You can do the following (But this depend on how you start Axis2 , if > you use AxisServlet then the following works) > > ListenerManager.defaultConfigurationContext > > Thanks > Deepal > > Regards, > > Martin > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: get current ConfigurationContext with embedded tomcat
I'm not really sure how i start axis. I'm doing something like this in embedded tomcat. Context context_axis2 = embedded.createContext("/axis2", getPath() + "/webapps/axis2"); host.addChild(context); But this does not seem to be the right way (although axis is working). How do i start it by using AxisServlet? Axis2 deploy as a war file alone with a web.xml file , there it starts the AxisServlet. In your case also if you have started Axis2 then I hope you can use the line of codes I send you before. Thanks Deepal Thanks Martin Original-Nachricht Datum: Wed, 30 Jan 2008 10:08:45 +0530 Von: Deepal jayasinghe <[EMAIL PROTECTED]> An: axis-user@ws.apache.org Betreff: Re: get current ConfigurationContext with embedded tomcat Hi! I'm developing an application with an embedded tomcat. I want to deploy a Axis2-Webservice at runtime. My problem is: How do i get the current ConfigurationContext to add the service to it? I can create a new ConfigurationContext and add the service, but that does not have any effect. ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem("c:/axis2-1.3/conf/axis2.xml"); InputStream in = new FileInputStream("c:/workspace/mywebservice/services.xml");AxisService service = DeploymentEngine.buildService(in, configContext); configContext.getAxisConfiguration().addService(service); configContext.getAxisConfiguration().startService("SMARTService"); You can do the following (But this depend on how you start Axis2 , if you use AxisServlet then the following works) ListenerManager.defaultConfigurationContext Thanks Deepal Regards, Martin - 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]
Re: get current ConfigurationContext with embedded tomcat
Alright, > >> ListenerManager.defaultConfigurationContext works. Thanks a lot so far! But now i've got another problem. When I try to add my service like this InputStream in = new FileInputStream("c:/workspace/mywebservice/services.xml"); AxisService service = DeploymentEngine.buildService(in, configContext); configContext.getAxisConfiguration().addService(service); the service gets listed in the admin-console, but no operations are available. It seems, that my services.xml is not correctly loaded. The file seems to be ok, because when i deploy it in an aar everything works fine. And how do i get axis to recognize my service.wsdl? Thanks, Martin Original-Nachricht > Datum: Wed, 30 Jan 2008 20:13:44 +0530 > Von: Deepal jayasinghe <[EMAIL PROTECTED]> > An: axis-user@ws.apache.org > Betreff: Re: get current ConfigurationContext with embedded tomcat > > > I'm not really sure how i start axis. I'm doing something like this in > embedded tomcat. > > > > Context context_axis2 = embedded.createContext("/axis2", getPath() + > "/webapps/axis2"); > > host.addChild(context); > > > > But this does not seem to be the right way (although axis is working). > > How do i start it by using AxisServlet? > > > Axis2 deploy as a war file alone with a web.xml file , there it starts > the AxisServlet. In your case also if you have started Axis2 then I hope > you can use the line of codes I send you before. > > Thanks > Deepal > > Thanks > > Martin > > > > Original-Nachricht > > > >> Datum: Wed, 30 Jan 2008 10:08:45 +0530 > >> Von: Deepal jayasinghe <[EMAIL PROTECTED]> > >> An: axis-user@ws.apache.org > >> Betreff: Re: get current ConfigurationContext with embedded tomcat > >> > > > > > >>> Hi! > >>> I'm developing an application with an embedded tomcat. > >>> I want to deploy a Axis2-Webservice at runtime. > >>> My problem is: How do i get the current ConfigurationContext to add > the > >>> > >> service to it? > >> > >>> I can create a new ConfigurationContext and add the service, but that > >>> > >> does not have any effect. > >> > >>> ConfigurationContext configContext = > >>> > >> > ConfigurationContextFactory.createConfigurationContextFromFileSystem("c:/axis2-1.3/conf/axis2.xml"); > >> > >>> InputStream in = new > >>> > >> FileInputStream("c:/workspace/mywebservice/services.xml"); > AxisService service = DeploymentEngine.buildService(in, > >> configContext); > >> > >>> configContext.getAxisConfiguration().addService(service); > >>> configContext.getAxisConfiguration().startService("SMARTService"); > >>> > >>> > >> You can do the following (But this depend on how you start Axis2 , if > >> you use AxisServlet then the following works) > >> > >> ListenerManager.defaultConfigurationContext > >> > >> Thanks > >> Deepal > >> > >>> Regards, > >>> Martin > >>> > >>> > >> - > >> 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] -- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Odd error in Stub when getting ConfigurationContext
Hi all, When I run my service local (localhost) this is not a problem. But allas, I'm trying to run the service on a non-local box. IN the Stub generated from WSDL2Java there is a constructor as such: (note I added some try-catch blocks) public FoundationServicesServerServiceStub(org.apache.axis2.context.Configurati onContext configurationContext, java.lang.String targetEndpoint) throws java.lang.Exception { //To populate AxisService populateAxisService(); populateFaults(); try { //_serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service); ConfigurationContext context = org.apache.axis2.context.ConfigurationContextFactory.createConfiguration ContextFromFileSystem(AXIS2_HOME, null); _serviceClient = new org.apache.axis2.client.ServiceClient(context,_service); //_serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service); } catch (Exception e) { String msg = e.getMessage(); System.out.println(msg); } try { _serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference( targetEndpoint)); } catch (Exception e) { String msg = e.getMessage(); System.out.println(msg); } As I step thought he code, it seams the axis2.xml is being parsed but then out of the blue the following is encountered: DEBUG in builder.StAXOMBuilder.next():lINE:144 - msg=END_ELEMENT: axisconfig:axisconfig DEBUG in engine.Phase.addHandler():lINE:113 - msg=Handler RequestURIBasedDispatcher added to Phase Transport DEBUG in engine.Phase.addHandler():lINE:113 - msg=Handler SOAPActionBasedDispatcher added to Phase Transport DEBUG in engine.Phase.addHandler():lINE:113 - msg=Handler AddressingBasedDispatcher added to Phase Dispatch DEBUG in engine.Phase.addHandler():lINE:113 - msg=Handler SOAPMessageBodyBasedDispatcher added to Phase Dispatch DEBUG in engine.Phase.addHandler():lINE:113 - msg=Handler InstanceDispatcher added to Phase java.lang.NoClassDefFoundError: org/apache/axis2/om/OMXMLParserWrapper at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.apache.ws.policy.util.PolicyFactory.getPolicyReader(PolicyFactory.ja va:42) at org.apache.axis2.deployment.DescriptionBuilder.processPolicyElements(Des criptionBuilder.java:406) at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigB uilder.java:112) at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(D eploymentEngine.java:751) at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration( FileSystemConfigurator.java:111) at org.apache.axis2.context.ConfigurationContextFactory.createConfiguration Context(ConfigurationContextFactory.java:35) at org.apache.axis2.context.ConfigurationContextFactory.createConfiguration ContextFromFileSystem(ConfigurationContextFactory.java:84) at com.thomson.west.foundations.soap.FoundationServicesServerServiceStub.(FoundationServicesServerServiceStub.java:93) at com.thomson.west.foundations.transport.SoapTransporter.retrieveUnique(So apTransporter.java:176) at com.thomson.west.foundations.transport.TransportBuilder.getApp(Transport Builder.java:268) at com.thomson.west.foundations.FoundationsBuilder.eagerPopulate(Foundation sBuilder.java:157) at com.thomson.west.foundations.FoundationsBuilder.(FoundationsBuilde r.java:116) at com.thomson.west.foundations.security.test.FoundationsSampleSecurityUsea geTestEnv.runApp(FoundationsSampleSecurityUseageTestEnv.java:103) at com.thomson.west.foundations.security.test.FoundationsSampleSecurityUsea geTestEnv.main(FoundationsSampleSecurityUseageTestEnv.java:85) Now this issue goes away IF I include the axis2-core-0.94.jar as well as the axis2-kernel-1.0-RC1.jar in the lib dir of my client app. But why would I need both of these jars? Isn't axis2-kernel-1.0-RC1.jar suppose to replace axis2-core-0.94.jar? Any assistence would be greatly appreciated. Dave Ziebol
Re: AXIS2 - How global is the global configurationContext?
Globally engaged means engaged at the level of the ConfigurationContext. It is possible to create multiple ConfigurationContext instances in the same VM. Andreas On Fri, May 8, 2009 at 14:05, NHoogervorst wrote: > > We use AXIS2 as a web service client. > We have an axis2.xml and we have engaged the addressing module. > The addressing module must be engaged at global level. > > global in this context, is that VM level? > Or can we create multiple global ConfigurationContext's, with different > configurations and run it within one VM instance? > Because of the stateless architecture of AXIS2 I would assume that multiple > ConfigurationContext's should work. However, I couldn't find a statement > that this is supported, and if it applies to all modules. > > > > -- > View this message in context: > http://www.nabble.com/AXIS2---How-global-is-the-global-configurationContext--tp23444760p23444760.html > Sent from the Axis - User mailing list archive at Nabble.com. > >
Resuse of configurationcontext ends in out of memory error
Hello together, We are using Axis2 1.4 as ws-client framework in a web application (deployed in JBOSS) and have encountered a problem after making the Axis2ConfigurationContext a singleton. This approach was necessary because creating the configurationcontext needs a lot of time and we don´t want to do it again and again... This was the suggestion in a discussion on the mailing list of Axis2 (http://markmail.org/message/57afv4yi3t76b7nk#query:+page:1+mid:57afv4yi3t76b7nk+state:results) So Iimplemented a static method which provides the configurationContext to the caller. If the configurationcontext is created one time, we save it in a static variable and use this in later calls. /** * reuse the configuration context of AXIS2 because it is expensive to create a new one every time you create a * client stub. For more information look at url: * http://markmail.org/message/57afv4yi3t76b7nk#query:+page:1+mid:57afv4yi3t76b7nk+state:results * * @return a valid configuration context for the axis2 stubs * @throws AxisFault if creating the configuration context fails. */ static synchronized ConfigurationContext getConfigurationContext() throws AxisFault { if (configCtx == null) { ClassLoader tccl = Thread.currentThread().getContextClassLoader(); try { // set local ClassLoader ClassLoader bofModuleClassLoader = RPlanWebServiceHelper.class.getClassLoader(); Thread.currentThread().setContextClassLoader(bofModuleClassLoader); configCtx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); } finally { // restore thread context ClassLoader Thread.currentThread().setContextClassLoader(tccl); } } return configCtx; } The client stubs are created the following way: ProjectServiceStub projectServiceStub = new ProjectServiceStub(getConfigurationContext(), projectServiceUrl); projectServiceStub.UpdateSchedule(updateScheduleType); After some days we realized that there are very often out of memory errors in that application. The application is a so called method server which runs several jobs which are doing a lot of work with the axis2 client. We analyzed the headdump of the java process and determine that the axis2configuration instance needs a lot of memory at the time of the out of memory error. See the attached file for more information. The hashtable instance of allEndpoints is about 200 Megabyte. Please help me to find the problem? Is there a problem how we use the configuration context or is this a bug in Axis2? Thanks, Jens http://old.nabble.com/file/p26438102/headdump_analysis.html headdump_analysis.html -- View this message in context: http://old.nabble.com/Resuse-of-configurationcontext-ends-in-out-of-memory-error-tp26438102p26438102.html Sent from the Axis - User mailing list archive at Nabble.com.
Resuse of configurationcontext ends in out of memory error
Hello together, We are using Axis2 1.4 as ws-client framework in a web application (deployed in JBOSS) and have encountered a problem after making the Axis2ConfigurationContext a singleton. This approach was necessary because creating the configurationcontext needs a lot of time and we don´t want to do it again and again... This was the suggestion in a discussion on the mailing list of Axis2 (http://markmail.org/message/57afv4yi3t76b7nk#query:+page:1+mid:57afv4yi3t76b7nk+state:results) So Iimplemented a static method which provides the configurationContext to the caller. If the configurationcontext is created one time, we save it in a static variable and use this in later calls. /** * reuse the configuration context of AXIS2 because it is expensive to create a new one every time you create a * client stub. For more information look at url: * http://markmail.org/message/57afv4yi3t76b7nk#query:+page:1+mid:57afv4yi3t76b7nk+state:results * * @return a valid configuration context for the axis2 stubs * @throws AxisFault if creating the configuration context fails. */ static synchronized ConfigurationContext getConfigurationContext() throws AxisFault { if (configCtx == null) { ClassLoader tccl = Thread.currentThread().getContextClassLoader(); try { // set local ClassLoader ClassLoader bofModuleClassLoader = RPlanWebServiceHelper.class.getClassLoader(); Thread.currentThread().setContextClassLoader(bofModuleClassLoader); configCtx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); } finally { // restore thread context ClassLoader Thread.currentThread().setContextClassLoader(tccl); } } return configCtx; } The client stubs are created the following way: ProjectServiceStub projectServiceStub = new ProjectServiceStub(getConfigurationContext(), projectServiceUrl); projectServiceStub.UpdateSchedule(updateScheduleType); After some days we realized that there are very often out of memory errors in that application. The application is a so called method server which runs several jobs which are doing a lot of work with the axis2 client. We analyzed the headdump of the java process and determine that the axis2configuration instance needs a lot of memory at the time of the out of memory error. See the attached file for more information. The hashtable instance of allEndpoints is about 200 Megabyte. Please help me to find the problem? Is there a problem how we use the configuration context or is this a bug in Axis2? Thanks, Jens http://old.nabble.com/file/p26440452/headdump_analysis.html headdump_analysis.html -- View this message in context: http://old.nabble.com/Resuse-of-configurationcontext-ends-in-out-of-memory-error-tp26440452p26440452.html Sent from the Axis - User mailing list archive at Nabble.com.
Re: Resuse of configurationcontext ends in out of memory error
Can you try with Axis2 1.5? There was a memory leak in 1.4 and fixed for 1.5. thanks, Amila. On Fri, Nov 20, 2009 at 5:20 PM, Jens Goldhammer < goldhammer...@googlemail.com> wrote: > > Hello together, > > We are using Axis2 1.4 as ws-client framework in a web application > (deployed > in JBOSS) and have encountered a problem after making the > Axis2ConfigurationContext a singleton. > > This approach was necessary because creating the configurationcontext needs > a lot of time and we don´t want to do it again and again... This was the > suggestion in a discussion on the mailing list of Axis2 > ( > http://markmail.org/message/57afv4yi3t76b7nk#query:+page:1+mid:57afv4yi3t76b7nk+state:results > ) > > So Iimplemented a static method which provides the configurationContext to > the caller. If the configurationcontext is created one time, we save it in > a > static variable and use this in later calls. > >/** > * reuse the configuration context of AXIS2 because it is expensive to > create a new one every time you create a > * client stub. For more information look at url: > * > > http://markmail.org/message/57afv4yi3t76b7nk#query:+page:1+mid:57afv4yi3t76b7nk+state:results > * > * @return a valid configuration context for the axis2 stubs > * @throws AxisFault if creating the configuration context fails. > */ >static synchronized ConfigurationContext getConfigurationContext() > throws AxisFault { >if (configCtx == null) { > >ClassLoader tccl = > Thread.currentThread().getContextClassLoader(); >try { >// set local ClassLoader >ClassLoader bofModuleClassLoader = > RPlanWebServiceHelper.class.getClassLoader(); > > Thread.currentThread().setContextClassLoader(bofModuleClassLoader); > >configCtx = > ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, > null); > >} finally { >// restore thread context ClassLoader >Thread.currentThread().setContextClassLoader(tccl); >} >} > >return configCtx; >} > > The client stubs are created the following way: > >ProjectServiceStub projectServiceStub = new > ProjectServiceStub(getConfigurationContext(), projectServiceUrl); >projectServiceStub.UpdateSchedule(updateScheduleType); > > After some days we realized that there are very often out of memory errors > in that application. The application is a so called method server which > runs > several jobs which are doing a lot of work with the axis2 client. > > We analyzed the headdump of the java process and determine that the > axis2configuration instance needs a lot of memory at the time of the out of > memory error. See the attached file for more information. The hashtable > instance of allEndpoints is about 200 Megabyte. > > Please help me to find the problem? Is there a problem how we use the > configuration context or is this a bug in Axis2? > > Thanks, > Jens > > http://old.nabble.com/file/p26440452/headdump_analysis.html > headdump_analysis.html > > -- > View this message in context: > http://old.nabble.com/Resuse-of-configurationcontext-ends-in-out-of-memory-error-tp26440452p26440452.html > Sent from the Axis - User mailing list archive at Nabble.com. > > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
Re: Resuse of configurationcontext ends in out of memory error
Hello Amila, thanks for your information. Are you sure that the bug is fixed already? I have found an resolved issue in Axis2 JIRA (http://issues.apache.org/jira/browse/AXIS2-3870), but the comments of other users state that the bug is not fixed. Can anybody confirm that the bug is really fixed? If I would use Axis2 1.5- Is it necessary to regenerate the client for AXIS2 1.5? We have generated it with Axis2 1.4... Thanks, Jens Amila Suriarachchi wrote: > > Can you try with Axis2 1.5? There was a memory leak in 1.4 and fixed for > 1.5. > > thanks, > Amila. > > On Fri, Nov 20, 2009 at 5:20 PM, Jens Goldhammer < > goldhammer...@googlemail.com> wrote: > >> >> Hello together, >> >> We are using Axis2 1.4 as ws-client framework in a web application >> (deployed >> in JBOSS) and have encountered a problem after making the >> Axis2ConfigurationContext a singleton. >> >> This approach was necessary because creating the configurationcontext >> needs >> a lot of time and we don´t want to do it again and again... This was the >> suggestion in a discussion on the mailing list of Axis2 >> ( >> http://markmail.org/message/57afv4yi3t76b7nk#query:+page:1+mid:57afv4yi3t76b7nk+state:results >> ) >> >> So Iimplemented a static method which provides the configurationContext >> to >> the caller. If the configurationcontext is created one time, we save it >> in >> a >> static variable and use this in later calls. >> >>/** >> * reuse the configuration context of AXIS2 because it is expensive to >> create a new one every time you create a >> * client stub. For more information look at url: >> * >> >> http://markmail.org/message/57afv4yi3t76b7nk#query:+page:1+mid:57afv4yi3t76b7nk+state:results >> * >> * @return a valid configuration context for the axis2 stubs >> * @throws AxisFault if creating the configuration context fails. >> */ >>static synchronized ConfigurationContext getConfigurationContext() >> throws AxisFault { >>if (configCtx == null) { >> >>ClassLoader tccl = >> Thread.currentThread().getContextClassLoader(); >>try { >>// set local ClassLoader >>ClassLoader bofModuleClassLoader = >> RPlanWebServiceHelper.class.getClassLoader(); >> >> Thread.currentThread().setContextClassLoader(bofModuleClassLoader); >> >>configCtx = >> ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, >> null); >> >>} finally { >>// restore thread context ClassLoader >>Thread.currentThread().setContextClassLoader(tccl); >>} >>} >> >>return configCtx; >>} >> >> The client stubs are created the following way: >> >>ProjectServiceStub projectServiceStub = new >> ProjectServiceStub(getConfigurationContext(), projectServiceUrl); >>projectServiceStub.UpdateSchedule(updateScheduleType); >> >> After some days we realized that there are very often out of memory >> errors >> in that application. The application is a so called method server which >> runs >> several jobs which are doing a lot of work with the axis2 client. >> >> We analyzed the headdump of the java process and determine that the >> axis2configuration instance needs a lot of memory at the time of the out >> of >> memory error. See the attached file for more information. The hashtable >> instance of allEndpoints is about 200 Megabyte. >> >> Please help me to find the problem? Is there a problem how we use the >> configuration context or is this a bug in Axis2? >> >> Thanks, >> Jens >> >> http://old.nabble.com/file/p26440452/headdump_analysis.html >> headdump_analysis.html >> >> -- >> View this message in context: >> http://old.nabble.com/Resuse-of-configurationcontext-ends-in-out-of-memory-error-tp26440452p26440452.html >> Sent from the Axis - User mailing list archive at Nabble.com. >> >> > > > -- > Amila Suriarachchi > WSO2 Inc. > blog: http://amilachinthaka.blogspot.com/ > > -- View this message in context: http://old.nabble.com/Resuse-of-configurationcontext-ends-in-out-of-memory-error-tp26442083p26495216.html Sent from the Axis - User mailing list archive at Nabble.com.
How to get ConfigurationContext from a xml file which is in a jar file
Hi, everyone: I am working to write a web service client and have a customized client-axis2.xml. I used the following code to get a ConfigurationContext object: ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(".", "conf/client.axis2.xml"); Now I put the client.axis2.xml in a jar file rather than file system. The sturcture of the jar file looks like: 0 Wed Jun 24 17:42:44 PDT 2009 META-INF/ 106 Wed Jun 24 17:42:42 PDT 2009 META-INF/MANIFEST.MF 0 Wed Jun 24 17:42:42 PDT 2009 org/ 0 Wed Jun 24 17:42:42 PDT 2009 org/kepler/ 0 Wed Jun 24 17:42:42 PDT 2009 org/kepler/executionWS/ 0 Wed Jun 24 17:42:44 PDT 2009 org/kepler/executionWS/client/ 25777 Wed Jun 24 17:42:44 PDT 2009 client.axis2.xml 2210 Wed Jun 24 17:42:42 PDT 2009 log4j.properties 27832 Wed Jun 24 17:42:44 PDT 2009 org/kepler/executionWS/client/KeplerExeWSClient.class How can the client class KeplerExeWSClient get a ConfigurationContext object? Use the method ConfigurationContextFactory.createConfigurationContextFromURIs(axis2xml, repositoy)? Thank you very much for the help! Jing Jing Tao National Center for Ecological Analysis and Synthesis (NCEAS) 735 State St. Suite 204 Santa Barbara, CA 93101
AXIS2: How to load configurationcontext (axis2.xml) inside a J2EE-application acting as WS-client?
Hi, I have the following problem: (I'm using Axis2 1.3 in combination with rampart 1.3) I want to write a webservice-client running inside a j2ee-environment (packed in an ear-file) (The webservice-call is triggered by a MDB inside the J2EE-environment) The webservice-provider demands a secured call. Thus I had to add the following to the axis2.xml: Timestamp Signature client abc.def.PWCBHandler abc/def/crypto.properties DirectReference My test-client, written as POJO: ... WSStub stub=null; String url = "http://rst.xyz:8000/axis2/services/WS";; String AXIS2_PATH="C:\\ws\\axis2-1.3"; String CLIENT_REPO_PATH=AXIS2_PATH+"\\repository "; String CLIENT_CONFIG_PATH=AXIS2_PATH+"\\conf\\axis2.xml "; ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(CLIENT_REPO_PATH, CLIENT_CONFI G_PATH); stub = new WSStub(ctx,url); stub._getServiceClient().engageModule("rampart-1.3"); stub.aMethod(); ... works without any problems! But when I want to put this coding into a J2EE-environment, then the following problem arise: It is not allowed to access the file-system inside J2EE-environment, thus using "ConfigurationContextFactory.createConfigurationContextFromFileSystem" is not possible. Using "ConfigurationContextFactory.createConfigurationContextFromURIs" is also not possible, because I can not make any further assumptions about the destination-environment. (thus accessing the axis2.xml via file-url or http-url is not preferably) I wish to put the axis2.xml into the jar (inside the ear-file) and access it via "getSystemRessourceAsStream" or something like that. Thus the ear-file itself would contains everything it needs. But the ConfigurationContextFactory-class has no API for this. In my understanding the only way to set outflow-security is via axis2.xml and the only way to change this global behaviour is via axis2.xml. Or am I wrong? (I found a Class "OutflowConfiguration" for programmatically setting this, but that class is deprecated.) What do you recommend to load the axis2-configurationcontext (axis2.xml) inside a J2EE-application acting as WS-client? Many thanks in advance!! KR Torsten Goncz
RE: How to get ConfigurationContext from a xml file which is in a jar file
Tao, If the config file is in your classpath or can be found in the jar which is in your classpath, you can try below code block. ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); String name = "path-to-your-axis2.xml" Axis2ConfigUrl = classLoader.getResource(name); this.configContext = ConfigurationContextFactory.createConfigurationContextFromURIs( axis2ConfigAsUrl , null); This article is a good read if you want to find out Different Ways of Creating a ConfigurationContext in Axis2 http://wso2.org/node/585/print -richard -Original Message- From: Jing Tao [mailto:t...@nceas.ucsb.edu] Sent: June 24, 2009 9:59 PM To: axis-user@ws.apache.org Subject: How to get ConfigurationContext from a xml file which is in a jar file Hi, everyone: I am working to write a web service client and have a customized client-axis2.xml. I used the following code to get a ConfigurationContext object: ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("." , "conf/client.axis2.xml"); Now I put the client.axis2.xml in a jar file rather than file system. The sturcture of the jar file looks like: 0 Wed Jun 24 17:42:44 PDT 2009 META-INF/ 106 Wed Jun 24 17:42:42 PDT 2009 META-INF/MANIFEST.MF 0 Wed Jun 24 17:42:42 PDT 2009 org/ 0 Wed Jun 24 17:42:42 PDT 2009 org/kepler/ 0 Wed Jun 24 17:42:42 PDT 2009 org/kepler/executionWS/ 0 Wed Jun 24 17:42:44 PDT 2009 org/kepler/executionWS/client/ 25777 Wed Jun 24 17:42:44 PDT 2009 client.axis2.xml 2210 Wed Jun 24 17:42:42 PDT 2009 log4j.properties 27832 Wed Jun 24 17:42:44 PDT 2009 org/kepler/executionWS/client/KeplerExeWSClient.class How can the client class KeplerExeWSClient get a ConfigurationContext object? Use the method ConfigurationContextFactory.createConfigurationContextFromURIs(axis2xml, repositoy)? Thank you very much for the help! Jing Jing Tao National Center for Ecological Analysis and Synthesis (NCEAS) 735 State St. Suite 204 Santa Barbara, CA 93101