Cannot build hudson: Request.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot build hudson: Request.java

Richard Bair-2
I'm trying to build hudson, fails:

/Users/richardallenbair/Documents/Source/Projects/hudson/hudson/main/
remoting/src/main/java/hudson/remoting/Request.java:[76,12]  
unreported exception java.lang.Throwable; must be caught or declared  
to be thrown


This line states:

"throw exc; // some versions of JDK fails to compile this line. If  
so, upgrade your JDK."

However, I'm running:

java version "1.6.0-dp"
Java(TM) SE Runtime Environment (build 1.6.0-dp-b88-31)
Java HotSpot(TM) Client VM (build 1.6.0-b88-16-release, mixed mode,  
sharing)

I am on Mac OS X.

If you change that line to instead read:

"throw new RuntimeException(exc);"

The project builds. Not sure if you have any tight coupling to  
expecting exc somewhere instead of a Runnable wrapping it though.

Richard

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Cannot build hudson: Request.java

Kohsuke Kawaguchi-2

Hmm. I guess you must be the first person to build this on JavaSE6+Mac.

On Solaris and Windows, building this with JavaSE 6 does fix the
problem. So I'm inclined to believe that the code is right. Is this the
latest JDK6 build for Mac?

Doing "new RuntimeException(exc);" would be no good, because that would
change the type of the exception type being thrown.

Another option is to move this problematic idiom to another module and
refer it as a binary dependency. If you are using the latest JDK, I
guess we'll do this.

Richard Bair wrote:

> I'm trying to build hudson, fails:
>
> /Users/richardallenbair/Documents/Source/Projects/hudson/hudson/main/
> remoting/src/main/java/hudson/remoting/Request.java:[76,12]  
> unreported exception java.lang.Throwable; must be caught or declared  
> to be thrown
>
>
> This line states:
>
> "throw exc; // some versions of JDK fails to compile this line. If  
> so, upgrade your JDK."
>
> However, I'm running:
>
> java version "1.6.0-dp"
> Java(TM) SE Runtime Environment (build 1.6.0-dp-b88-31)
> Java HotSpot(TM) Client VM (build 1.6.0-b88-16-release, mixed mode,  
> sharing)
>
> I am on Mac OS X.
>
> If you change that line to instead read:
>
> "throw new RuntimeException(exc);"
>
> The project builds. Not sure if you have any tight coupling to  
> expecting exc somewhere instead of a Runnable wrapping it though.
>
> Richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build hudson: Request.java

Richard Bair-2
> Hmm. I guess you must be the first person to build this on JavaSE6
> +Mac.
>
> On Solaris and Windows, building this with JavaSE 6 does fix the  
> problem. So I'm inclined to believe that the code is right. Is this  
> the latest JDK6 build for Mac?

Ya. Latest that I know of. What is more interesting, is that I'm on  
an intel mac, and I thought they were pretty much doing a straight  
port of our VM and compiler.

Does it fail when compiled on 1.5? If not, I can use 1.5 to compile.

> Another option is to move this problematic idiom to another module  
> and refer it as a binary dependency. If you are using the latest  
> JDK, I guess we'll do this.

That'd be cool.

Richard



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Cannot build hudson: Request.java

Kohsuke Kawaguchi-2
Richard Bair wrote:

>> Hmm. I guess you must be the first person to build this on JavaSE6
>> +Mac.
>>
>> On Solaris and Windows, building this with JavaSE 6 does fix the  
>> problem. So I'm inclined to believe that the code is right. Is this  
>> the latest JDK6 build for Mac?
>
> Ya. Latest that I know of. What is more interesting, is that I'm on  
> an intel mac, and I thought they were pretty much doing a straight  
> port of our VM and compiler.
I noticed that your JDK build version number has b88, but on Sun's Java6
JDKs the latest build was something like b110 or so. So maybe this has
been fixed somewhere between that.

> Does it fail when compiled on 1.5? If not, I can use 1.5 to compile.

It fails on 1.5, which I really hate.

>> Another option is to move this problematic idiom to another module  
>> and refer it as a binary dependency. If you are using the latest  
>> JDK, I guess we'll do this.
>
> That'd be cool.

OK, let's try this and see if it fixes the problem.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build hudson: Request.java

Kohsuke Kawaguchi-2
Kohsuke Kawaguchi wrote:
>>> Another option is to move this problematic idiom to another module  
>>> and refer it as a binary dependency. If you are using the latest  
>>> JDK, I guess we'll do this.
>>
>> That'd be cool.
>
> OK, let's try this and see if it fixes the problem.

I noticed that there's a very similar code in UserRequest.java line 112,
but this never failed for me. Does this fail for you?

I modified Request.java to do it just like UserRequest.java, so I'm
hoping that this would work around your problem. Can you try to compile
this one more time?

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build hudson: Request.java

Richard Bair-2
>>>> Another option is to move this problematic idiom to another  
>>>> module  and refer it as a binary dependency. If you are using  
>>>> the latest  JDK, I guess we'll do this.
>>> That'd be cool.
>> OK, let's try this and see if it fixes the problem.
>
> I noticed that there's a very similar code in UserRequest.java line  
> 112, but this never failed for me. Does this fail for you?
>
> I modified Request.java to do it just like UserRequest.java, so I'm  
> hoping that this would work around your problem. Can you try to  
> compile this one more time?


Still getting this error:

/hudson/hudson/main/remoting/src/main/java/hudson/remoting/
Request.java:[78,12] unreported exception java.lang.Throwable; must  
be caught or declared to be thrown

Weird.

Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Cannot build hudson: Request.java

Kohsuke Kawaguchi-2
Richard Bair wrote:

>>>>> Another option is to move this problematic idiom to another  
>>>>> module  and refer it as a binary dependency. If you are using  
>>>>> the latest  JDK, I guess we'll do this.
>>>> That'd be cool.
>>> OK, let's try this and see if it fixes the problem.
>>
>> I noticed that there's a very similar code in UserRequest.java line  
>> 112, but this never failed for me. Does this fail for you?
>>
>> I modified Request.java to do it just like UserRequest.java, so I'm  
>> hoping that this would work around your problem. Can you try to  
>> compile this one more time?
>
>
> Still getting this error:
>
> /hudson/hudson/main/remoting/src/main/java/hudson/remoting/
> Request.java:[78,12] unreported exception java.lang.Throwable; must  
> be caught or declared to be thrown
OK, so back to the initial plan to split it out to a separate binary
dependency...

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment