Hi,

Just I did just take a quick look at your code, but was the stopping
of the jetty-bundle twice your intention?
And actually pax-web uses managed configuration, so if you change the
port while running it will be reconfigured.

I can take a look at it tonight in more detail.

Achim

2011/1/13 Abhishek Rakshit <[email protected]>:
> Hey Guys,
> I am using Pax-Web to run a web service inside eclipse as a plugin.
> Pax-Web is working fine and the service starts at port 8080 (default)
> correctly.
> Now I need to configure this port at runtime and was trying to do this by
> using the Configuration Admin Service by getting the pax web Configuration
> and changing the "org.osgi.service.http.port" property. But this is having
> no effect on the port. I have provided my code snippet below. Could someone
> please point out what I am doing wrong?
> //**********************
>
> Platform.getBundle("org.ops4j.pax.web.pax-web-jetty-bundle").stop();
>
> Bundle configMgrBundle = Platform.getBundle("org.eclipse.equinox.cm");
>
> configMgrBundle.start();
>
> ServiceReference configAdminServiceRef =
> context.getServiceReference(ConfigurationAdmin.class.getName());
>
>      if (configAdminServiceRef != null) {
>
> ConfigurationAdmin configAdmin = (ConfigurationAdmin)
> context.getService(configAdminServiceRef);
>
> Configuration config = configAdmin.getConfiguration("org.ops4j.pax.web");
>
> Dictionary properties = config.getProperties();
>
> if (properties == null) {
>
>        properties = new Hashtable();
>
> }
>
> properties.put("org.osgi.service.http.port", "8888");
>
> config.update(properties);
>
> Platform.getBundle("org.ops4j.pax.web.pax-web-jetty-bundle").stop();
>
> //**********************
>
> Really appreciate your help
>
> Abhishek,
>
> _______________________________________________
> general mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/general
>
>

_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to