CXF Logging & cn:checks are ignored when used with <context:annotation-config /> - cxf

The technologies I'm using are: Apache CXF, Spring 3.x, Struts 2.x and Hibernate 3.x
I'm facing a strange problem while TransactionManager with using Apache CXF. For my application I'm using CXF logging with my web-service and CN:checknames to ignore certificates on the server. When I deploy the application on server it works perfectly fine with logs being generated and certificates being ignored. But in the second step I'm developing a front-end for different areas of the application thus configuring annotation driven transaction manager in the application.xml. But when ever I try to use this line <context:annotation-config/> the CXF starts generating different logging scheme and CN:check is completely ignored.
Any help will be much appreciated. :)

My guess is your getting two instances of service/proxy bean constructed. It's hard to say without seeing your complete Spring configuration, especially any component scans. I suggest putting a log statement in it's constructor to see if it is the case. If so, ensure there is only one component scan active.

Related

Best solution to "hot-deploy" Apache Camel routes and beans classes?

We use Apache Camel as a standalone application for ~ 2 years. It works very
well but the need to restart the process to upgrade the application each time
we add new routes becomes an issue.
We are searching for a new deployment solution that could allow us to deploy
new routes without having to restart the main process.
There is no problem for us to rewrite our Java DSL routes in XML but the issue
is that most of them (and probably future ones too) make use of custom beans,
processors, components etc. to inject some logic that is too complex to
be expressed in pure XML/Java DSL route.
After searching through Camel documentation, hot deploying XML routes seems to
be possible with spring-boot or with Karaf/OSGI.
But i have no idea if it is possible to "hot-deploy" bean, processors,
components etc. classes that are needed by theses XML routes. OSGI/Karaf looks
promising but i have never used boths technologies and it is not easy to grasp their purpose at first glance.
Which deployment method and which technology could allow us to "hot deploy' routes and beans classes ?
If you want to hot-deploy Java code, then you need an application server like platform such as Apache Karaf/ServiceMix/JBoss Fuse etc or a traditional like Tomcat, JBoss, WildFly etc (for WAR files).
Then you can do a "hot deployment" as a deployment of the application.
To hot-deploy a single class or some classes inside a running JVM is harder, and you would need special tooling such as JRebel.
You could try to use camel-blueprint to setup the context/route.
By exposing your bean as osgi service, you can use those beans in routes.
I would suggest you to take a look into apache camel blueprint maven archetype and camel component archetype to get started.
Hot deploy in Apache Karaf is simple, simply drop the bundle into $KARAF_HOME/deploy and it will reload automatically.
Reference:
camel-archetype-component camel-archetype-blueprint
Do let me know if this help.
PS: I don't have enough reputation for commenting hence the answer.

SSL (HTTPS) support in functional web framework

How am I supposed to to configure SSL for a Spring Boot Service using the functional web framework?
The configuration via setting server.ssl.* properties does not work (meaning nothing happens at all) and if I am reading the docs right, only server.port and server.address are supported.
As runtime I prefer netty, but I would be fine with tomcat as well.
Indeed, using the server.ssl.* configuration keys is the right way to go. This is not yet supported as of Spring Boot 2.0.0.M5, but it will be in a future Milestone version (you can follow issue #9431 for that).
You could use customizers as a workaround; Spring Boot provides a few of those for Tomcat already (see TomcatConnectorCustomizer), but unfortunately not yet for Netty (see #10418).
In the meantime, you can provide your own ReactiveWebServerFactory bean and manually set up your Netty server to do that.

What is the actual advantage of running an AngularJS web app over Node.js instead of a server like Xampp?

As stated in the title,
I don't really understand how Node.js works and above all why it's actually used to run an AngularJS application (e.g. in WebStorm IDE this is the default option when you create an AngJS project).
I've got this doubt since I could run a simple AngularJS app on an Apache web server (within Xampp) without any involvement of NodeJS.
Thank you in advance
Node.js is an application platform. It's good for running your applications on.
Apache HTTPD is a web server. It's good at serving web pages.
They're two very different things, not directly related, and not mutually exclusive.
You are correct that many apps can run anywhere, but some benefits we've seen are:
Simplicity, especially for web developer also developing the server-side code/config/deploy.
Real-time web - easier to add in things like WebSockets and Server Sent Events if you need them.

Which Java EE container works for Apache Camel/CXF/ActiveMQ web applications using EJBs?

The Camel web page says
The following projects can leverage Apache Camel as a routing and mediation engine:
Apache ServiceMix - a popular distributed open source ESB and JBI container
Apache ActiveMQ - a mature, widely used open source message broker
Apache CXF - a smart web services suite (JAX-WS and JAX-RS)
Apache Karaf - a small OSGi based runtime in which applications can be deployed
Apache MINA - a high-performance NIO-driven networking framework
However, I would like to run Camel inside a Java EE web application and have access to web services, JMS, and EJB (CDI, message driven beans, JPA, etc.) Preferably using an open source Java EE server.
If I recommend this to my company, then then all the usual Java EE wizards such as wsdl2java need to work out of the box. There also needs to be documentation and tutorials so we can hire people to jump in and start using it.
Glassfish failed across the board. The wsdl2java wizard for CXF fails using the Glassfish runtime classes (I ran it manually and hacked my code tree.) There is no documentation nor any tutorials for wiring in OpenMQ (and google searches on the topic are discouraging.) Simple library-only samples run fine, of course, but without having ActiveMQ as the native JMS it seems to be a dead end. CXF integration seems unworkable as well. My first attempt at copying a WS sample complains "No component found with scheme: cxf" which appears to be a bundle or classpath issue.
I'm starting to think I should go back to ServiceMix and drop back to servlets without EJBs and CDI, even though I really hated not being able to use Eclipse gracefully for edit/compile/debug (you pretty much have to build and run from an outside DOS prompt window and remote debug in.)
You can use Apache Camel with any container of choice. We try to not have any restrictions or barriers. You can also run it standalone. The web page just mentions some of the containers you can use.
Apache Camel is just a bunch of JAR files you can deploy and use in any container of choice. For example with WAR files you can deploy to Tomcat, TomEE, etc.

Deploying a Silverlight Application with built-in ASMX WebService to IIS

I've got a Silverlight application which uses a built-in .ASMX WebService to access a SQL database and run some queries. Everything runs without any hitches on my Development machine.
I'm trying to deploy the application to IIS 6 and I'm having some issues.
The Silverlight application itself seems to run fine, however the Web Service does not. I get an unhandled exception error that says [Async_ExceptionOcurred] as soon as the page loads (when the page loads I'm making some Async WebService method calls).
I think this is an issue with the Web Service but I don't know what the problem is. I tried setting the WebService namespace to my URL, but that didn't work. I've tried messing with the SQL connection string in my Web Config but that also affects nothing.
One thing to note is that my IIS Virtual Directory only contains my SilverlightApp.Web folder. I know that the other folder that's part of the application contains a .ClientSettings file for the WebService, but I think this is embedded into the .xap.
Can anyone shed any light on this?
The most likely thing that's happening:
Your webservice proxy on the client is using the address of the web service it was built against: ("http://localhost...").
Things to do:
Use fiddler to confirm this is the issue. It will show you where the proxy is making the call to.
Use the overloaded constructor for the web service and specify a URI. Consider using id/deffing for debug/release. This will overwrite the settings in the client.config.
Create another endpoint in the client config for the release build (Shawn's article here) and select one or the other (again using if/defs).
There are other options as well (looking at the URI and building up the service adress)... but that's the general idea.
hth,
Erik

Resources