You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Dave <sn...@gmail.com> on 2010/02/20 14:49:37 UTC

Possible OpenJPA or Derby bug? Re: svn commit: r911806 - in /roller/trunk

I'm tired of banging my head against this problem, so I'm reaching out
for help...

The Maven build works fine on Mac, but under Windows XP the build
fails during testing. The build starts Derby, creates tables and then
runs a bunch of tests. At some point, the tests start failing with an
exception of type java.net.BindException (see below). It's like
OpenJPA or the Derby client somehow lose the connection to Derby.

I have no idea if this is an OpenJPA bug, a Derby problem or a result
of some sin we are committing in the Roller tests/build process. If I
remove the test that is failing, then some other test will fail with
the same problem, so I don't think the problem is specific to one
test.

Any ideas from the OpenJPA or Derby experts out there? What types of
problems would lead to a bind exception on the client-side? What
should I do to debug this?

Thanks,
Dave


On Fri, Feb 19, 2010 at 8:20 AM,  <sn...@apache.org> wrote:
> Author: snoopdave
> Date: Fri Feb 19 13:20:20 2010
> New Revision: 911806
>
> URL: http://svn.apache.org/viewvc?rev=911806&view=rev
> Log:
> Fixes to make more of the Maven build work on Windows XP. Currently, at least on my machine, the build fails while running weblogger-business tests. After the bind exception below all tests fail. Maybe we are hitting some weird OpenJPA or Derby Client bug?
>
> <openjpa-1.2.1-r752877:753278 nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: java.net.BindException :
> Error connecting to server localhost on port 3219 with message Address already in use: connect.
>        at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4232)
> [...]
>        at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:294)
>        at org.apache.roller.weblogger.business.jpa.JPAUserManagerImpl.getUsers(JPAUserManagerImpl.java:309)
>        at org.apache.roller.weblogger.business.jpa.JPAUserManagerImpl.addUser(JPAUserManagerImpl.java:97)
>        at org.apache.roller.weblogger.TestUtils.setupUser(TestUtils.java:132)
>        at org.apache.roller.weblogger.business.WeblogEntryTest.setUp(WeblogEntryTest.java:76)

Re: Possible OpenJPA or Derby bug? Re: svn commit: r911806 - in /roller/trunk

Posted by Kevin Sutter <kw...@gmail.com>.
Craig's suggestion of using ConnectionRetainMode of "transaction" might
help, but that usage is not much different from the default of "on-demand".
Let us know if that makes a difference in your environment.

These type of bind exceptions normally mean that sockets are not getting
freed up.  Have you run netstat to determine what ports are currently in
use?

What is your testcase doing?  Is there any chance your application is not
cleaning up resources (ie. EntityManagers) when it's done with them?

There's not a whole lot to go off here, so I'm kind of grabbing at straws...

Kevin

On Sat, Feb 20, 2010 at 9:51 AM, Craig L Russell <Cr...@sun.com>wrote:

> Hi Dave,
>
> I've never seen this error.
>
> I'd probably focus on the connection setup. What are you using for
> connection pooling, and how are you configuring OpenJPA for connections?
> There are several connection "options" in OpenJPA that might help. My
> favorite is <property name="openjpa.ConnectionRetainMode"
> value="transaction"/>  but there are others...
>
> Craig
>
> On Feb 20, 2010, at 5:49 AM, Dave wrote:
>
>  I'm tired of banging my head against this problem, so I'm reaching out
>> for help...
>>
>> The Maven build works fine on Mac, but under Windows XP the build
>> fails during testing. The build starts Derby, creates tables and then
>> runs a bunch of tests. At some point, the tests start failing with an
>> exception of type java.net.BindException (see below). It's like
>> OpenJPA or the Derby client somehow lose the connection to Derby.
>>
>> I have no idea if this is an OpenJPA bug, a Derby problem or a result
>> of some sin we are committing in the Roller tests/build process. If I
>> remove the test that is failing, then some other test will fail with
>> the same problem, so I don't think the problem is specific to one
>> test.
>>
>> Any ideas from the OpenJPA or Derby experts out there? What types of
>> problems would lead to a bind exception on the client-side? What
>> should I do to debug this?
>>
>> Thanks,
>> Dave
>>
>>
>> On Fri, Feb 19, 2010 at 8:20 AM,  <sn...@apache.org> wrote:
>>
>>> Author: snoopdave
>>> Date: Fri Feb 19 13:20:20 2010
>>> New Revision: 911806
>>>
>>> URL: http://svn.apache.org/viewvc?rev=911806&view=rev
>>> Log:
>>> Fixes to make more of the Maven build work on Windows XP. Currently, at
>>> least on my machine, the build fails while running weblogger-business tests.
>>> After the bind exception below all tests fail. Maybe we are hitting some
>>> weird OpenJPA or Derby Client bug?
>>>
>>> <openjpa-1.2.1-r752877:753278 nonfatal general error>
>>> org.apache.openjpa.persistence.PersistenceException:
>>> java.net.BindException :
>>> Error connecting to server localhost on port 3219 with message Address
>>> already in use: connect.
>>>       at
>>> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4232)
>>> [...]
>>>       at
>>> org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:294)
>>>       at
>>> org.apache.roller.weblogger.business.jpa.JPAUserManagerImpl.getUsers(JPAUserManagerImpl.java:309)
>>>       at
>>> org.apache.roller.weblogger.business.jpa.JPAUserManagerImpl.addUser(JPAUserManagerImpl.java:97)
>>>       at
>>> org.apache.roller.weblogger.TestUtils.setupUser(TestUtils.java:132)
>>>       at
>>> org.apache.roller.weblogger.business.WeblogEntryTest.setUp(WeblogEntryTest.java:76)
>>>
>>
> Craig L Russell
> Architect, Sun Java Enterprise System http://db.apache.org/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>
>

