Websphere Java version - websphere

Can a Java 6 application work on Webpshere 8.5 if the nodes are built using Java 7? I have an EAR which was developed using Java6 and deployed on Websphere 8.5 using EA but the Webservice always gives 404.
Thanks.

It appears that that no support is provided for Java SE 6 in that version of WebSphere.
From the online documentation for WebSphere 8.5.5 (not sure if this is the version you are using tho')
Notice: Java SE 6 is being removed from service. Java SE 8 is the
recommended Java SDK because it provides the latest features and
security updates. You can continue to use Java SE 6, but no service
can be provided after the end of the support date, which might expose
your environment to security risks.
In fact, it appears that not even Java SE 7 is supported in this version of WebSphere either

There is a confusion here about the meaning of "version" and how it applies to JavaEE applications:
There is the version of the JVM which is selected to run the server.
There is the JavaEE specification level used to encode XML documents (web.xml, application.xml, ejb-jar.xml, etc) which are within an application.
There is the JavaEE specification level which is supported by the server.
There is the java compiler level which is set for classes packaged within an application.
There is, technically speaking, no specific version associated with an application. That an application is at Java 7 can mean "the classes of the application were compiled to java7", or, "the XML descriptors are set to the versions available to JavaEE7", or, "the function of the application requires a container which supports JavaEE7".
A key detail is that when running with WebSphere, its the server which decides to which JavaEE specification the application is run, not any feature of the application.
I'm guessing that in the original question, "Java 6 application" means the application was compiled to java6 and that the application features are limited to those available in java6. That should work on all of WebSphere v7.0, v8.0, v8.5, and v9.0 (at all service levels).
There are some complications to consider when using a distributed topology (having a DMGr node and more than one application server nodes). A frequent complication is that one or more of the application server nodes is at a lower version than the DMgr node. This is a supported scenario (with some limits on how big of a version difference is supported). The scenario is typical when a topology (a collection of federated nodes) is being migrated gradually from a particular WebSphere version to a higher version, and during the migration a mixture of node versions is available. When this is the case, the DMgr tracks the version of the application server nodes and constrains processing of the application to ensure the deployment is valid to all of the application server nodes to which the application is deployed.
Since the JavaEE level is set by the application server version, and since, generally, higher versions of the application server implement higher JavaEE levels, applications can function differently when migrated between application server versions. Whether this is the case for this question cannot be known without looking in more detail at the exact failure which is occurring.

Related

LinkageError on WebSphere 9 for javax.transaction.* classes

I have a web application that used to run fine on many web servers (tomcat, jboss, weblogic and websphere). Now, however, it has an error when deploying on WebSphere 9.
The app contains the jar javax.transaction-api-1.2. Some of its classes, e.g., javax.transaction.xa.XAResource, are also included in Java SE, but not all of them. Some are specific to Java EE and are required by some 3rd-party libraries in my app. The app is always deploying with child-first (parent-last) classloader.
WebSphere 9 throws this error during startup when the app tries to load the Oracle JDBC driver:
java.lang.LinkageError: loading constraint violation: loader "com/ibm/ws/classloader/CompoundClassLoader#7157be44" previously initiated loading for a different type with name
"javax/transaction/xa/XAResource" defined by loader "com/ibm/oti/vm/BootstrapClassLoader#422c7b1b"
Note that we aren't actually using XA transactions in the app, we are using regular transactions.
On other servers, and previous versions of WebSphere, it was never a problem. The server didn't care that we load XAResource from inside the war, even if it was previously loaded somewhere in the server. Now WebSphere 9 is different, it says that the app classloader already loaded this class from the server, but I don't know why or when did this happen.
Any idea how to solve this?
Remove the transaction API from your application. JTA 1.2 is already included in the server and provides no value in your applications. It's always risky to bring Java EE/SE APIs in a parent-last class loader unless you are 100% certain that they are technically necessary, because they can lead to issues like this one.
I can't say how this worked in previous server versions (there have been some Java-level changes in enforcing linkage issues like this), but the solution is reasonably straightforward.
At the end we did two things to solve this problem.
1) We upgraded the jta jar to version 1.3 (link here). This jar solves the problem by avoiding duplicate classes - it contains only J2EE classes and omits the J2SE classes that are already included in the JVM.
2) We upgraded WebSphere server from 9.0.0.7 to 9.0.0.11.
At the time, I suspected just upgrading the jar should suffice, but our QA had some issues with it and they also upgraded the server. Due to lack of time, we didn't investigate it further and just decided to do both.

Different versions in transitive dependencies in Gradle

