English 中文(简体)
How to Debug while Porting from Java 1.5 to 1.6?
原标题:

I have a distributed JBoss-based application that shows a buggy behavior when compiled and run with Java 1.6. It shows an another bug when compiled with Java 1.5 and run with Java 1.6. But it works fine when compiled and run with Java 1.5. What is the best approach to debug this application? Is there a lint for Java 1.5 to 1.6 conversion?

Of course the behavior also depends on the third-party libraries I am using. I am using JBoss 4.0.3 (and several other libraries too!), which I understand is a quite old version. Before I move on to upgrade the JBoss version, I want to make sure that the issue is not related to my code.

问题回答

Depending on the size of application and complexity of its calls to third party libraries, you could do this. Write mock-up methods which actually returns the value that is returned by third party library calls and compile/run it with both Java versions. In this way, you could be sure that your code is not doing anything wrong. I know this is the most painful way :). But if you already have unit tests for this application in place, you might just need small changes around it.

First of all, be certain you run with the latest version of Java 6. If you use Sun Java then the update 10 changed a LOT of things, and there was still small things being corrected in the following releases.

Secondly verify with JBoss that your version is Java 6 compatible.

If that isn t enough, you ll have to treat the differences as bugs, and figure it out one by one. At least you can run two sessions in parallel - one with Java 6 and one with Java 5 - so you can see what the expected behaviour is.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签