Re: Possible OpenJPA or Derby bug? Re: svn commit: r911806 - in /roller/trunk

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Dave,

I've never seen this error.

I'd probably focus on the connection setup. What are you using for  
connection pooling, and how are you configuring OpenJPA for  
connections? There are several connection "options" in OpenJPA that  
might help. My favorite is <property  
name="openjpa.ConnectionRetainMode" value="transaction"/>  but there  
are others...

Craig

On Feb 20, 2010, at 5:49 AM, Dave wrote:

> I'm tired of banging my head against this problem, so I'm reaching out
> for help...
>
> The Maven build works fine on Mac, but under Windows XP the build
> fails during testing. The build starts Derby, creates tables and then
> runs a bunch of tests. At some point, the tests start failing with an
> exception of type java.net.BindException (see below). It's like
> OpenJPA or the Derby client somehow lose the connection to Derby.
>
> I have no idea if this is an OpenJPA bug, a Derby problem or a result
> of some sin we are committing in the Roller tests/build process. If I
> remove the test that is failing, then some other test will fail with
> the same problem, so I don't think the problem is specific to one
> test.
>
> Any ideas from the OpenJPA or Derby experts out there? What types of
> problems would lead to a bind exception on the client-side? What
> should I do to debug this?
>
> Thanks,
> Dave
>
>
> On Fri, Feb 19, 2010 at 8:20 AM,  <sn...@apache.org> wrote:
>> Author: snoopdave
>> Date: Fri Feb 19 13:20:20 2010
>> New Revision: 911806
>>
>> URL: http://svn.apache.org/viewvc?rev=911806&view=rev
>> Log:
>> Fixes to make more of the Maven build work on Windows XP.  
>> Currently, at least on my machine, the build fails while running  
>> weblogger-business tests. After the bind exception below all tests  
>> fail. Maybe we are hitting some weird OpenJPA or Derby Client bug?
>>
>> <openjpa-1.2.1-r752877:753278 nonfatal general error>
>> org.apache.openjpa.persistence.PersistenceException:  
>> java.net.BindException :
>> Error connecting to server localhost on port 3219 with message  
>> Address already in use: connect.
>>        at  
>> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java: 
>> 4232)
>> [...]
>>        at  
>> org 
>> .apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java: 
>> 294)
>>        at  
>> org 
>> .apache 
>> .roller 
>> .weblogger 
>> .business.jpa.JPAUserManagerImpl.getUsers(JPAUserManagerImpl.java: 
>> 309)
>>        at  
>> org 
>> .apache 
>> .roller 
>> .weblogger 
>> .business.jpa.JPAUserManagerImpl.addUser(JPAUserManagerImpl.java:97)
>>        at  
>> org.apache.roller.weblogger.TestUtils.setupUser(TestUtils.java:132)
>>        at  
>> org 
>> .apache 
>> .roller 
>> .weblogger.business.WeblogEntryTest.setUp(WeblogEntryTest.java:76)

Craig L Russell
Architect, Sun Java Enterprise System http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: Possible OpenJPA or Derby bug? Re: svn commit: r911806 - in /roller/trunk

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Dave,

I've never seen this error.

I'd probably focus on the connection setup. What are you using for  
connection pooling, and how are you configuring OpenJPA for  
connections? There are several connection "options" in OpenJPA that  
might help. My favorite is <property  
name="openjpa.ConnectionRetainMode" value="transaction"/>  but there  
are others...

Craig

On Feb 20, 2010, at 5:49 AM, Dave wrote:

