Deploy CXF jax-ws webservice on Websphere 8.5.5.12 - cxf

I am trying to deploy a jax-ws webservice on Websphere 8.5.5.12. I am using CXF as my jax-ws engine. I have gone through the prerequisites and changed the class loader as well as desabled the JaxWs engine in websphere. I have set the property to disable Jax-WS engine in the manifest file of my war file.
My application is a Spring boot application. I am also using apache camel 2.20.1 and using the cxf end point to consume the messages.
As a spring boot application my application is working fine.
When I deploy on Websphere my application starts without any issues. But when it intercepts any incoming requests, it throws class not found exception for javax.servlet.WriteListener class. This class is part of the servlet api. It should have been part of the Websphere j2ee library.
Need to know what I did wrong. I don't want to take the shared library route. I have been suggested, that I need to move all my cxf dependencies, into a shared library and set my class loader for this library. I am not comfortable with this solution.

javax.servlet.WriteListener is a Servlet 3.1 / Java EE7 API.
WebSphere Application Server 8.5.5 implements Servlet 3.0 / Java EE6.
You should use either WebSphere Application Server 9.0.0.x or any recent WebSphere Liberty release (which has been versioned differently for quite some time).
(or, remove the 3.1 dependencies from your app if you must run it on WebSphere Application Server 8.5.5)

Related

Running spring boot in google-cloud-eclipse

I've raised an issue in Google-cloud-eclipse but the situation is as follows.
I can run a spring-boot application in google appengine standard using the java8 profile, to do this however requires removing the embedded tomcat engine.
If I add a SpringBootServletInitializer then the project never shows as started in eclipse. (despite having started).
Is there a convenient flow for developing against Google app engine including spring boot, that allows for code changes on the fly?
Issue raised against google-cloud-eclipse

Deploy Angularjs 1.5.X on JBoss App server

Can Angularjs 1.5.X App directly deployed onto application server like JBoss 6.x. I have deployed Angularjs apps on Nginx, but I was wondering if AngularJS can be deployed to listen on different port on Same App server that also host the Rest API's developed using RestEasy on JBoss.
Does JBoss has ability to run Webapps?
JBoss Application Server (AS) was a product developed by RedHat, currently replaced by Wildfly, which, being a certified implementation of the Java Enterprise Edition specification, allowed the building, deploying, and hosting of highly-transactional Java applications and services.
Therefore, the answer to your question is yes. JBoss AS, as it name states, has the ability to serve web applications.
To deploy your AngularJS application on JBoss, I'd suggest you to create a web project and have it builded and packaged as a ready-to-deploy WAR archive using a build manager such as Maven.
As an example, you can follow the kitchensink-angularjs quickstart provided by JBoss.
Finally, regarding your AngularJS deployed on a different port question, you can find an answer to it in How to run different apps on single JBoss AS 6 instance behind different ports?.

what is difference between spring & blueprint & router in apache camel?

I am new in Fuse. I am using Jboss Fuse and creating Fuse project.
I want to know basic difference between container like spring, blueprint and router?
Spring and blueprint are dependency injection frameworks. You use them to configure all the dependencies you will use in your JBoss Fuse application (just as jms queues or java Datasources).
Spring is a popular framework, whereas blueprint is OSGi-specific (that's why it is used in JBoss Fuse).
A router controls the flow of messages in your application. JBoss Fuse is built upon the Apache Camel lightweight integration framework, which does your routing. When you write a JBoss Fuse application, you will likely be defining Routes via Java or XML.
To read more about routing, I suggest you read about Enterprise Integration Patterns on the apache camel web site.

Difference between Apache CXF Jetty endpoint and embedded Jetty container

I started building a web application and made it runnable with an embedded Jetty server. I then decided to try out Apache CXF (which I have never used before) to provide either a SOAP/XML or a REST/JSON interface (haven't decided which yet). Now I am slightly confused by the various posts / docs I have read.
I understand that CXF actually provides (using Jetty internally) its own endpoints that can be published. Is that correct? But it looks like it can also be bundled and deployed into existing web containers (eg Tomcat, and therefore I assume also Jetty) - is this also correct?
If both of these are correct, what are the pros / cons / gotchas of using the CXF Jetty endpoints out-of-the-box as opposed to using a separate container (especially if the separate container is also embedded Jetty)?
It really depends on your application and deployment strategy. Jetty is a lightweight, embedded application server that you can use to run your own web-server. If you choose Apache Tomcat or JBoss or any other application server your application will be likely packaged as a WAR and deployed. The difference is , in Jetty your application controls the container whereas with others its the other way around. Regardless of the choice of application server , CXF endpoints are designed to work with any container supporting JAX-RS or JAX-WS specifications.
Note: You don't need Jetty if you are going to deploy it on Tomcat or other containers.

Can I use Apache Camel with Jax-ws implementation in application server (e. WAS, WLS) without CXF or Axis2?

I dont want to use Axis2 or CXF with Camel. Is it possible to configure camel with JAX-WS reference implementation or weblogic application server or websphere application server or tomcat + jax-ws refrence implementation?
Camel provides 2 web services components out of the box: camel-cxf and camel-spring-ws. For any other web service integration just use plain java. From any Java code, you can send a message to Camel using the ProducerTemplate. Then that way you can bridge the JAX-WS of the application server with Camel. We used to have an old example at Apache Camel that showed how to integrate Axis 1.4 with Camel, but that examples has been removed as part of cleanup recently.
As far as I know that is not possible. The camel-axis and camel-cxf components are directly using the cxf and axis classes. You could use the SoapDataFormat but this is just for simple cases and not a full stack.

Resources