Bug 102492 - [quick fix] Halt in Computing serial version ID...
Summary: [quick fix] Halt in Computing serial version ID...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Tobias Widmer CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-01 11:28 EDT by Yunseuk Kim CLA Friend
Modified: 2006-03-03 04:58 EST (History)
5 users (show)

See Also:


Attachments
Patch to correctly handle bootstrap class path entries (2.69 KB, patch)
2005-08-23 06:13 EDT, Tobias Widmer CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yunseuk Kim CLA Friend 2005-07-01 11:28:51 EDT
Hello,

My work environments are like the following.
   Eclipse: 3.1
   J2SDK: j2sdk1.4.2_08
   OS: Windows XP Professional
   Plug-in: MyEclipse, XMLBuddy
   Framworks in the working project: Hibernate 3.0.5, Struts, ...

After newly installing Eclipse 3.1, I imported a project created by earlier 
versions of Eclipse from v2.1. After importing, a list of Problems were 
detected. Many of them were "The serializable class XxxxXxxx does not declare 
serialVersionUID..." in the "Problems" view. 

For the problems, I used the Quick Fix (Cntr-1) menu to "Add generated serial 
version ID." By doing this way, I created many sercialVersionUID for classes 
missing them. But the system got halt when I did the same thing for some 
classes. Those classes are marked with [*] in the list below, as examples.

[*] public class FileUploader extends HttpServlet {...}

[*] public class SysProfileWrapperImpl implements
        ProfileWrapper,
        HttpSessionBindingListener {...}

    public interface ProfileWrapper extends Serializable  {...}

[*] public class TimestampTag extends MyTagSupport {...}

    abstract public class MyTagSupport extends TagSupport {...}


The error message poped up in the [Progress Information] dialog box is 

   +---------------------------------------------------------+
   |     Computing serial version ID...                      |
   |  ||||||||||||||||||||||||||||||||                       |   
   |  Starting virtual machine...                            |
   |                                  [Cancel] [Details >>]  |
   +---------------------------------------------------------+

And it never advanced from a certain point. I clicked the [Cancel] button, and 
the button became disabled. I waited but nothing happened after that. I 
couldn't kill the dialog box and so I could get back to the main eclipse 
window. The [Detail >>] button initially appeared with disabled status.

I hope you may simulate the situation I had and fix the problem whatever the 
solution is...

I thank you very much for providing Elipse, very nice development tool for 
developers like me...

Sincerely,


Yunseuk Kim
Comment 1 Dirk Baeumer CLA Friend 2005-07-02 13:45:53 EDT
Tobias, can you please investigate. Might be a 3.1.1. candidate.
Comment 2 Dirk Baeumer CLA Friend 2005-07-11 06:06:43 EDT
Tagging as 3.1.1. Tobias, can you please investigate and explain how risky a fix
would be. 
Comment 3 Larry Edelstein CLA Friend 2005-07-25 14:39:41 EDT
Just want to note that I also have this problem - for some classes, quick-fixing
to generate the serial version ID hangs with the same dialog box reported above.

Note that I have MyEclipse installed - the 4.0M2 development release.

(In reply to comment #2)
> Tagging as 3.1.1. Tobias, can you please investigate and explain how risky a fix
> would be. 

Comment 4 Tobias Widmer CLA Friend 2005-08-09 05:13:50 EDT
Yunseuk or Larry: Could you please attach a code snippet where the defect is 
reproducible?
Comment 5 Yunseuk Kim CLA Friend 2005-08-22 14:03:39 EDT
Tobias: I was kind of busy... Here I attached the code produced the defect. 
Please let me know if you need more info. 

Thanks!

----------------------------------------
package abc.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
...

public class FileUploader extends HttpServlet {

    private static boolean COMPLETED_CLEANING = false;
    
    public FileUploader() {
        super();
    }

    public void destroy() {
        super.destroy();
        ...
    }

    public void doPost(HttpServletRequest request, HttpServletResponse response)
    	...
    }

    public void init() throws ServletException {
    	...
    }
    
    ...

}
----------------------------------------------
Comment 6 Tobias Widmer CLA Friend 2005-08-23 04:35:09 EDT
I could not possibly reproduce the defect with this snippet. You would best 
attach the project which contains the class FileUploader (or at least a 
compilable subset)
Comment 7 Tobias Widmer CLA Friend 2005-08-23 06:12:17 EDT
Found another test case: Class path containers which are explicitely put on 
the bootstrap class path. This is the setup used to put j2ee.jar on the class 
path

Attaching patch...
Comment 8 Tobias Widmer CLA Friend 2005-08-23 06:13:26 EDT
Created attachment 26369 [details]
Patch to correctly handle bootstrap class path entries
Comment 9 Tobias Widmer CLA Friend 2005-08-23 06:14:57 EDT
Dirk, Markus, can you please cast your vote?
Comment 10 Dirk Baeumer CLA Friend 2005-08-23 08:30:28 EDT
Tobias,

