You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Kevin Menard <km...@servprise.com> on 2007/12/28 19:59:44 UTC

Building Cayenne on Java 6

.. . . is likely going to be a pipedream.

It appears Sun went out of their way to make the interface changes
incompatible between Java 5 & Java 6.  Not only do the interface changes add
new methods, but these new methods use new types.  So, throwing runtime
exceptions isn't an option because the types aren't available to a Java 5
compiler.  Not implementing a methods won't work in a Java 6 compiler
because the interface isn't fully implemented at that point.  So, we have a
software engineering 101 principle violated.

Fortunately, a Cayenne JAR built in Java 5 works fine in Java 6.  Anyone
that wants to build the code in Java 6 is going to have problems though.
Oh, and just to make matters worse, the Windows Java 6 installer throws its
executables into %System32% so they get found on the path first.  So, not
only do you have to make Java 5 your JAVA_HOME (in order for mvn to work),
but you also have to blow out those binaries in order for the correct javac
to be used in general.

Lots of fun.  Thank you, Sun.

-- 
Kevin


Re: Building Cayenne on Java 6

Posted by Andrus Adamchik <an...@objectstyle.org>.
Same here - this discussion prompted me to look at 1.6 once again and  
actually think about a solution.

Cheers,
Andrus


On Jan 7, 2008, at 12:34 AM, Jason Dwyer wrote:

> heh,
>
> i didnt even try 1.5 again after it built with 1.6! d'oh!
>
> and yes, it would achieve the necessary result by adding the new
> interface methods to the classes, my intention was to encapsulate  
> these
> to isolate any further future changes in these areas.
>
> ( still, it proved an interesting dig going through the newer 1.6
> javax.sql stuff, and while the submitted patch wont be useful  
> directly,
> i did get a chance to see where cayenne is headed again...)
>
> cheers,
>
> j
>
> On Sun, 2008-01-06 at 12:32 +0200, Andrus Adamchik wrote:
>> Hi Jason,
>>
>> I think the stumbling block was all the new interfaces that existing
>> JDBC interfaces return from the new methods (SQLXML, NClob, etc.). I
>> don't see how the patch addresses it. Essentially the patch bumps up
>> the version of our implementations to Java 1.6, but makes it
>> incompatible with Java 1.5 compile environment.
>>
>> As a temporary solution I guess we can stub the missing interface
>> dependencies for Java 5 compilation purposes, making a small Maven
>> module with "provided" scope. But if we do, then we don't need to
>> change the existing inheritance hierarchy. We can simply implement  
>> the
>> missing methods.
>>
>> Or did I overlook something obvious?
>>
>> Cheers,
>> Andrus
>>
>>
>> On Jan 6, 2008, at 6:53 AM, Jason Dwyer wrote:
>>> hi all,
>>>
>>> its been a while since i've had much time to keep up with cayenne,  
>>> but
>>> have found a bit of space to flick through the dev mailing list in  
>>> the
>>> last couple of days, and came across this thread.
>>>
>>> at first i thought 'bah, they wouldnt have broken the interfaces  
>>> would
>>> they'? then, re-checking out the source and hooking it up in eclipse
>>> with default java ( 1.6.0-sun ), found exactly what kevin came  
>>> across!
>>>
>>> ( however, i'll be more prosaic and not blame sun directly, i  
>>> suspect
>>> something/someone in the jcp came up with it...)
>>>
>>> anyway, i had time to have a bit of a poke and a shuffle, and have
>>> come
>>> up with a rough-ish patch that i've attached to CAY-955, which  
>>> _seems_
>>> to be doing the trick at least in my linux/java 6/eclipse  
>>> environment:
>>> unit tests pass ok, but theres some ITests that fail ( not sure if
>>> thats
>>> due to my changes in the patch or if i hadnt set up the environment
>>> for
>>> it ).
>>>
>>> it provides a shallow hierarchy that provides some abstract classes
>>> for
>>> Connection, DataSource, PooledDataSource and ResultSetMetaData,  
>>> which
>>> were the ones mostly affected by the inclusion of Wrapper in the
>>> implements clause for each of these in java 6. these abstract  
>>> classes
>>> will obviously need filling out ( they're mostly just default auto- 
>>> gen
>>> method bodies ), but the patch should be a good start.
>>>
>>> alas i dont think i'll have much more time to dig through cayenne
>>> again
>>> for a bit: back to the grind after the xmas break tomorrow, and it
>>> keeps
>>> me pretty busy, so if the patch is good, then great, otherwise, oh
>>> well!
>>>
>>> cheers,
>>>
>>> j
>>>
>>>
>>>
>>> On Sun, 2007-12-30 at 13:57 -0500, Kevin Menard wrote:
>>>> It's really unfortunate because Java 6 is ridiculously faster than
>>>> Java
>>>> 5, at least on Windows.  I have a group of functional tests that  
>>>> were
>>>> cut by 50% just by bumping the JDK version.
>>>>
>>>> Oh well.
>>>>
>>>
>>>
>>
>
>


