New JDK for old java app - java

I have a rather old java web app, which uses servlet spec version 2.3. I use struts 1.0, jsf 1.0 there, etc. This app is running on tomcat 6.0.13. Java version in 1.7. But, I want to upgrade java there. May I install jdk 1.8+ there? I tried, but it began complaining on UI part incompatibility, etc. How to install in there?

After 4 days of running tomcat 6 and Java 8 I can say that there are 2 big issues which (thanks God) I have managed to fix.
Make sure all browsers which are using your web app has TLS enabled
Starting from certain update of JDK 7 java required TLS to be enabled in the browser, for example I had a trouble with clients which used IE6. The same is true for JDK8
Make sure you don't have any scriptlets in your application or they are compatible with java8
Tomcat compiles all your jsps to the special classes, and if you have in your code a construction like:
<% Set set=myHashMap.entrySet().blabla%>
you will get an exception which says that it can't understand the .class file structure, because tomcat is trying to use special framework (jasper?), which tries to parse the .class file of compiled jsp page. I moved scriptlets to the appropriate backing beans and it works ok. Please edit this answer if I was incorrect in tech description.

Related

Which Java EE server?

I'm moving in to developing Web Apps using Java EE and the first problem I have is not knowing which Server to use! There seems to be so many to chose from!
Glassfish server seems to stand out foremost (and it's top of the list) but when I try to start Glassfish 4.1.2, I get the error GlassFish requires Java SE version 6. and I can't download Java SE 6 for MacOSX without joining the "Oracle Club".
So which Server should I use??
You're running JDK 8, as you should. You should not be downloading JDK 6. It's long past the end of its support life.
Looks like the latest is version 5. You can download it here.
It should be said that you don't need Java EE to write Java web apps. Another alternative is Spring Boot. You won't need an app server, just an executable JAR to be run on a JDK.
Are you on OSX? You can get a JDK1.6 download here: https://support.apple.com/kb/DL1572?locale=en_US
I would be very careful with JDK1.6, it's about as safe as seatbelts made from toilet paper.

Different java versions uses java web start on one computer

I have searched the forum for my question but have not found the precise info i need..
I have two web start applications that uses 2 different versions of java.. How is it possible for these to work on the same computer one app using version 1.6.0_30 and the other 1.8.
Inside the .jnlp file you will find attribute spec. Value assigned to it inform what Java Web Start is required to use the application.
Java is backword compatible so having only version 8 you will be able to run something dedicated to version 6.
Java allows to have multiple versions on single machine and also mange them.

Managed bean not called in Icemobile

I am new to Icemobile, but since it promises fast development on mobile devices I gave it a shot. I use Netbeans for development, Netbeans 7.1 on one PC and Netbeans 7.3 on another.
The problem is that with Netbeans 7.1, a managed bean is not called on post back. It is constructed and getters are called on the initial GET page. On Netbeans 7.3 this is OK.
I later found that in Netbeans 7.1, the JSF library is JSF 2.1 with jsf-api.jar and jsf-impl.jar , whereas in Netbeans 7.3, it is JSF 2.2 javax.faces.jar. I substituted this jar in the Netbeans 7.1 machine and problem solved.
I think icesoft.org should state this caveat in http://www.icesoft.org/java/projects/ICEmobile/supported-platforms.jsf. Here it only says JSF 2 Mojarra.
Also although the web site states Tomcat 7 is required, I found Tomcat 6 is OK so far (although some functionalities may not be supported on Tomcat 6)
I don't believe that we've done any specific testing with ICEmobile with Mojarra 2.2. I would recommend sticking with Mojarra 2.1 for now. Despite the version the NetBeans version is defaulting to, you can override that just by including the javax.faces.jar in the WEB-INF/lib folder so that it's always included in the war file. As for Tomcat, I don't believe that we say that Tomcat 7 is required. We actually support a very wide range of application servers. Check out our supported platforms page (http://www.icesoft.org/java/projects/ICEmobile/supported-platforms.jsf).
The issue you were having with managed beans not being called sounds strange, and I would guess that it's more likely due to JSF configuration than ICEmobile. We'd be happy to take a look at your app and configuration.
Thanks,
Philip
In addition to posting your app, which version of the ICEfaces Netbeans plugin are you using? http://www.icesoft.org/java/downloads/icefaces-downloads.jsf.
What are the exact version numbers of the Mojarra jars you've been using for both 2.1 and 2.2?

How risky if I develop on Weblogic 10.x and deploy to Weblogic9.2.x?

Recently I took over a relative old project, which is running on weblogic 9.2. I need work on some change requests. I don't know much about weblogic product.
The old DEV-Env is windows based, however I dont have a windows machine. I tried to download Weblogic9.2 for linux (32bits), however I cannot find the link on Oracle website, after quite a lot google, still no working link found.
So the options for me:
find out a working link, download weblogic9.2 and work with it
download and use the 10.x version from oracle
setup a windows box (we have the installer of weblogic9.2 for win)
the 3 is the last thing I want to do. If someone knows where can I get the 9.2 version, it would be great. If there is no weblogic9.2 available, can I work on weblogic10.x and release to 9.2 in production? how risky is it?
Developing in WLS 10.x and deploying in 9.2 may cause some trouble.
There are quite a no of features which have been upgraded in 10.x, such as Java 5 to 6, J2EE 1.4 to 5, Servlet 2.4 to 2.5, JSP 2.0 to 2.1, EJB 2.1 to 3.0.
While most of the features here do have backward compatibility, you have to be extra careful when you develop.
I would suggest to develop based on the lowest common denominator features only, and build on the same server you are deploying it to. (i.e. 10.x has a diff build, and 9.2.x has different one.)
EDIT: There seems to be a authentic binary available on PeopleSoft's FTP site.
It's definitely a risk. Different versions of Weblogic use different jars, so what works on 10.x may not work on 9.x. It's a good practice to have your QA and PROD environments as similar as possible including node setup and startup variables.
If your current PROD deployed code works on 10.x then I would upgrade your PROD environment to 10.x and continue your development on 10.x. If not then do what you can to have 9.x on your DEV environment as well.

Java Web Application Development Tools - Versions

I'm in the process of learning about servlet containers and web apps based on Java EE, servlets, JSPs, EL/JSTL, JDBC (via Connector J from MySQL AB), MySQL server, etc.
I usually like to know in detail about the versions of the tools I'm using (and also thinking ahead of when I might list these on a resume).
From the command line (I'm running Cygwin on Windows XP) I can easily find the versions of java, ant, and mysql. Other components, however, come with these or are downloaded and installed as .jar files, so I'm not quite as clear about how to verify the versions I have installed.
How would I find the specific versions of the following:
1. Connector J (JDBC)
2. Java Servlet API
3. JavaServer Pages API
4. JSTL API
After looking online, I was able to find the versions for JSP and Servlet, though I'm still going off the documentation and not necessarily what's installed:
"Tomcat 7.0 implements Java Servlet 3.0 and JSP 2.2"

Categories