make apache felix web console available remotely - jetty

I am working on a project that uses the apache felix webconsole with Jetty. The project uses the OSGi framework and is built using BND tools in eclipse. How can I configure jetty to allow connections from anywhere so I can use the webconsole when it is running remotely.

As far as I know the webconsole is available remotely by default.
If you need a configuration then it will be for felix http:
org.apache.felix.http.jettyEnabled=true
This is what I use. See the felix http service docs for a list of configs.
I think the config property needed is org.apache.felix.http.host but the default seems to be to listen to all interfaces.

Related

Objects and web-services in jBPM

Is it possible to consume web-services and/or use own libraries (and thus custom objects) into a jBPM workflow? Eventually, could I expose this process as (another) web-service?
You can use web services in jBPM, at least in version 5 and 6. I believe the tooling support in eclipse is minimal or non-existent however. Don't know about the support in web console. See Maciej's blog for details on that.
It is possible to use custom objects and own libraries in jBPM. You just have to make the libraries available to the jBPM runtime. If you're using your own application where you run jBPM, just include the libraries in the CLASSPATH. For the jBPM console, you will have to include the libraries in the lib/ directory of the war, or inside WEB-INF/classes if you have .class files.
Not sure if there is out of the box support for exposing jBPM services over web service. If all you want to do is orchestrate other web services and expose yourself as a web service, you could consider using a BPEL engine rather, like Apache ODE
jBPM can call web services and contain custom libraries. A jBPM project is a Maven project, so you can add dependencies to your POM to include custom libraries. You can call web services or execute any custom Java code you want by creating a "Domain-specific process." There is an example in the documentation about how to do that: http://docs.jboss.org/jbpm/v6.0.1/userguide/jBPMDomainSpecificProcesses.html
Also, if you deploy your projects into the jBPM web console, they can be started and controlled by a REST API. So yes, they are exposed as a REST web service. See this page in the documentation about the REST API: http://docs.jboss.org/jbpm/v6.0.1/userguide/jBPMRemoteAPI.html
For example, the following REST call can initiate a process (taken from the link above):
[POST] /runtime/{deploymentId}/process/{processDefId}/start

REST services running on Glassfish

I've developed REST web services using Jersey with NetBeans IDE.
Now I want to provide those services on Glassfish 3.1, without using NetBeans.
I want something like the .aar file that is created when we build web services with Apache Axis2.
Can you tell me how to do it? I have to use the .WAR file, right?
It is something like: http://qallme.sourceforge.net/docs/sec_DeployingAWebService.html ?
Thanks
I could do it by following that tutorial that I've mentioned above.
At first that was not working because of the context-rooton glassfish-web.xml. I had not filled it with the root resource.

How do I host static files in WSO2 Carbon 3.2.2?

I have installed WSO2 Carbon 3.2.2 and would like to host some static files that I can access from a browser (specifically, a variety of HTML and JavaScript files that make up a working website). I want to be able to access the files from http://localhost:9763/<MY_FILES>. With Carbon 3.0.0 this was as simple as putting the files in <CARBON_HOME>/webapps/. Carbon 3.2.2 does not have the <CARBON_HOME>/webapps/ directory, and adding it doesn't help.
I noticed that (after installing certain features) there is another webapps directory located <CARBON_HOME>/repository/deployment/server/webapps/, but that appears to be specifically for deploying war files.
I've tried putting my files everywhere I can think of, but I've had no luck.
Is there a feature that I have to install? Is there a special location to put these files? Is this still a supported feature?
This is never been an advertised feature of Carbon nor it has been recommended. Hence you can't expect to have backward compatibility for a "non feature".
The right thing to in a production environment is to use a web server (Apache, nginx etc...) to serve static files because web servers are optimized to do that. Then proxy the connections to Carbon via the web server. For example, by using mod_proxy for Apache.
You can still use the Application Server (or after installing AppServer features into any Carbon server) to create a .war file and have your static site there. Then again if it's a static site using Application Server is an overkill.

Determining browser Proxy setting in NPAPI to download page SSL certificate

Users could have connections through proxies. Some using system-wide proxy settings, others browser-wide proxy.
On Windows for example you could have the system proxy settings as well as proxy settings for Firefox or Chrome alone. Therefore relying on system proxy settings is not reliable.
The only logical solution is to use whatever proxy settings the browser loading my plugin is using. If Firefox is loading my plugin and it has some proxy settings, my plugin should connect using these settings as well. I need my plugin to download the SSL cert of the page in which the plugin is loaded (for further verification..etc).
Is there some way to do that in NPAPI or I must use APIs like Windows WinInet or WinHTTP, or OpenSSL for Linux and Mac? If I have to do so, then how can I let my plugin use whatever proxy settings the host browser is using? I am checking out NPN_GetValueForURL, but I don't think it has good compatibility and good browser interop.
Thank you guys!
I'm pretty sure that NPN_GetURLNotify() will use the browser's proxy settings. It would be pretty crazy if it did not.
Update
If you're writing an NPAPI-based plugin, you need to use the NPN_Get/Post functions to do HTTP requests. That will use the host's proxy settings, cookies, etc. These functions exist for this reason; I don't know why you would use Wininet or roll your own instead.
Looking through about:config, it appears Firefox stores the proxy settings in network.proxy.*. You can access these settings programmatically via the Preferences Service. I suppose you could configure Wininet to behave the same, but you still have the cookie problem.

How can I deliver jetty with many webapps via jnlp?

I have a webapp (http://sourceforge.net/projects/sf-mvn-plugins/files/m2-repo/net/sf/maven/plugins/example-captaincasa-jnlp/0.1-SNAPSHOT/example-captaincasa-jnlp-0.1-SNAPSHOT.war/download) which uses jsf in a servlet container. This works fine with jetty-maven-plugin run-war target at my local pc. In the future I would like make more of this kind of webapps.
I am looking for a way to deliver these webapps with jetty via jnlp. The end user should be have a zero installation but the webapps needs servlet container and my hoster does not support a servlet container or application server or so on.
I don't like an embedded solution because in this case each webapp must be delivered with a separate jetty und run with a separate jetty -> too big size -> to many download size and so on.
The architecture should be similar to this:
(source: sourceforge.net)
Example: Bundle1 could contains jetty and deployed webapp1 and Bundle2 could contains jetty and deployed webapp1 and webapp2 (related to requirements of end user I would like deliver many variant of my webapps)
But what is my question?
Which jars of jetty are needed? I would like these upload to my homepage for hosting.
Which jar should I use for jetty as main jar to start him via jnlp?
Which main class should I use to start jetty via jnlp?
Which parameter could I use to configure jetty to say this is war of webapp1 and this is war of webapp2.... or this is directory of weapps for hot deployment...?
The important question for me is 1. If this is answered so that I could run jetty local (without maven plugin) and via manual maybe I could solve the rest 2-4.
Why not deploy a normal Java app (with a main() etc.) that invokes Jetty programatically via its Server class? That class is configured via code with the appropriate contexts, servlet classes etc.
I've done that before with success. The only headache is running one Jetty with multiple apps being downloaded on request (if I read your question correctly). Can you use some classloading magic, and load classes/apps on demand from a remote URL ?
I have found another way today. This is interesting too. Here is the concept:
Use java webstart to install an osgi container
Use a bundle x or a osgi service to download all bundles of your app
Use the jetty bundle to provide jetty support
Then the application is installed
I got the idea from this article:
http://www.toedter.com/blog/?p=45