it looks like that classes that are on the boot class path for the project are
passed as normal class path entries to the target VM. Can this cause any problems ?
Comment 11 Tobias Widmer CLA Friend 2005-08-23 08:41:05 EDT
The only thing that matters is the order on the class path of the secondary 
VM. The appropriate JRE is the only thing which is put on the system class 
path, the rest is put on the user class path in correct order.

The only case where problems could occur are nameclashes with JRE classes.
Comment 12 Markus Keller CLA Friend 2005-08-23 11:22:02 EDT
Fix looks good and solves the problem. Go for 3.1.1.
Comment 13 Tobias Widmer CLA Friend 2005-08-23 12:15:31 EDT
Fixed in 3.1.1 maintenance branch > 20050823
Comment 14 Tobias Widmer CLA Friend 2005-08-24 08:14:03 EDT
Fixed in HEAD > 20050824

File bug 107826 for remaining issues and improvements
Comment 15 Benno Baumgartner CLA Friend 2005-09-05 06:39:18 EDT
Markus please set to Verified in M20050831-1200
Comment 16 Rafael Barbosa da Silva CLA Friend 2006-02-15 08:19:42 EST
Hi, im new here. How do I apply this patch in my eclipse ?

tks,
Rafael
Comment 17 Benno Baumgartner CLA Friend 2006-02-15 08:28:52 EST
You don't need to. This is fixed in Eclipse 3.1.1, 3.1.2 or any version released after 2005 08 24.

You can create a patch in the Team Synchronizing perspective.
You can apply a patch by right clicking on any package in the package explorer -> Team -> Apply Patch...
Comment 18 Susanne Wenz CLA Friend 2006-02-21 10:24:17 EST
Hi,
I had the mentioned problem, saw this bug and installed Eclipse 3.1.2, but I still have the problem.

Can anyone tell me, how this can happen?

Thanks
Susanne
Comment 19 Tobias Widmer CLA Friend 2006-02-21 10:27:40 EST
Remaining issues have been fixed with bug 107826
Comment 20 Susanne Wenz CLA Friend 2006-02-22 03:48:20 EST
Thank you for the hint, Tobias and sorry for bothering you again:

Now I've installed Version 3.2M5. When I choose "Add generated serial Version Id", eclipse only generates "private static final long serialVersionUID = 1L;"

Is it my fault or yours?

Thanks,
Susanne
Comment 21 Tobias Widmer CLA Friend 2006-02-22 03:51:40 EST
Does the class to generate an SUID for reference any SWT classes? If yes, we cannot fix this right now, since we are missing information about native libraries on the classpath. If not, please file a new bug report against JDT UI with exact steps to reproduce.
Comment 22 Markus Keller CLA Friend 2006-02-22 05:15:20 EST
FYI: The problem with SWT (and therefore most Eclipse UI plugins) is bug 127647.
Comment 23 Peter Peskovsky CLA Friend 2006-03-02 15:48:15 EST
Hi,
I've got the mentioned bug with Eclipse 3.1.2 with the following plugins: CDT, WTP (with prerequisites EMF,GEF,JEM and XSD), ResourceBundleEditor_0.7.2. All plugins except for the last one were downloaded yesterday. The same is for the Eclipse itself. I use JDK 1.5.0.

The problem reliably exists while generating Serial ID for the class:

package performance.monitoringagent.agent;

import java.util.Properties;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * User: Peskovsky
 * Date: 23.01.2006
 * Time: 18:45:15
 */
public class AgentProperties extends Properties {
	public static final String FILENAME = "./agent.properties";

	public static final String LISTENING_PORT = "listeningPort";
	public static final String MEASUREMENTS_GETTING_PERIOD = "measurementsPeriod";
	public static final String HISTORY_PERIOD = "historyPeriod";
	public static final String CONNECTION_ACCEPTING_TIMEOUT = "connectionAcceptingTimeout";
	public static final String MEASUREMENTS_CLEANING_PERIOD = "measurementsCleaningPeriod";
	public static final String MEASUREMENTS_OVERFLOW_CHECK_DELAY = "measurementsOverflowCheckDelay";
	public static final String INTER_REQUESTS_DELAY = "interRequestsDelay";

	private static AgentProperties agentProperties = new AgentProperties();
	static {
		try {
			agentProperties.load(new FileInputStream(FILENAME));
		} catch (IOException e) {
			System.out.println("Error reading agent.properties file.");
			e.printStackTrace();
		}
	}

	public static final String getValue(String property) {
		return AgentProperties.agentProperties.getProperty(property);
	}
}

Thanks for paying attention.
Peter
Comment 24 Peter Peskovsky CLA Friend 2006-03-02 15:51:16 EST
Sorry, I've not mentioned your last comment.
Comment 25 Tobias Widmer CLA Friend 2006-03-03 04:58:46 EST
Please do not comment on already closed bugs, but rather open a new one if the problem has not been fixed in the 3.2 stream.