In my project I am forced to use these packages:
com.sparkjava:spark-core:2.3, which ends up using jetty-server:9.3.2.v20150730
org.apache.spark:spark-core_2.10:1.2.0, which ends up using jetty-server:8.1.14.v20131031
Note that com.sparkjava and org.apache.spark have nothing to do with each other. They are called both spark funnily.
The issue here is that both jetty versions are incompatible, so if I force jetty 8.X the system crashes, if I force jetty 9.X the system crashes again, I get java.lang.NoClassDefFoundError: org/eclipse/jetty/server/ServerConnector in one case and java.lang.NoClassDefFoundError: org/eclipse/jetty/server/bio/SocketConnector in the other.
What I am expected to do in such a situation ?
Note: I've tried to shadow jetty, but the dependency manager resolves just one (9.X by default, or 8.X if I force it) and then it shadows it, so it's really not helping.
It would be exceedingly difficult to resolve this situation.
Jetty 8.1 is about 4 major version behind Jetty 9.3, which represents many hundreds of releases of difference.
Note: Jetty versioning is [servlet_support].[major_ver].[minor_ver].
Jetty 8.x is Servlet 3.0, while Jetty 9.x is Servlet 3.1
The architecture of the connectors has evolved tremendously in that time frame, from being old school blocking Sockets in Jetty 8 to no blocking connectors at all in Jetty 9, with Jetty 9 needing to evolve the connectors to support features in TLS/1.2, and ALPN in order to properly support HTTP/2, and the internal I/O handling to support the new Servlet 3.1 Async I/O feature set.
Solution #1:
You won't be able to have both versions running in the same VM without some sort of classloader isolation, and careful configuration to ensure they don't claim the same resources (listening ports, temp files, etc)
Solution #2:
Upgrade (or downgrade) one or the other spark dependency till you hit a common jetty version. (Spark_2.11 / 2.0.0 seems to support Jetty 9.2.x)
Solution #3:
Apache Spark is open source, go submit a patch that upgrades its use of Jetty to 9.3 (this might be difficult as Apache Spark isn't ready to use Java 8 yet, which is a requirement for Jetty 9.3)

What are the main diference between WAS Liberty Profile and WAS downloaded by Installation Manager

From developer viewpoint, what is diference between WebSphere Application Server(1.5GB) installed by Installation Manager and WebSphere Application Server V8.5 Liberty Profile (65 MB)? I will develop an application based on EJB, JSF and JPA. According to my search, Liberty Profile is an easy way to start develop with Websphere. I would appreciate any comment because I am in charge of preparing the workstations for a team and it is my first time to heard about Liberty Profile. I guess that Liberty Profile must be a smaller Web Server similiar to Tomcat plus EJB support and without Console Administration.
The key difference between WAS Liberty and WAS Classic boil down to the following: Java EE 7 support and Legacy app support
WebSphere Liberty supports Java EE 7 as of 8.5.5.6, WAS classic does not. WAS 9.0 supports Java EE 7
WAS Liberty does not support some of the older apps that have now been deprecated in the Java EE API such as JAX-RPC.
If you inherited an old application that takes advantage of WebSphere specific extensions you're generally bound to WAS Classic
Existing administrative and deployment scripts would not likely work on WAS Liberty
Network Deployment support is not as robust in WAS Liberty
However, if you are doing a new app it isn't too bad and you can pay for support for it without having to redeploy to something new unlike Glassfish or WildFly. There's a 2GB limit for production on the organization level, but you can have unlimited development instances. From what I can tell this is based on the honor system.
The following article documents at a high level the differences
https://developer.ibm.com/wasdev/docs/was-classic-or-was-liberty-how-to-choose/
The white paper also referenced by the article details each difference
http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/documentation/ChoosingWASClassicorWASLiberty.pdf
The WebSphere Application Server chief architect has a blog post entitled Liberty Archive Install and Installation Manager that compares the two approaches.
There is also a side-by-side comparison on page 9 of the IBM WebSphere Application Server V8.5.5 Packaging Highlights document.
You can take a look at this Redbook http://www.redbooks.ibm.com/abstracts/sg248076.html?Open particularly chapter 1 "An introduction to the Liberty profile" to learn more about Liberty Profile.
As for the programming models supported (which you can check on the same chapter), depending on the exact versions of EJB, JSF and JPA you need to work with, Liberty could, our could not be a fit for development. Also, in the same chapter you can read about the compatibility between Liberty Profile and the full Profile.
You can find also this post helpful https://www.ibmdw.net/wasdev/2013/05/20/alasdair_nottingham_talks_about_what_makes_liberty_different/

Glassfish tuning

We have here an application developed using Java EE 5 stack (using JSF, RichFaces, EJB, JPA, Hibernate, JAAS) that runs inside Glassfish 3.1! The thing is we are in need to run it as an installable deploy (actually many deploys =]).
My question is: What can we do to have the smallest footprint for the system?
I've already studied about:
uninstalling thing through upgrade tool (e.g. the admin parts),
run the application using embedded glassfish (but using the already existent domain),
configuring domain.xml to erase features (but at a trial and error way),
found some work on how to configure glassfish for production environment.
But as the system will be used by one user at a time, I would like to listen from you about options in this environment.

Websphere 6.1 to 7.0 JmqiObject and JmsQueue missing

I am trying to migrate an application from Websphere 6.1 to 7.0
I noticed that many of the ibm MQ/JMS classes have changed/disappeared =)
In particular, I am getting errors on
com.ibm.msg.client.jms.JmsQueue
com.ibm.mq.jmqi.JmqiObject
it is saying "...cannot be resolved. It is indirectly referenced from required .class files"
Does anyone know what I can do to get this to compile?
thanks
Hard to say exactly from the description so I'll provide some general pointers that may be of help.
The WMQ JMS and Java support was completely rewritten in V7 to use a common JMQI layer. This will affect the jar files that are referenced as well as the CLASSPATH and a few other things.
If you have bundled the WMQ jar files into your application, you will want to delete them and reference the ones installed with WAS instead.
If you used MDB listeners, you will need to switch to Activation Specs.
For more info, see the Integration of WebSphere MQ classes for JMS with WebSphere Application Server section in the WMQ V7 Migration manual and the CLASSPATH settings from the Environment section in the WMQ V7 Using Java manual.
The WebSphere Application Server V7 Migration Guide does not address WMQ in depth but it does have pointers to additional migration resources such as IBM Education Assistant as well as specific application and profile migration advice.

Resources