Re: Building Cayenne on Java 6

Posted by Jason Dwyer <Ja...@redata.com.au>.
heh,

i didnt even try 1.5 again after it built with 1.6! d'oh!

and yes, it would achieve the necessary result by adding the new
interface methods to the classes, my intention was to encapsulate these
to isolate any further future changes in these areas.

( still, it proved an interesting dig going through the newer 1.6
javax.sql stuff, and while the submitted patch wont be useful directly,
i did get a chance to see where cayenne is headed again...)

cheers,

j

On Sun, 2008-01-06 at 12:32 +0200, Andrus Adamchik wrote:
> Hi Jason,
> 
> I think the stumbling block was all the new interfaces that existing  
> JDBC interfaces return from the new methods (SQLXML, NClob, etc.). I  
> don't see how the patch addresses it. Essentially the patch bumps up  
> the version of our implementations to Java 1.6, but makes it  
> incompatible with Java 1.5 compile environment.
> 
> As a temporary solution I guess we can stub the missing interface  
> dependencies for Java 5 compilation purposes, making a small Maven  
> module with "provided" scope. But if we do, then we don't need to  
> change the existing inheritance hierarchy. We can simply implement the  
> missing methods.
> 
> Or did I overlook something obvious?
> 
> Cheers,
> Andrus
> 
> 
> On Jan 6, 2008, at 6:53 AM, Jason Dwyer wrote:
> > hi all,
> >
> > its been a while since i've had much time to keep up with cayenne, but
> > have found a bit of space to flick through the dev mailing list in the
> > last couple of days, and came across this thread.
> >
> > at first i thought 'bah, they wouldnt have broken the interfaces would
> > they'? then, re-checking out the source and hooking it up in eclipse
> > with default java ( 1.6.0-sun ), found exactly what kevin came across!
> >
> > ( however, i'll be more prosaic and not blame sun directly, i suspect
> > something/someone in the jcp came up with it...)
> >
> > anyway, i had time to have a bit of a poke and a shuffle, and have  
> > come
> > up with a rough-ish patch that i've attached to CAY-955, which _seems_
> > to be doing the trick at least in my linux/java 6/eclipse environment:
> > unit tests pass ok, but theres some ITests that fail ( not sure if  
> > thats
> > due to my changes in the patch or if i hadnt set up the environment  
> > for
> > it ).
> >
> > it provides a shallow hierarchy that provides some abstract classes  
> > for
> > Connection, DataSource, PooledDataSource and ResultSetMetaData, which
> > were the ones mostly affected by the inclusion of Wrapper in the
> > implements clause for each of these in java 6. these abstract classes
> > will obviously need filling out ( they're mostly just default auto-gen
> > method bodies ), but the patch should be a good start.
> >
> > alas i dont think i'll have much more time to dig through cayenne  
> > again
> > for a bit: back to the grind after the xmas break tomorrow, and it  
> > keeps
> > me pretty busy, so if the patch is good, then great, otherwise, oh  
> > well!
> >
> > cheers,
> >
> > j
> >
> >
> >
> > On Sun, 2007-12-30 at 13:57 -0500, Kevin Menard wrote:
> >> It's really unfortunate because Java 6 is ridiculously faster than  
> >> Java
> >> 5, at least on Windows.  I have a group of functional tests that were
> >> cut by 50% just by bumping the JDK version.
> >>
> >> Oh well.
> >>
> >
> >
> 


Re: Building Cayenne on Java 6

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Jason,

I think the stumbling block was all the new interfaces that existing  
JDBC interfaces return from the new methods (SQLXML, NClob, etc.). I  
don't see how the patch addresses it. Essentially the patch bumps up  
the version of our implementations to Java 1.6, but makes it  
incompatible with Java 1.5 compile environment.

As a temporary solution I guess we can stub the missing interface  
dependencies for Java 5 compilation purposes, making a small Maven  
module with "provided" scope. But if we do, then we don't need to  
change the existing inheritance hierarchy. We can simply implement the  
missing methods.

Or did I overlook something obvious?

Cheers,
Andrus


On Jan 6, 2008, at 6:53 AM, Jason Dwyer wrote:
> hi all,
>
> its been a while since i've had much time to keep up with cayenne, but
> have found a bit of space to flick through the dev mailing list in the
> last couple of days, and came across this thread.
>
> at first i thought 'bah, they wouldnt have broken the interfaces would
> they'? then, re-checking out the source and hooking it up in eclipse
> with default java ( 1.6.0-sun ), found exactly what kevin came across!
>
> ( however, i'll be more prosaic and not blame sun directly, i suspect
> something/someone in the jcp came up with it...)
>
> anyway, i had time to have a bit of a poke and a shuffle, and have  
> come
> up with a rough-ish patch that i've attached to CAY-955, which _seems_
> to be doing the trick at least in my linux/java 6/eclipse environment:
> unit tests pass ok, but theres some ITests that fail ( not sure if  
> thats
> due to my changes in the patch or if i hadnt set up the environment  
> for
> it ).
>
> it provides a shallow hierarchy that provides some abstract classes  
> for
> Connection, DataSource, PooledDataSource and ResultSetMetaData, which
> were the ones mostly affected by the inclusion of Wrapper in the
> implements clause for each of these in java 6. these abstract classes
> will obviously need filling out ( they're mostly just default auto-gen
> method bodies ), but the patch should be a good start.
>
> alas i dont think i'll have much more time to dig through cayenne  
> again
> for a bit: back to the grind after the xmas break tomorrow, and it  
> keeps
> me pretty busy, so if the patch is good, then great, otherwise, oh  
> well!
>
> cheers,
>
> j
>
>
>
> On Sun, 2007-12-30 at 13:57 -0500, Kevin Menard wrote:
>> It's really unfortunate because Java 6 is ridiculously faster than  
>> Java
>> 5, at least on Windows.  I have a group of functional tests that were
>> cut by 50% just by bumping the JDK version.
>>
>> Oh well.
>>
>
>


RE: Building Cayenne on Java 6

Posted by Jason Dwyer <Ja...@redata.com.au>.
hi all,

its been a while since i've had much time to keep up with cayenne, but
have found a bit of space to flick through the dev mailing list in the
last couple of days, and came across this thread.

at first i thought 'bah, they wouldnt have broken the interfaces would
they'? then, re-checking out the source and hooking it up in eclipse
with default java ( 1.6.0-sun ), found exactly what kevin came across!

( however, i'll be more prosaic and not blame sun directly, i suspect
something/someone in the jcp came up with it...)

anyway, i had time to have a bit of a poke and a shuffle, and have come
up with a rough-ish patch that i've attached to CAY-955, which _seems_
to be doing the trick at least in my linux/java 6/eclipse environment:
unit tests pass ok, but theres some ITests that fail ( not sure if thats
due to my changes in the patch or if i hadnt set up the environment for
it ).

it provides a shallow hierarchy that provides some abstract classes for
Connection, DataSource, PooledDataSource and ResultSetMetaData, which
were the ones mostly affected by the inclusion of Wrapper in the
implements clause for each of these in java 6. these abstract classes
will obviously need filling out ( they're mostly just default auto-gen
method bodies ), but the patch should be a good start.

