Can two version of resteasy & jetty be loaded in same JVM - rest

I have a very typical problem. I am using in-house developed platform which uses Jetty server and rest easy to provide a wrapper over REST framework. When they did that they made lot of tweaks for some specific scenes.
Now problem is that when I developed a REST based service with raw interfaces of rest easy and embed my jetty server in same JVM. My service can receive the request but response is always 500 server error.
I feel the in-house framework is intercepting the response doing some security validations so my response doesn't reach.
I was wondering if there is a way to use the different rest easy version and run in same JVM. I have tried to embed a jetty server and added a normal Servlet and I can access it but I can't achieve the same with my rest based servlet.
Any Idea how could I load two versions of rest easy on same JVM ?

What you can't have is two applications in the same web application context, since you are supposed to define only one class implementing javax.ws.rs.Application.
But that shouldn't be a problem, as long as classes live in different ClassLoaders. Each web application context must be in isolation of other contexts, each defining its own ClassLoader.
You can perform all kinds of class loading manipulation in Jetty: https://wiki.eclipse.org/Jetty/Reference/Jetty_Classloading
In conclusion, as long as you use different jar files of RESTEasy in each web context, you should be able to run two REST applications using different RESTEasy versions in the same JVM process.

Related

Does com.sun.net.httpserver.HttpServer have scalability issues (for production environments)?

I want to use an embedded http server in my enterprise apps (and move away from standalone containers) and was expecting Tomcat to provide an implementation. I was assuming Sun, Jetty and Jersey's implementations cannot support enterprise load.
But looking at Tomcat, I see no way to run REST apps that use JAX-RS, only servlets. So my questions are:
Will use of com.sun.net.httpserver.HttpServer work in a production environment, or do I need another library?
Am I understanding correctly the boundary between JAX-RS embedded servers and servlet containers (maybe that will explain why Tomcat doesn't provide such a server)
Other notes:
I do not want to use Spring unless that's the only choice

ISO8583 middleware with JBoss

I want to ask about JBoss Middleware for ISO8583.
So, I kinda new on ISO8583, from what I know is we could use JPOS framework for this one. Then my supervisor ask me to research about JBoss Middleware that could be used to develop middleware application for send, receive, and parse ISO8583 message.
I have read on JBoss Middleware website, unfortunately I'm still not sure which JBoss technology should I use to develop such application.
Here is my questions:
1. In order develop enterprise application that capable to send, receive, and parse ISO8583, should I combine JPOS with JBoss Middleware? or JBoss Middleware has a complete capability to handle it?
2. Does anyone has/know good material/tutorial for me to learn about building ISO8583 middleware with JBoss technology?
Thank you.
JBoss Middleware is a family of products and its components alone do not provide ISO8583 capabilities out of the box.
jPOS is one of the most popular Java frameworks that provide complete capabilities to handle sending and receiving ISO8583 messages. There are other alternatives such as j8583 and IsoTypes.
You can combine any of these ISO8583 libraries together with JBoss Fuse (part of the JBoss Middleware family) to build a solution capable of sending, receiving and parsing ISO8583 messages.
I'm not aware of a definitive guide about building such solutions. If you need to use JBoss Middleware, you can follow this route:
Look into IsoTypes, which provides an ISO8583 marshalling library for Apache Camel (used by JBoss Fuse).
Start by building a Camel route that implements the IsoType library functions. Look into this sample project.
Please, be aware that building a production ready ISO8583 server and/or client from open source solutions require significant work in terms of scalability, information security and compatibility with multiple financial hosts and switches.
My answer only refers to the first basic steps to understand your problem/solution fit a bit better.
As a side note, you may be interested in looking at jreactive-8583, an ISO8583 connector that handles message parsing and the network layer out of the box. You may build your application using this and deploy it into JBoss Application Server (part of the JBoss Middleware family too). I use it in production.
You can take advantage of JPos Q2 and create a servlet deployable to JBoss container.
In the service init method you can do this:
Q2 q2 = new Q2();
q2.start();

How does using the javax.ws.rs-api-2.0.jar works at runtime as it is only the API

We were working on creating a RESTful service. We have thought of using frameworks like jersey or cxf. But apparently we found that just using the javax.ws.rs-api-2.0.jar and the related annotations, we can get the service working.
Question is:
How does it work? Is it dependent on the application servers?
What if we application server does not support or have the implementation of the API?
If it is dependent on application servers, can I find out the library which the server is using especially tomcat?
EDIT 1
This question is invalid. javax.ws.rs-api-2.0.jar is just an API. Using this jar does not suffice. It will not give compilation errors.
But at run-time, you need providers which will implement the rs-api. And thus we need the frameworks like jersey or cxf.
In our application, these jars were added to the war during ant-build from external location and that is why it confused us.
I am closing this question.

Consume ServiceStack SOAP service from Silverlight application

For the past few days I have been looking at ServiceStack as a replacement for our WCF-based middleware (that exposes SOAP services).
My two main requirements :
Can be hosted outside of IIS (no problem using AppHostHttpListenerBase)
ServiceStack SOAP interfaces can be consumed from a Silverlight application.
Hosting from a console application works smoothly, but adding a service reference in my Silverlight client gives the following warning:
Custom tool warning: Endpoint 'WSHttpBinding_IOneWay' at address 'http://localhost:8080/soap12' is not compatible with Silverlight 5. Skipping...
Which makes sense, but I cannot seem to find a way to change the binding to e.g. basicHttpBinding.
Is this possible? I tried various ways to tackle this from app.config but no luck so far.
Much obliged in advance,
Robert van Drunen

GWT server part?

I'm thinking about an application where in some cases both client and server would run on customer's computer. Concerning the client's resource usage I've found this question, concerning the general disadvantages of GWT I've found this, but I can't find anything about the overhead of the server part. I need no application server there, anything capable of running the server part of GWT would do.
What is needed to run the server part of GWT and how many resources it consumes?
If you use a ServiceImpl w/ your GWT app, you need to deploy it into a servlet container, like Tomcat or Jetty (or many others). Otherwise, it can be deployed on any web server, as it will only consist of javascript, HTML, and CSS.