Bug 269883 - Project no longer compiles due to indirect reference error
Summary: Project no longer compiles due to indirect reference error
Status: VERIFIED NOT_ECLIPSE
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-24 15:52 EDT by Yen Lu CLA
Modified: 2009-04-28 09:28 EDT (History)
4 users (show)

See Also:


Attachments
Java source files (10.05 KB, application/x-zip-compressed)
2009-03-24 15:52 EDT, Yen Lu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yen Lu CLA 2009-03-24 15:52:03 EDT
Build ID: 3.5M6

Steps To Reproduce:
1. Create a Java project use IBM Java 6 as the JRE.

2. Add Rational Application Developer v7.5's runtimes/base_v7_stub/runtimes/websphere_apis.jar as an external jar in the Libraries tab of the Java Build Path settings for the Java project.

3. Create a package "org.example.www" and copy the Java files attached into this package.


More information:
There are error markers on org.example.www.CalculatorSOAPStub.java:

Description	Resource	Path	Location	Type
The project was not built since its build path is incomplete. Cannot find the class file for com.ibm.wsspi.webservices.rpc.handler.soap.SOAPMessageContext. Fix the build path then try building this project	jp		Unknown	Java Problem
The type com.ibm.wsspi.webservices.rpc.handler.soap.SOAPMessageContext cannot be resolved. It is indirectly referenced from required .class files	CalculatorSOAPStub.java	jp/src/org/example/www	line 84	Java Problem

This problem did not occur in previous versions of Eclipse and seems to start with 3.5M6.
Comment 1 Yen Lu CLA 2009-03-24 15:52:59 EDT
Created attachment 129750 [details]
Java source files
Comment 2 Yen Lu CLA 2009-03-24 15:56:27 EDT
websphere_apis.jar is too large to attach in this bugzilla.
Comment 3 Kent Johnson CLA 2009-03-25 11:25:32 EDT
This error is often caused by not having all the required jars on the classpath of the project.

I'll try to track down the bug that was fixed in the compiler for 3.5M6, which is now causing us to search for the missing type & jar file.

Just to let you know - when this has happened in the past, the fix for the bug is necessary & users need to add the additional jar files to their classpath.

Is there some reason the jar file cannot be added ?
Comment 4 Yen Lu CLA 2009-03-25 12:04:44 EDT
Hi,

This class was not necessary for successfully compiling these applications in the past. Our aim is to provide the minimal set of classes necessary to compile the application. Why would this be necessary now?
Comment 5 Kent Johnson CLA 2009-03-25 12:10:55 EDT
As I said, we have likely fixed a bug in the compiler which now requires us to search or resolve types that we didn't in the past.

I'll try to track down exactly which bug is affecting your case, but is there some reason this missing jar file cannot be added to your classpath ?
Comment 6 Yen Lu CLA 2009-03-25 12:17:54 EDT
The main reason we cannot simply add this jar file to the user's build path is that there isn't one - at least not one that is small enough to include. We would have to perform our static analysis again to determine if it is as simple as adding this single class or if other classes are needed to ensure this error goes away.
Comment 7 Kent Johnson CLA 2009-03-25 12:27:12 EDT
So you're able to run your app without this jar file on the runtime patch ?

And no other projects in your workspace include it on their classpath ?
Comment 8 Yen Lu CLA 2009-03-25 12:53:19 EDT
When we run our application, it runs on the WebSphere application server. A bigger set of jars is used at runtime. websphere_apis.jar is purely for compilation purposes only. Our customers use this jar only when a WebSphere application server is not available on their local system.
Comment 9 Kent Johnson CLA 2009-03-25 13:30:17 EDT
So websphere_apis.jar is supposed to include every .class file needed to compile your project, but it doesn't include com.ibm.wsspi.webservices.rpc.handler.soap.SOAPMessageContext - correct ?

But it does include some .class files with references to SOAPMessageContext & likely other missing .class files.

How is websphere_apis.jar constructed ?
Comment 10 Yen Lu CLA 2009-03-25 13:42:58 EDT
Kent, I sent you an email with more details.
Comment 11 Kent Johnson CLA 2009-03-26 14:42:23 EDT
Reproduced with this simple case & the websphere_apis.jar on the classpath :

public class X extends com.ibm.ws.webservices.engine.client.Stub {
    void test(com.ibm.ws.webservices.engine.MessageContext mc) {
        super.primeMessageContext(mc);
    }
}

The fix for bug 206930 requires the compiler to check the hierarchy of any method parameter type to see if its a raw type (only when 1.5 compliance is set).

The problem with your constructed API jar file is the type MessageContext, which is the declared parameter type of the method Stub.primeMessageContext() implements the missing interface SOAPMessageContext.

You need to ensure that the hierarchy of every type in the API jar is complete.
Comment 12 Jay Arthanareeswaran CLA 2009-04-28 09:26:01 EDT
Verified for 3.5M7