alas i dont think i'll have much more time to dig through cayenne again
for a bit: back to the grind after the xmas break tomorrow, and it keeps
me pretty busy, so if the patch is good, then great, otherwise, oh well!

cheers,

j



On Sun, 2007-12-30 at 13:57 -0500, Kevin Menard wrote:
> It's really unfortunate because Java 6 is ridiculously faster than Java
> 5, at least on Windows.  I have a group of functional tests that were
> cut by 50% just by bumping the JDK version.
> 
> Oh well.
> 


RE: Building Cayenne on Java 6

Posted by Kevin Menard <km...@servprise.com>.
It's really unfortunate because Java 6 is ridiculously faster than Java
5, at least on Windows.  I have a group of functional tests that were
cut by 50% just by bumping the JDK version.

Oh well.

-- 
Kevin

-----Original Message-----
From: Mike Kienenberger [mailto:mkienenb@gmail.com] 
Sent: Saturday, December 29, 2007 1:10 PM
To: dev@cayenne.apache.org
Subject: Re: Building Cayenne on Java 6

My windows box(es) have been asking to install Java 6 for a few months
now.   Thankfully, I haven't yet agreed to do it :-)



Re: Building Cayenne on Java 6

Posted by Mike Kienenberger <mk...@gmail.com>.
My windows box(es) have been asking to install Java 6 for a few months
now.   Thankfully, I haven't yet agreed to do it :-)

On Dec 28, 2007 2:10 PM, Michael Gentry <bl...@gmail.com> wrote:
> Fortunately (?), Apple hasn't put Java 6 on my computer yet.  :-)
>
>
> On Dec 28, 2007 1:59 PM, Kevin Menard <km...@servprise.com> wrote:
> > .. . . is likely going to be a pipedream.
> >
> > It appears Sun went out of their way to make the interface changes
> > incompatible between Java 5 & Java 6.  Not only do the interface changes add
> > new methods, but these new methods use new types.  So, throwing runtime
> > exceptions isn't an option because the types aren't available to a Java 5
> > compiler.  Not implementing a methods won't work in a Java 6 compiler
> > because the interface isn't fully implemented at that point.  So, we have a
> > software engineering 101 principle violated.
> >
> > Fortunately, a Cayenne JAR built in Java 5 works fine in Java 6.  Anyone
> > that wants to build the code in Java 6 is going to have problems though.
> > Oh, and just to make matters worse, the Windows Java 6 installer throws its
> > executables into %System32% so they get found on the path first.  So, not
> > only do you have to make Java 5 your JAVA_HOME (in order for mvn to work),
> > but you also have to blow out those binaries in order for the correct javac
> > to be used in general.
> >
> > Lots of fun.  Thank you, Sun.
> >
> > --
> > Kevin
> >
> >
>

Re: Building Cayenne on Java 6

Posted by Michael Gentry <bl...@gmail.com>.
Fortunately (?), Apple hasn't put Java 6 on my computer yet.  :-)

On Dec 28, 2007 1:59 PM, Kevin Menard <km...@servprise.com> wrote:
> .. . . is likely going to be a pipedream.
>
> It appears Sun went out of their way to make the interface changes
> incompatible between Java 5 & Java 6.  Not only do the interface changes add
> new methods, but these new methods use new types.  So, throwing runtime
> exceptions isn't an option because the types aren't available to a Java 5
> compiler.  Not implementing a methods won't work in a Java 6 compiler
> because the interface isn't fully implemented at that point.  So, we have a
> software engineering 101 principle violated.
>
> Fortunately, a Cayenne JAR built in Java 5 works fine in Java 6.  Anyone
> that wants to build the code in Java 6 is going to have problems though.
> Oh, and just to make matters worse, the Windows Java 6 installer throws its
> executables into %System32% so they get found on the path first.  So, not
> only do you have to make Java 5 your JAVA_HOME (in order for mvn to work),
> but you also have to blow out those binaries in order for the correct javac
> to be used in general.
>
> Lots of fun.  Thank you, Sun.
>
> --
> Kevin
>
>