> I'm tired of banging my head against this problem, so I'm reaching out
> for help...
>
> The Maven build works fine on Mac, but under Windows XP the build
> fails during testing. The build starts Derby, creates tables and then
> runs a bunch of tests. At some point, the tests start failing with an
> exception of type java.net.BindException (see below). It's like
> OpenJPA or the Derby client somehow lose the connection to Derby.
>
> I have no idea if this is an OpenJPA bug, a Derby problem or a result
> of some sin we are committing in the Roller tests/build process. If I
> remove the test that is failing, then some other test will fail with
> the same problem, so I don't think the problem is specific to one
> test.
>
> Any ideas from the OpenJPA or Derby experts out there? What types of
> problems would lead to a bind exception on the client-side? What
> should I do to debug this?
>
> Thanks,
> Dave
>
>
> On Fri, Feb 19, 2010 at 8:20 AM,  <sn...@apache.org> wrote:
>> Author: snoopdave
>> Date: Fri Feb 19 13:20:20 2010
>> New Revision: 911806
>>
>> URL: http://svn.apache.org/viewvc?rev=911806&view=rev
>> Log:
>> Fixes to make more of the Maven build work on Windows XP.  
>> Currently, at least on my machine, the build fails while running  
>> weblogger-business tests. After the bind exception below all tests  
>> fail. Maybe we are hitting some weird OpenJPA or Derby Client bug?
>>
>> <openjpa-1.2.1-r752877:753278 nonfatal general error>
>> org.apache.openjpa.persistence.PersistenceException:  
>> java.net.BindException :
>> Error connecting to server localhost on port 3219 with message  
>> Address already in use: connect.
>>        at  
>> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java: 
>> 4232)
>> [...]
>>        at  
>> org 
>> .apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java: 
>> 294)
>>        at  
>> org 
>> .apache 
>> .roller 
>> .weblogger 
>> .business.jpa.JPAUserManagerImpl.getUsers(JPAUserManagerImpl.java: 
>> 309)
>>        at  
>> org 
>> .apache 
>> .roller 
>> .weblogger 
>> .business.jpa.JPAUserManagerImpl.addUser(JPAUserManagerImpl.java:97)
>>        at  
>> org.apache.roller.weblogger.TestUtils.setupUser(TestUtils.java:132)
>>        at  
>> org 
>> .apache 
>> .roller 
>> .weblogger.business.WeblogEntryTest.setUp(WeblogEntryTest.java:76)

Craig L Russell
Architect, Sun Java Enterprise System http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: Possible OpenJPA or Derby bug? Re: svn commit: r911806 - in /roller/trunk

Posted by David Jencks <da...@yahoo.com>.
This is a bit off the wall since I doubt you are using jta  
transactions in roller..... however when I worked with derby + openjpa  
(quite a while ago) I needed to specify both a jta-data-source and a  
non-jta-data-source in the persistence.xml in order to get anything  
that wanted a separate tx (such as creating a new sequence value) to  
work without totally bizarre and inexplicable errors.  It looked to me  
as if whatever in openjpa was suspending/resuming the tx context was  
causing derby to completely lose track of what the connection was to.

Like I said... off the wall.... but pretty quick to check.

david jencks

On Feb 20, 2010, at 5:49 AM, Dave wrote:

> I'm tired of banging my head against this problem, so I'm reaching out
> for help...
>
> The Maven build works fine on Mac, but under Windows XP the build
> fails during testing. The build starts Derby, creates tables and then
> runs a bunch of tests. At some point, the tests start failing with an
> exception of type java.net.BindException (see below). It's like
> OpenJPA or the Derby client somehow lose the connection to Derby.
>
> I have no idea if this is an OpenJPA bug, a Derby problem or a result
> of some sin we are committing in the Roller tests/build process. If I
> remove the test that is failing, then some other test will fail with
> the same problem, so I don't think the problem is specific to one
> test.
>
> Any ideas from the OpenJPA or Derby experts out there? What types of
> problems would lead to a bind exception on the client-side? What
> should I do to debug this?
>
> Thanks,
> Dave
>
>
> On Fri, Feb 19, 2010 at 8:20 AM,  <sn...@apache.org> wrote:
>> Author: snoopdave
>> Date: Fri Feb 19 13:20:20 2010
>> New Revision: 911806
>>
>> URL: http://svn.apache.org/viewvc?rev=911806&view=rev
>> Log:
>> Fixes to make more of the Maven build work on Windows XP.  
>> Currently, at least on my machine, the build fails while running  
>> weblogger-business tests. After the bind exception below all tests  
>> fail. Maybe we are hitting some weird OpenJPA or Derby Client bug?
>>
>> <openjpa-1.2.1-r752877:753278 nonfatal general error>
>> org.apache.openjpa.persistence.PersistenceException:  
>> java.net.BindException :
>> Error connecting to server localhost on port 3219 with message  
>> Address already in use: connect.
>>        at  
>> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java: 
>> 4232)
>> [...]
>>        at  
>> org 
>> .apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java: 
>> 294)
>>        at  
>> org 
>> .apache 
>> .roller 
>> .weblogger 
>> .business.jpa.JPAUserManagerImpl.getUsers(JPAUserManagerImpl.java: 
>> 309)
>>        at  
>> org 
>> .apache 
>> .roller 
>> .weblogger 
>> .business.jpa.JPAUserManagerImpl.addUser(JPAUserManagerImpl.java:97)
>>        at  
>> org.apache.roller.weblogger.TestUtils.setupUser(TestUtils.java:132)
>>        at  
>> org 
>> .apache 
>> .roller 
>> .weblogger.business.WeblogEntryTest.setUp(WeblogEntryTest.java:76)