Quantcast

Detected Reentrant Flush

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Detected Reentrant Flush

slimsalmon
I'm attempting the code:

Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");
InitialContext initialContext = new InitialContext(properties);
Object object = initialContext.lookup("UserFacadeLocal");
UserFacadeLocal userFacade = (UserFacadeLocal) object;
User newuser = new User();
newuser.setEmail("[hidden email]");
newuser.setUserName("steve");
newuser.setPassword("cows");
userFacade.create(newuser);

but keep getting "org.apache.openjpa.persistence.InvalidStateException:
Detected reentrant flush.  Make sure your flush-time instance callback
methods or event listeners do not invoke any operations that require the
in-progress flush to complete."

I tried setting "openjpa.FlushBeforeQueries" to false just to see if I
can get the error to go away, but it makes no difference.  I can't find
a flush() call in my project and according to the table in the docs,
flush is not called if this parameter is set.  What am I not doing
correctly here?

Thank you,
David
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

Romain Manni-Bucau
Hi,

any entity listener playing with id or special field on User entity?

- Romain


2012/7/8 David Nordahl <[hidden email]>

> I'm attempting the code:
>
> Properties properties = new Properties();
> properties.setProperty(**Context.INITIAL_CONTEXT_**FACTORY,
> "org.apache.openejb.client.**LocalInitialContextFactory");
> InitialContext initialContext = new InitialContext(properties);
> Object object = initialContext.lookup("**UserFacadeLocal");
> UserFacadeLocal userFacade = (UserFacadeLocal) object;
> User newuser = new User();
> newuser.setEmail("[hidden email]"**);
> newuser.setUserName("steve");
> newuser.setPassword("cows");
> userFacade.create(newuser);
>
> but keep getting "org.apache.openjpa.**persistence.**InvalidStateException:
> Detected reentrant flush.  Make sure your flush-time instance callback
> methods or event listeners do not invoke any operations that require the
> in-progress flush to complete."
>
> I tried setting "openjpa.FlushBeforeQueries" to false just to see if I can
> get the error to go away, but it makes no difference.  I can't find a
> flush() call in my project and according to the table in the docs, flush is
> not called if this parameter is set.  What am I not doing correctly here?
>
> Thank you,
> David
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

slimsalmon
Not that I've configured.. Unless one of the annotations creates one:

@Entity
@Table(name = "user")
@XmlRootElement
@NamedQueries({
     @NamedQuery(name = "User.findAll", query = "SELECT u FROM User u"),
     @NamedQuery(name = "User.findByUserId", query = "SELECT u FROM User
u WHERE u.userId = :userId"),
     @NamedQuery(name = "User.findByUserName", query = "SELECT u FROM
User u WHERE u.userName = :userName"),
     @NamedQuery(name = "User.findByPassword", query = "SELECT u FROM
User u WHERE u.password = :password"),
     @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM User
u WHERE u.email = :email"),
     @NamedQuery(name = "User.findByFirstName", query = "SELECT u FROM
User u WHERE u.firstName = :firstName"),
     @NamedQuery(name = "User.findByLastName", query = "SELECT u FROM
User u WHERE u.lastName = :lastName"),
     @NamedQuery(name = "User.findByLoginFailures", query = "SELECT u
FROM User u WHERE u.loginFailures = :loginFailures"),
     @NamedQuery(name = "User.findByLastLoginFailure", query = "SELECT u
FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
public class User implements Serializable {
     private static final long serialVersionUID = 1L;
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Basic(optional = false)
     @Column(name = "user_id")
     private Integer userId;
     @Basic(optional = false)
     @Column(name = "user_name")
     private String userName;
     @Basic(optional = false)
     @Column(name = "password")
     private String password;
     @Column(name = "email")
     private String email;
     @Column(name = "first_name")
     private String firstName;
     @Column(name = "last_name")
     private String lastName;
     @Column(name = "login_failures")
     private Integer loginFailures;
     @Column(name = "last_login_failure")
     @Temporal(TemporalType.TIMESTAMP)
     private Date lastLoginFailure;
     @JoinColumn(name = "associated_customer", referencedColumnName =
"customer_id")
     @ManyToOne

On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:

> Hi,
>
> any entity listener playing with id or special field on User entity?
>
> - Romain
>
>
> 2012/7/8 David Nordahl<[hidden email]>
>
>> I'm attempting the code:
>>
>> Properties properties = new Properties();
>> properties.setProperty(**Context.INITIAL_CONTEXT_**FACTORY,
>> "org.apache.openejb.client.**LocalInitialContextFactory");
>> InitialContext initialContext = new InitialContext(properties);
>> Object object = initialContext.lookup("**UserFacadeLocal");
>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>> User newuser = new User();
>> newuser.setEmail("[hidden email]"**);
>> newuser.setUserName("steve");
>> newuser.setPassword("cows");
>> userFacade.create(newuser);
>>
>> but keep getting "org.apache.openjpa.**persistence.**InvalidStateException:
>> Detected reentrant flush.  Make sure your flush-time instance callback
>> methods or event listeners do not invoke any operations that require the
>> in-progress flush to complete."
>>
>> I tried setting "openjpa.FlushBeforeQueries" to false just to see if I can
>> get the error to go away, but it makes no difference.  I can't find a
>> flush() call in my project and according to the table in the docs, flush is
>> not called if this parameter is set.  What am I not doing correctly here?
>>
>> Thank you,
>> David
>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

Romain Manni-Bucau
can you share a small sample to reproduce it, will be easier to help you?

- Romain


2012/7/8 David Nordahl <[hidden email]>

> Not that I've configured.. Unless one of the annotations creates one:
>
> @Entity
> @Table(name = "user")
> @XmlRootElement
> @NamedQueries({
>     @NamedQuery(name = "User.findAll", query = "SELECT u FROM User u"),
>     @NamedQuery(name = "User.findByUserId", query = "SELECT u FROM User u
> WHERE u.userId = :userId"),
>     @NamedQuery(name = "User.findByUserName", query = "SELECT u FROM User
> u WHERE u.userName = :userName"),
>     @NamedQuery(name = "User.findByPassword", query = "SELECT u FROM User
> u WHERE u.password = :password"),
>     @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM User u
> WHERE u.email = :email"),
>     @NamedQuery(name = "User.findByFirstName", query = "SELECT u FROM User
> u WHERE u.firstName = :firstName"),
>     @NamedQuery(name = "User.findByLastName", query = "SELECT u FROM User
> u WHERE u.lastName = :lastName"),
>     @NamedQuery(name = "User.findByLoginFailures", query = "SELECT u FROM
> User u WHERE u.loginFailures = :loginFailures"),
>     @NamedQuery(name = "User.findByLastLoginFailure", query = "SELECT u
> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
> public class User implements Serializable {
>     private static final long serialVersionUID = 1L;
>     @Id
>     @GeneratedValue(strategy = GenerationType.IDENTITY)
>     @Basic(optional = false)
>     @Column(name = "user_id")
>     private Integer userId;
>     @Basic(optional = false)
>     @Column(name = "user_name")
>     private String userName;
>     @Basic(optional = false)
>     @Column(name = "password")
>     private String password;
>     @Column(name = "email")
>     private String email;
>     @Column(name = "first_name")
>     private String firstName;
>     @Column(name = "last_name")
>     private String lastName;
>     @Column(name = "login_failures")
>     private Integer loginFailures;
>     @Column(name = "last_login_failure")
>     @Temporal(TemporalType.**TIMESTAMP)
>     private Date lastLoginFailure;
>     @JoinColumn(name = "associated_customer", referencedColumnName =
> "customer_id")
>     @ManyToOne
>
>
> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>
>> Hi,
>>
>> any entity listener playing with id or special field on User entity?
>>
>> - Romain
>>
>>
>> 2012/7/8 David Nordahl<[hidden email]>
>>
>>  I'm attempting the code:
>>>
>>> Properties properties = new Properties();
>>> properties.setProperty(****Context.INITIAL_CONTEXT_****FACTORY,
>>> "org.apache.openejb.client.****LocalInitialContextFactory");
>>>
>>> InitialContext initialContext = new InitialContext(properties);
>>> Object object = initialContext.lookup("****UserFacadeLocal");
>>>
>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>> User newuser = new User();
>>> newuser.setEmail("[hidden email]"****);
>>>
>>> newuser.setUserName("steve");
>>> newuser.setPassword("cows");
>>> userFacade.create(newuser);
>>>
>>> but keep getting "org.apache.openjpa.****persistence.****
>>> InvalidStateException:
>>>
>>> Detected reentrant flush.  Make sure your flush-time instance callback
>>> methods or event listeners do not invoke any operations that require the
>>> in-progress flush to complete."
>>>
>>> I tried setting "openjpa.FlushBeforeQueries" to false just to see if I
>>> can
>>> get the error to go away, but it makes no difference.  I can't find a
>>> flush() call in my project and according to the table in the docs, flush
>>> is
>>> not called if this parameter is set.  What am I not doing correctly here?
>>>
>>> Thank you,
>>> David
>>>
>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

slimsalmon
Maybe the DB settings could have something to do with it? I'm using
MySQL with it's default setup which uses InnoDB.  I notice in the
documentation that "InnoDB, with innodb_flush_log_at_trx_commit set to
1, flushes the transaction log after each transaction, greatly improving
reliability."

Could some DB setting like this be causing the issue?


On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:

> can you share a small sample to reproduce it, will be easier to help you?
>
> - Romain
>
>
> 2012/7/8 David Nordahl<[hidden email]>
>
>> Not that I've configured.. Unless one of the annotations creates one:
>>
>> @Entity
>> @Table(name = "user")
>> @XmlRootElement
>> @NamedQueries({
>>      @NamedQuery(name = "User.findAll", query = "SELECT u FROM User u"),
>>      @NamedQuery(name = "User.findByUserId", query = "SELECT u FROM User u
>> WHERE u.userId = :userId"),
>>      @NamedQuery(name = "User.findByUserName", query = "SELECT u FROM User
>> u WHERE u.userName = :userName"),
>>      @NamedQuery(name = "User.findByPassword", query = "SELECT u FROM User
>> u WHERE u.password = :password"),
>>      @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM User u
>> WHERE u.email = :email"),
>>      @NamedQuery(name = "User.findByFirstName", query = "SELECT u FROM User
>> u WHERE u.firstName = :firstName"),
>>      @NamedQuery(name = "User.findByLastName", query = "SELECT u FROM User
>> u WHERE u.lastName = :lastName"),
>>      @NamedQuery(name = "User.findByLoginFailures", query = "SELECT u FROM
>> User u WHERE u.loginFailures = :loginFailures"),
>>      @NamedQuery(name = "User.findByLastLoginFailure", query = "SELECT u
>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>> public class User implements Serializable {
>>      private static final long serialVersionUID = 1L;
>>      @Id
>>      @GeneratedValue(strategy = GenerationType.IDENTITY)
>>      @Basic(optional = false)
>>      @Column(name = "user_id")
>>      private Integer userId;
>>      @Basic(optional = false)
>>      @Column(name = "user_name")
>>      private String userName;
>>      @Basic(optional = false)
>>      @Column(name = "password")
>>      private String password;
>>      @Column(name = "email")
>>      private String email;
>>      @Column(name = "first_name")
>>      private String firstName;
>>      @Column(name = "last_name")
>>      private String lastName;
>>      @Column(name = "login_failures")
>>      private Integer loginFailures;
>>      @Column(name = "last_login_failure")
>>      @Temporal(TemporalType.**TIMESTAMP)
>>      private Date lastLoginFailure;
>>      @JoinColumn(name = "associated_customer", referencedColumnName =
>> "customer_id")
>>      @ManyToOne
>>
>>
>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>
>>> Hi,
>>>
>>> any entity listener playing with id or special field on User entity?
>>>
>>> - Romain
>>>
>>>
>>> 2012/7/8 David Nordahl<[hidden email]>
>>>
>>>   I'm attempting the code:
>>>> Properties properties = new Properties();
>>>> properties.setProperty(****Context.INITIAL_CONTEXT_****FACTORY,
>>>> "org.apache.openejb.client.****LocalInitialContextFactory");
>>>>
>>>> InitialContext initialContext = new InitialContext(properties);
>>>> Object object = initialContext.lookup("****UserFacadeLocal");
>>>>
>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>> User newuser = new User();
>>>> newuser.setEmail("[hidden email]"****);
>>>>
>>>> newuser.setUserName("steve");
>>>> newuser.setPassword("cows");
>>>> userFacade.create(newuser);
>>>>
>>>> but keep getting "org.apache.openjpa.****persistence.****
>>>> InvalidStateException:
>>>>
>>>> Detected reentrant flush.  Make sure your flush-time instance callback
>>>> methods or event listeners do not invoke any operations that require the
>>>> in-progress flush to complete."
>>>>
>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to see if I
>>>> can
>>>> get the error to go away, but it makes no difference.  I can't find a
>>>> flush() call in my project and according to the table in the docs, flush
>>>> is
>>>> not called if this parameter is set.  What am I not doing correctly here?
>>>>
>>>> Thank you,
>>>> David
>>>>
>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

Romain Manni-Bucau
i can't say no but i'm pretty sure it is something in the container rather
in the DB.

- Romain


2012/7/8 David Nordahl <[hidden email]>

> Maybe the DB settings could have something to do with it? I'm using MySQL
> with it's default setup which uses InnoDB.  I notice in the documentation
> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes the
> transaction log after each transaction, greatly improving reliability."
>
> Could some DB setting like this be causing the issue?
>
>
>
> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>
>> can you share a small sample to reproduce it, will be easier to help you?
>>
>> - Romain
>>
>>
>> 2012/7/8 David Nordahl<[hidden email]>
>>
>>  Not that I've configured.. Unless one of the annotations creates one:
>>>
>>> @Entity
>>> @Table(name = "user")
>>> @XmlRootElement
>>> @NamedQueries({
>>>      @NamedQuery(name = "User.findAll", query = "SELECT u FROM User u"),
>>>      @NamedQuery(name = "User.findByUserId", query = "SELECT u FROM User
>>> u
>>> WHERE u.userId = :userId"),
>>>      @NamedQuery(name = "User.findByUserName", query = "SELECT u FROM
>>> User
>>> u WHERE u.userName = :userName"),
>>>      @NamedQuery(name = "User.findByPassword", query = "SELECT u FROM
>>> User
>>> u WHERE u.password = :password"),
>>>      @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM User u
>>> WHERE u.email = :email"),
>>>      @NamedQuery(name = "User.findByFirstName", query = "SELECT u FROM
>>> User
>>> u WHERE u.firstName = :firstName"),
>>>      @NamedQuery(name = "User.findByLastName", query = "SELECT u FROM
>>> User
>>> u WHERE u.lastName = :lastName"),
>>>      @NamedQuery(name = "User.findByLoginFailures", query = "SELECT u
>>> FROM
>>> User u WHERE u.loginFailures = :loginFailures"),
>>>      @NamedQuery(name = "User.findByLastLoginFailure", query = "SELECT u
>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>> public class User implements Serializable {
>>>      private static final long serialVersionUID = 1L;
>>>      @Id
>>>      @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>      @Basic(optional = false)
>>>      @Column(name = "user_id")
>>>      private Integer userId;
>>>      @Basic(optional = false)
>>>      @Column(name = "user_name")
>>>      private String userName;
>>>      @Basic(optional = false)
>>>      @Column(name = "password")
>>>      private String password;
>>>      @Column(name = "email")
>>>      private String email;
>>>      @Column(name = "first_name")
>>>      private String firstName;
>>>      @Column(name = "last_name")
>>>      private String lastName;
>>>      @Column(name = "login_failures")
>>>      private Integer loginFailures;
>>>      @Column(name = "last_login_failure")
>>>      @Temporal(TemporalType.****TIMESTAMP)
>>>
>>>      private Date lastLoginFailure;
>>>      @JoinColumn(name = "associated_customer", referencedColumnName =
>>> "customer_id")
>>>      @ManyToOne
>>>
>>>
>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>
>>>  Hi,
>>>>
>>>> any entity listener playing with id or special field on User entity?
>>>>
>>>> - Romain
>>>>
>>>>
>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>
>>>>   I'm attempting the code:
>>>>
>>>>> Properties properties = new Properties();
>>>>> properties.setProperty(******Context.INITIAL_CONTEXT_******FACTORY,
>>>>> "org.apache.openejb.client.******LocalInitialContextFactory");
>>>>>
>>>>>
>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>> Object object = initialContext.lookup("******UserFacadeLocal");
>>>>>
>>>>>
>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>> User newuser = new User();
>>>>> newuser.setEmail("[hidden email]"******);
>>>>>
>>>>>
>>>>> newuser.setUserName("steve");
>>>>> newuser.setPassword("cows");
>>>>> userFacade.create(newuser);
>>>>>
>>>>> but keep getting "org.apache.openjpa.******persistence.****
>>>>>
>>>>> InvalidStateException:
>>>>>
>>>>> Detected reentrant flush.  Make sure your flush-time instance callback
>>>>> methods or event listeners do not invoke any operations that require
>>>>> the
>>>>> in-progress flush to complete."
>>>>>
>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to see if I
>>>>> can
>>>>> get the error to go away, but it makes no difference.  I can't find a
>>>>> flush() call in my project and according to the table in the docs,
>>>>> flush
>>>>> is
>>>>> not called if this parameter is set.  What am I not doing correctly
>>>>> here?
>>>>>
>>>>> Thank you,
>>>>> David
>>>>>
>>>>>
>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

slimsalmon
Could it be the Tomcat JDBCRealm I have enforcing container managed
security from user data in the same table?

On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:

> i can't say no but i'm pretty sure it is something in the container rather
> in the DB.
>
> - Romain
>
>
> 2012/7/8 David Nordahl<[hidden email]>
>
>> Maybe the DB settings could have something to do with it? I'm using MySQL
>> with it's default setup which uses InnoDB.  I notice in the documentation
>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes the
>> transaction log after each transaction, greatly improving reliability."
>>
>> Could some DB setting like this be causing the issue?
>>
>>
>>
>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>
>>> can you share a small sample to reproduce it, will be easier to help you?
>>>
>>> - Romain
>>>
>>>
>>> 2012/7/8 David Nordahl<[hidden email]>
>>>
>>>   Not that I've configured.. Unless one of the annotations creates one:
>>>> @Entity
>>>> @Table(name = "user")
>>>> @XmlRootElement
>>>> @NamedQueries({
>>>>       @NamedQuery(name = "User.findAll", query = "SELECT u FROM User u"),
>>>>       @NamedQuery(name = "User.findByUserId", query = "SELECT u FROM User
>>>> u
>>>> WHERE u.userId = :userId"),
>>>>       @NamedQuery(name = "User.findByUserName", query = "SELECT u FROM
>>>> User
>>>> u WHERE u.userName = :userName"),
>>>>       @NamedQuery(name = "User.findByPassword", query = "SELECT u FROM
>>>> User
>>>> u WHERE u.password = :password"),
>>>>       @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM User u
>>>> WHERE u.email = :email"),
>>>>       @NamedQuery(name = "User.findByFirstName", query = "SELECT u FROM
>>>> User
>>>> u WHERE u.firstName = :firstName"),
>>>>       @NamedQuery(name = "User.findByLastName", query = "SELECT u FROM
>>>> User
>>>> u WHERE u.lastName = :lastName"),
>>>>       @NamedQuery(name = "User.findByLoginFailures", query = "SELECT u
>>>> FROM
>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>       @NamedQuery(name = "User.findByLastLoginFailure", query = "SELECT u
>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>> public class User implements Serializable {
>>>>       private static final long serialVersionUID = 1L;
>>>>       @Id
>>>>       @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>       @Basic(optional = false)
>>>>       @Column(name = "user_id")
>>>>       private Integer userId;
>>>>       @Basic(optional = false)
>>>>       @Column(name = "user_name")
>>>>       private String userName;
>>>>       @Basic(optional = false)
>>>>       @Column(name = "password")
>>>>       private String password;
>>>>       @Column(name = "email")
>>>>       private String email;
>>>>       @Column(name = "first_name")
>>>>       private String firstName;
>>>>       @Column(name = "last_name")
>>>>       private String lastName;
>>>>       @Column(name = "login_failures")
>>>>       private Integer loginFailures;
>>>>       @Column(name = "last_login_failure")
>>>>       @Temporal(TemporalType.****TIMESTAMP)
>>>>
>>>>       private Date lastLoginFailure;
>>>>       @JoinColumn(name = "associated_customer", referencedColumnName =
>>>> "customer_id")
>>>>       @ManyToOne
>>>>
>>>>
>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>
>>>>   Hi,
>>>>> any entity listener playing with id or special field on User entity?
>>>>>
>>>>> - Romain
>>>>>
>>>>>
>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>
>>>>>    I'm attempting the code:
>>>>>
>>>>>> Properties properties = new Properties();
>>>>>> properties.setProperty(******Context.INITIAL_CONTEXT_******FACTORY,
>>>>>> "org.apache.openejb.client.******LocalInitialContextFactory");
>>>>>>
>>>>>>
>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>> Object object = initialContext.lookup("******UserFacadeLocal");
>>>>>>
>>>>>>
>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>> User newuser = new User();
>>>>>> newuser.setEmail("[hidden email]"******);
>>>>>>
>>>>>>
>>>>>> newuser.setUserName("steve");
>>>>>> newuser.setPassword("cows");
>>>>>> userFacade.create(newuser);
>>>>>>
>>>>>> but keep getting "org.apache.openjpa.******persistence.****
>>>>>>
>>>>>> InvalidStateException:
>>>>>>
>>>>>> Detected reentrant flush.  Make sure your flush-time instance callback
>>>>>> methods or event listeners do not invoke any operations that require
>>>>>> the
>>>>>> in-progress flush to complete."
>>>>>>
>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to see if I
>>>>>> can
>>>>>> get the error to go away, but it makes no difference.  I can't find a
>>>>>> flush() call in my project and according to the table in the docs,
>>>>>> flush
>>>>>> is
>>>>>> not called if this parameter is set.  What am I not doing correctly
>>>>>> here?
>>>>>>
>>>>>> Thank you,
>>>>>> David
>>>>>>
>>>>>>
>>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

Romain Manni-Bucau
i don't think so,

can you try moving your code in a unit test to see if it still happen?

- Romain


2012/7/8 David Nordahl <[hidden email]>

> Could it be the Tomcat JDBCRealm I have enforcing container managed
> security from user data in the same table?
>
>
> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>
>> i can't say no but i'm pretty sure it is something in the container rather
>> in the DB.
>>
>> - Romain
>>
>>
>> 2012/7/8 David Nordahl<[hidden email]>
>>
>>  Maybe the DB settings could have something to do with it? I'm using MySQL
>>> with it's default setup which uses InnoDB.  I notice in the documentation
>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes the
>>> transaction log after each transaction, greatly improving reliability."
>>>
>>> Could some DB setting like this be causing the issue?
>>>
>>>
>>>
>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>
>>>  can you share a small sample to reproduce it, will be easier to help
>>>> you?
>>>>
>>>> - Romain
>>>>
>>>>
>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>
>>>>   Not that I've configured.. Unless one of the annotations creates one:
>>>>
>>>>> @Entity
>>>>> @Table(name = "user")
>>>>> @XmlRootElement
>>>>> @NamedQueries({
>>>>>       @NamedQuery(name = "User.findAll", query = "SELECT u FROM User
>>>>> u"),
>>>>>       @NamedQuery(name = "User.findByUserId", query = "SELECT u FROM
>>>>> User
>>>>> u
>>>>> WHERE u.userId = :userId"),
>>>>>       @NamedQuery(name = "User.findByUserName", query = "SELECT u FROM
>>>>> User
>>>>> u WHERE u.userName = :userName"),
>>>>>       @NamedQuery(name = "User.findByPassword", query = "SELECT u FROM
>>>>> User
>>>>> u WHERE u.password = :password"),
>>>>>       @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM
>>>>> User u
>>>>> WHERE u.email = :email"),
>>>>>       @NamedQuery(name = "User.findByFirstName", query = "SELECT u FROM
>>>>> User
>>>>> u WHERE u.firstName = :firstName"),
>>>>>       @NamedQuery(name = "User.findByLastName", query = "SELECT u FROM
>>>>> User
>>>>> u WHERE u.lastName = :lastName"),
>>>>>       @NamedQuery(name = "User.findByLoginFailures", query = "SELECT u
>>>>> FROM
>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>       @NamedQuery(name = "User.findByLastLoginFailure", query =
>>>>> "SELECT u
>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>> public class User implements Serializable {
>>>>>       private static final long serialVersionUID = 1L;
>>>>>       @Id
>>>>>       @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>       @Basic(optional = false)
>>>>>       @Column(name = "user_id")
>>>>>       private Integer userId;
>>>>>       @Basic(optional = false)
>>>>>       @Column(name = "user_name")
>>>>>       private String userName;
>>>>>       @Basic(optional = false)
>>>>>       @Column(name = "password")
>>>>>       private String password;
>>>>>       @Column(name = "email")
>>>>>       private String email;
>>>>>       @Column(name = "first_name")
>>>>>       private String firstName;
>>>>>       @Column(name = "last_name")
>>>>>       private String lastName;
>>>>>       @Column(name = "login_failures")
>>>>>       private Integer loginFailures;
>>>>>       @Column(name = "last_login_failure")
>>>>>       @Temporal(TemporalType.******TIMESTAMP)
>>>>>
>>>>>
>>>>>       private Date lastLoginFailure;
>>>>>       @JoinColumn(name = "associated_customer", referencedColumnName =
>>>>> "customer_id")
>>>>>       @ManyToOne
>>>>>
>>>>>
>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>
>>>>>   Hi,
>>>>>
>>>>>> any entity listener playing with id or special field on User entity?
>>>>>>
>>>>>> - Romain
>>>>>>
>>>>>>
>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>
>>>>>>    I'm attempting the code:
>>>>>>
>>>>>>  Properties properties = new Properties();
>>>>>>> properties.setProperty(********Context.INITIAL_CONTEXT_********
>>>>>>> FACTORY,
>>>>>>> "org.apache.openejb.client.********LocalInitialContextFactory"**);
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>>> Object object = initialContext.lookup("********UserFacadeLocal");
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>> User newuser = new User();
>>>>>>> newuser.setEmail("[hidden email]"********);
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> newuser.setUserName("steve");
>>>>>>> newuser.setPassword("cows");
>>>>>>> userFacade.create(newuser);
>>>>>>>
>>>>>>> but keep getting "org.apache.openjpa.********persistence.****
>>>>>>>
>>>>>>>
>>>>>>> InvalidStateException:
>>>>>>>
>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>> callback
>>>>>>> methods or event listeners do not invoke any operations that require
>>>>>>> the
>>>>>>> in-progress flush to complete."
>>>>>>>
>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to see if
>>>>>>> I
>>>>>>> can
>>>>>>> get the error to go away, but it makes no difference.  I can't find a
>>>>>>> flush() call in my project and according to the table in the docs,
>>>>>>> flush
>>>>>>> is
>>>>>>> not called if this parameter is set.  What am I not doing correctly
>>>>>>> here?
>>>>>>>
>>>>>>> Thank you,
>>>>>>> David
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

slimsalmon
Btw.. Is it normal to have these exceptions on startup?  I saw another
post saying they were, but I thought I might double check.  I seem to be
able to query through open EJB, but not update and add.  I'm also
wondering if there is anyway that the reentrant flush error is covering
up another error.  I guess I can start working on a test case.. I wish I
could just find a netbeans JSP2.0/EJB/TomEE sample project where
everything was already setup correctly.

SEVERE: Error in safeBind method
javax.naming.NameNotFoundException: Name [openejb] is not bound in this
Context. Unable to find [openejb].
     at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
     at
org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1196)
     at
org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:776)
     at
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:103)
     at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
     at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
     at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
     at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
     at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
     at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
     at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
     at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:530)
     at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1471)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:601)
     at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
     at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
     at
org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1436)
     at
org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:856)
     at
org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:353)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
     at
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
     at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
     at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
     at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
     at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
     at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
     at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
     at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
     at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
     at java.lang.Thread.run(Thread.java:722)

Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.TomcatWebAppBuilder
safeBind
INFO: TransactionManager already bound, ignoring
Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.TomcatWebAppBuilder
safeBind
INFO: TransactionSynchronizationRegistry already bound, ignoring
Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.TomcatWebAppBuilder
safeBind
SEVERE: Error in safeBind method
javax.naming.NameNotFoundException: No ORB registered with the OpenEJB
system
     at
org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
     at
org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
     at
org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
     at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
     at
org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1196)
     at
org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:806)
     at
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:103)
     at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
     at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
     at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
     at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
     at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
     at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
     at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
     at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:530)
     at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1471)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:601)
     at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
     at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
     at
org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1436)
     at
org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:856)
     at
org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:353)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
     at
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
     at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
     at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
     at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
     at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
     at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
     at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
     at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
     at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
     at java.lang.Thread.run(Thread.java:722)

Jul 08, 2012 4:40:43 PM org.apache.tomee.catalina.TomcatWebAppBuilder
safeBind
SEVERE: Error in safeBind method
javax.naming.NameNotFoundException: No HandleDelegate registered with
the OpenEJB system
     at
org.apache.openejb.core.ivm.naming.SystemComponentReference.getObject(SystemComponentReference.java:38)
     at
org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:40)
     at
org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
     at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
     at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
     at
org.apache.tomee.catalina.TomcatWebAppBuilder.safeBind(TomcatWebAppBuilder.java:1196)
     at
org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:807)
     at
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:103)
     at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
     at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
     at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
     at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
     at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
     at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
     at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
     at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:530)
     at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1471)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:601)
     at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
     at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
     at
org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1436)
     at
org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:856)
     at
org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:353)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
     at
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
     at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
     at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
     at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
     at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
     at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
     at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
     at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
     at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
     at java.lang.Thread.run(Thread.java:722)


On 7/8/2012 4:32 PM, Romain Manni-Bucau wrote:

> i don't think so,
>
> can you try moving your code in a unit test to see if it still happen?
>
> - Romain
>
>
> 2012/7/8 David Nordahl<[hidden email]>
>
>> Could it be the Tomcat JDBCRealm I have enforcing container managed
>> security from user data in the same table?
>>
>>
>> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>>
>>> i can't say no but i'm pretty sure it is something in the container rather
>>> in the DB.
>>>
>>> - Romain
>>>
>>>
>>> 2012/7/8 David Nordahl<[hidden email]>
>>>
>>>   Maybe the DB settings could have something to do with it? I'm using MySQL
>>>> with it's default setup which uses InnoDB.  I notice in the documentation
>>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes the
>>>> transaction log after each transaction, greatly improving reliability."
>>>>
>>>> Could some DB setting like this be causing the issue?
>>>>
>>>>
>>>>
>>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>>
>>>>   can you share a small sample to reproduce it, will be easier to help
>>>>> you?
>>>>>
>>>>> - Romain
>>>>>
>>>>>
>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>
>>>>>    Not that I've configured.. Unless one of the annotations creates one:
>>>>>
>>>>>> @Entity
>>>>>> @Table(name = "user")
>>>>>> @XmlRootElement
>>>>>> @NamedQueries({
>>>>>>        @NamedQuery(name = "User.findAll", query = "SELECT u FROM User
>>>>>> u"),
>>>>>>        @NamedQuery(name = "User.findByUserId", query = "SELECT u FROM
>>>>>> User
>>>>>> u
>>>>>> WHERE u.userId = :userId"),
>>>>>>        @NamedQuery(name = "User.findByUserName", query = "SELECT u FROM
>>>>>> User
>>>>>> u WHERE u.userName = :userName"),
>>>>>>        @NamedQuery(name = "User.findByPassword", query = "SELECT u FROM
>>>>>> User
>>>>>> u WHERE u.password = :password"),
>>>>>>        @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM
>>>>>> User u
>>>>>> WHERE u.email = :email"),
>>>>>>        @NamedQuery(name = "User.findByFirstName", query = "SELECT u FROM
>>>>>> User
>>>>>> u WHERE u.firstName = :firstName"),
>>>>>>        @NamedQuery(name = "User.findByLastName", query = "SELECT u FROM
>>>>>> User
>>>>>> u WHERE u.lastName = :lastName"),
>>>>>>        @NamedQuery(name = "User.findByLoginFailures", query = "SELECT u
>>>>>> FROM
>>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>>        @NamedQuery(name = "User.findByLastLoginFailure", query =
>>>>>> "SELECT u
>>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>>> public class User implements Serializable {
>>>>>>        private static final long serialVersionUID = 1L;
>>>>>>        @Id
>>>>>>        @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>>        @Basic(optional = false)
>>>>>>        @Column(name = "user_id")
>>>>>>        private Integer userId;
>>>>>>        @Basic(optional = false)
>>>>>>        @Column(name = "user_name")
>>>>>>        private String userName;
>>>>>>        @Basic(optional = false)
>>>>>>        @Column(name = "password")
>>>>>>        private String password;
>>>>>>        @Column(name = "email")
>>>>>>        private String email;
>>>>>>        @Column(name = "first_name")
>>>>>>        private String firstName;
>>>>>>        @Column(name = "last_name")
>>>>>>        private String lastName;
>>>>>>        @Column(name = "login_failures")
>>>>>>        private Integer loginFailures;
>>>>>>        @Column(name = "last_login_failure")
>>>>>>        @Temporal(TemporalType.******TIMESTAMP)
>>>>>>
>>>>>>
>>>>>>        private Date lastLoginFailure;
>>>>>>        @JoinColumn(name = "associated_customer", referencedColumnName =
>>>>>> "customer_id")
>>>>>>        @ManyToOne
>>>>>>
>>>>>>
>>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>>
>>>>>>    Hi,
>>>>>>
>>>>>>> any entity listener playing with id or special field on User entity?
>>>>>>>
>>>>>>> - Romain
>>>>>>>
>>>>>>>
>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>
>>>>>>>     I'm attempting the code:
>>>>>>>
>>>>>>>   Properties properties = new Properties();
>>>>>>>> properties.setProperty(********Context.INITIAL_CONTEXT_********
>>>>>>>> FACTORY,
>>>>>>>> "org.apache.openejb.client.********LocalInitialContextFactory"**);
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>>>> Object object = initialContext.lookup("********UserFacadeLocal");
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>>> User newuser = new User();
>>>>>>>> newuser.setEmail("[hidden email]"********);
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> newuser.setUserName("steve");
>>>>>>>> newuser.setPassword("cows");
>>>>>>>> userFacade.create(newuser);
>>>>>>>>
>>>>>>>> but keep getting "org.apache.openjpa.********persistence.****
>>>>>>>>
>>>>>>>>
>>>>>>>> InvalidStateException:
>>>>>>>>
>>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>>> callback
>>>>>>>> methods or event listeners do not invoke any operations that require
>>>>>>>> the
>>>>>>>> in-progress flush to complete."
>>>>>>>>
>>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to see if
>>>>>>>> I
>>>>>>>> can
>>>>>>>> get the error to go away, but it makes no difference.  I can't find a
>>>>>>>> flush() call in my project and according to the table in the docs,
>>>>>>>> flush
>>>>>>>> is
>>>>>>>> not called if this parameter is set.  What am I not doing correctly
>>>>>>>> here?
>>>>>>>>
>>>>>>>> Thank you,
>>>>>>>> David
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

Romain Manni-Bucau
hmm

you use tomee 1.0.0

can you give it a try to the snapshot please? we worked a bit on netbeans
integration.

- Romain


2012/7/8 David Nordahl <[hidden email]>

> Btw.. Is it normal to have these exceptions on startup?  I saw another
> post saying they were, but I thought I might double check.  I seem to be
> able to query through open EJB, but not update and add.  I'm also wondering
> if there is anyway that the reentrant flush error is covering up another
> error.  I guess I can start working on a test case.. I wish I could just
> find a netbeans JSP2.0/EJB/TomEE sample project where everything was
> already setup correctly.
>
> SEVERE: Error in safeBind method
> javax.naming.**NameNotFoundException: Name [openejb] is not bound in this
> Context. Unable to find [openejb].
>     at org.apache.naming.**NamingContext.lookup(**NamingContext.java:820)
>     at org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>     at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
> TomcatWebAppBuilder.java:1196)
>     at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
> TomcatWebAppBuilder.java:776)
>     at org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
> **GlobalListenerSupport.java:**103)
>     at org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
> LifecycleSupport.java:119)
>     at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
> LifecycleBase.java:90)
>     at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
> LifecycleBase.java:401)
>     at org.apache.catalina.util.**LifecycleBase.start(**
> LifecycleBase.java:168)
>     at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
> ContainerBase.java:895)
>     at org.apache.catalina.core.**ContainerBase.addChild(**
> ContainerBase.java:871)
>     at org.apache.catalina.core.**StandardHost.addChild(**
> StandardHost.java:615)
>     at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
> HostConfig.java:649)
>     at org.apache.catalina.startup.**HostConfig.deployApps(**
> HostConfig.java:530)
>     at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
> java:1471)
>     at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>     at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
> NativeMethodAccessorImpl.java:**57)
>     at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
> DelegatingMethodAccessorImpl.**java:43)
>     at java.lang.reflect.Method.**invoke(Method.java:601)
>     at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
> BaseModelMBean.java:301)
>     at com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
> DefaultMBeanServerInterceptor.**java:819)
>     at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
> JmxMBeanServer.java:791)
>     at org.apache.catalina.manager.**ManagerServlet.check(**
> ManagerServlet.java:1436)
>     at org.apache.catalina.manager.**ManagerServlet.deploy(**
> ManagerServlet.java:856)
>     at org.apache.catalina.manager.**ManagerServlet.doGet(**
> ManagerServlet.java:353)
>     at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>     at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>     at org.apache.catalina.core.**ApplicationFilterChain.**
> internalDoFilter(**ApplicationFilterChain.java:**305)
>     at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
> ApplicationFilterChain.java:**210)
>     at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
> doFilter(**SetCharacterEncodingFilter.**java:108)
>     at org.apache.catalina.core.**ApplicationFilterChain.**
> internalDoFilter(**ApplicationFilterChain.java:**243)
>     at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
> ApplicationFilterChain.java:**210)
>     at org.apache.catalina.core.**StandardWrapperValve.invoke(**
> StandardWrapperValve.java:225)
>     at org.apache.catalina.core.**StandardContextValve.invoke(**
> StandardContextValve.java:169)
>     at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
> OpenEJBValve.java:44)
>     at org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
> AuthenticatorBase.java:581)
>     at org.apache.catalina.core.**StandardHostValve.invoke(**
> StandardHostValve.java:168)
>     at org.apache.catalina.valves.**ErrorReportValve.invoke(**
> ErrorReportValve.java:98)
>     at org.apache.catalina.valves.**AccessLogValve.invoke(**
> AccessLogValve.java:927)
>     at org.apache.catalina.core.**StandardEngineValve.invoke(**
> StandardEngineValve.java:118)
>     at org.apache.catalina.connector.**CoyoteAdapter.service(**
> CoyoteAdapter.java:407)
>     at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
> AbstractHttp11Processor.java:**999)
>     at org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
> process(AbstractProtocol.java:**565)
>     at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
> run(JIoEndpoint.java:309)
>     at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
> ThreadPoolExecutor.java:1110)
>     at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
> ThreadPoolExecutor.java:603)
>     at java.lang.Thread.run(Thread.**java:722)
>
> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
> safeBind
> INFO: TransactionManager already bound, ignoring
> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
> safeBind
> INFO: TransactionSynchronizationRegi**stry already bound, ignoring
> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
> safeBind
> SEVERE: Error in safeBind method
> javax.naming.**NameNotFoundException: No ORB registered with the OpenEJB
> system
>     at org.apache.openejb.core.ivm.**naming.**SystemComponentReference.**
> getObject(**SystemComponentReference.java:**38)
>     at org.apache.openejb.core.ivm.**naming.Reference.getContent(**
> Reference.java:40)
>     at org.apache.xbean.naming.**reference.SimpleReference$**
> SimpleObjectFactory.**getObjectInstance(**SimpleReference.java:137)
>     at javax.naming.spi.**NamingManager.**getObjectInstance(**
> NamingManager.java:321)
>     at org.apache.naming.**NamingContext.lookup(**NamingContext.java:843)
>     at org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>     at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
> TomcatWebAppBuilder.java:1196)
>     at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
> TomcatWebAppBuilder.java:806)
>     at org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
> **GlobalListenerSupport.java:**103)
>     at org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
> LifecycleSupport.java:119)
>     at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
> LifecycleBase.java:90)
>     at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
> LifecycleBase.java:401)
>     at org.apache.catalina.util.**LifecycleBase.start(**
> LifecycleBase.java:168)
>     at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
> ContainerBase.java:895)
>     at org.apache.catalina.core.**ContainerBase.addChild(**
> ContainerBase.java:871)
>     at org.apache.catalina.core.**StandardHost.addChild(**
> StandardHost.java:615)
>     at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
> HostConfig.java:649)
>     at org.apache.catalina.startup.**HostConfig.deployApps(**
> HostConfig.java:530)
>     at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
> java:1471)
>     at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>     at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
> NativeMethodAccessorImpl.java:**57)
>     at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
> DelegatingMethodAccessorImpl.**java:43)
>     at java.lang.reflect.Method.**invoke(Method.java:601)
>     at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
> BaseModelMBean.java:301)
>     at com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
> DefaultMBeanServerInterceptor.**java:819)
>     at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
> JmxMBeanServer.java:791)
>     at org.apache.catalina.manager.**ManagerServlet.check(**
> ManagerServlet.java:1436)
>     at org.apache.catalina.manager.**ManagerServlet.deploy(**
> ManagerServlet.java:856)
>     at org.apache.catalina.manager.**ManagerServlet.doGet(**
> ManagerServlet.java:353)
>     at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>     at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>     at org.apache.catalina.core.**ApplicationFilterChain.**
> internalDoFilter(**ApplicationFilterChain.java:**305)
>     at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
> ApplicationFilterChain.java:**210)
>     at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
> doFilter(**SetCharacterEncodingFilter.**java:108)
>     at org.apache.catalina.core.**ApplicationFilterChain.**
> internalDoFilter(**ApplicationFilterChain.java:**243)
>     at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
> ApplicationFilterChain.java:**210)
>     at org.apache.catalina.core.**StandardWrapperValve.invoke(**
> StandardWrapperValve.java:225)
>     at org.apache.catalina.core.**StandardContextValve.invoke(**
> StandardContextValve.java:169)
>     at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
> OpenEJBValve.java:44)
>     at org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
> AuthenticatorBase.java:581)
>     at org.apache.catalina.core.**StandardHostValve.invoke(**
> StandardHostValve.java:168)
>     at org.apache.catalina.valves.**ErrorReportValve.invoke(**
> ErrorReportValve.java:98)
>     at org.apache.catalina.valves.**AccessLogValve.invoke(**
> AccessLogValve.java:927)
>     at org.apache.catalina.core.**StandardEngineValve.invoke(**
> StandardEngineValve.java:118)
>     at org.apache.catalina.connector.**CoyoteAdapter.service(**
> CoyoteAdapter.java:407)
>     at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
> AbstractHttp11Processor.java:**999)
>     at org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
> process(AbstractProtocol.java:**565)
>     at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
> run(JIoEndpoint.java:309)
>     at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
> ThreadPoolExecutor.java:1110)
>     at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
> ThreadPoolExecutor.java:603)
>     at java.lang.Thread.run(Thread.**java:722)
>
> Jul 08, 2012 4:40:43 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
> safeBind
> SEVERE: Error in safeBind method
> javax.naming.**NameNotFoundException: No HandleDelegate registered with
> the OpenEJB system
>     at org.apache.openejb.core.ivm.**naming.**SystemComponentReference.**
> getObject(**SystemComponentReference.java:**38)
>     at org.apache.openejb.core.ivm.**naming.Reference.getContent(**
> Reference.java:40)
>     at org.apache.xbean.naming.**reference.SimpleReference$**
> SimpleObjectFactory.**getObjectInstance(**SimpleReference.java:137)
>     at javax.naming.spi.**NamingManager.**getObjectInstance(**
> NamingManager.java:321)
>     at org.apache.naming.**NamingContext.lookup(**NamingContext.java:843)
>     at org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>     at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
> TomcatWebAppBuilder.java:1196)
>     at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
> TomcatWebAppBuilder.java:807)
>     at org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
> **GlobalListenerSupport.java:**103)
>     at org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
> LifecycleSupport.java:119)
>     at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
> LifecycleBase.java:90)
>     at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
> LifecycleBase.java:401)
>     at org.apache.catalina.util.**LifecycleBase.start(**
> LifecycleBase.java:168)
>     at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
> ContainerBase.java:895)
>     at org.apache.catalina.core.**ContainerBase.addChild(**
> ContainerBase.java:871)
>     at org.apache.catalina.core.**StandardHost.addChild(**
> StandardHost.java:615)
>     at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
> HostConfig.java:649)
>     at org.apache.catalina.startup.**HostConfig.deployApps(**
> HostConfig.java:530)
>     at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
> java:1471)
>     at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>     at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
> NativeMethodAccessorImpl.java:**57)
>     at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
> DelegatingMethodAccessorImpl.**java:43)
>     at java.lang.reflect.Method.**invoke(Method.java:601)
>     at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
> BaseModelMBean.java:301)
>     at com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
> DefaultMBeanServerInterceptor.**java:819)
>     at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
> JmxMBeanServer.java:791)
>     at org.apache.catalina.manager.**ManagerServlet.check(**
> ManagerServlet.java:1436)
>     at org.apache.catalina.manager.**ManagerServlet.deploy(**
> ManagerServlet.java:856)
>     at org.apache.catalina.manager.**ManagerServlet.doGet(**
> ManagerServlet.java:353)
>     at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>     at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>     at org.apache.catalina.core.**ApplicationFilterChain.**
> internalDoFilter(**ApplicationFilterChain.java:**305)
>     at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
> ApplicationFilterChain.java:**210)
>     at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
> doFilter(**SetCharacterEncodingFilter.**java:108)
>     at org.apache.catalina.core.**ApplicationFilterChain.**
> internalDoFilter(**ApplicationFilterChain.java:**243)
>     at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
> ApplicationFilterChain.java:**210)
>     at org.apache.catalina.core.**StandardWrapperValve.invoke(**
> StandardWrapperValve.java:225)
>     at org.apache.catalina.core.**StandardContextValve.invoke(**
> StandardContextValve.java:169)
>     at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
> OpenEJBValve.java:44)
>     at org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
> AuthenticatorBase.java:581)
>     at org.apache.catalina.core.**StandardHostValve.invoke(**
> StandardHostValve.java:168)
>     at org.apache.catalina.valves.**ErrorReportValve.invoke(**
> ErrorReportValve.java:98)
>     at org.apache.catalina.valves.**AccessLogValve.invoke(**
> AccessLogValve.java:927)
>     at org.apache.catalina.core.**StandardEngineValve.invoke(**
> StandardEngineValve.java:118)
>     at org.apache.catalina.connector.**CoyoteAdapter.service(**
> CoyoteAdapter.java:407)
>     at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
> AbstractHttp11Processor.java:**999)
>     at org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
> process(AbstractProtocol.java:**565)
>     at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
> run(JIoEndpoint.java:309)
>     at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
> ThreadPoolExecutor.java:1110)
>     at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
> ThreadPoolExecutor.java:603)
>     at java.lang.Thread.run(Thread.**java:722)
>
>
>
> On 7/8/2012 4:32 PM, Romain Manni-Bucau wrote:
>
>> i don't think so,
>>
>> can you try moving your code in a unit test to see if it still happen?
>>
>> - Romain
>>
>>
>> 2012/7/8 David Nordahl<[hidden email]>
>>
>>  Could it be the Tomcat JDBCRealm I have enforcing container managed
>>> security from user data in the same table?
>>>
>>>
>>> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>>>
>>>  i can't say no but i'm pretty sure it is something in the container
>>>> rather
>>>> in the DB.
>>>>
>>>> - Romain
>>>>
>>>>
>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>
>>>>   Maybe the DB settings could have something to do with it? I'm using
>>>> MySQL
>>>>
>>>>> with it's default setup which uses InnoDB.  I notice in the
>>>>> documentation
>>>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes the
>>>>> transaction log after each transaction, greatly improving reliability."
>>>>>
>>>>> Could some DB setting like this be causing the issue?
>>>>>
>>>>>
>>>>>
>>>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>>>
>>>>>   can you share a small sample to reproduce it, will be easier to help
>>>>>
>>>>>> you?
>>>>>>
>>>>>> - Romain
>>>>>>
>>>>>>
>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>
>>>>>>    Not that I've configured.. Unless one of the annotations creates
>>>>>> one:
>>>>>>
>>>>>>  @Entity
>>>>>>> @Table(name = "user")
>>>>>>> @XmlRootElement
>>>>>>> @NamedQueries({
>>>>>>>        @NamedQuery(name = "User.findAll", query = "SELECT u FROM User
>>>>>>> u"),
>>>>>>>        @NamedQuery(name = "User.findByUserId", query = "SELECT u FROM
>>>>>>> User
>>>>>>> u
>>>>>>> WHERE u.userId = :userId"),
>>>>>>>        @NamedQuery(name = "User.findByUserName", query = "SELECT u
>>>>>>> FROM
>>>>>>> User
>>>>>>> u WHERE u.userName = :userName"),
>>>>>>>        @NamedQuery(name = "User.findByPassword", query = "SELECT u
>>>>>>> FROM
>>>>>>> User
>>>>>>> u WHERE u.password = :password"),
>>>>>>>        @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM
>>>>>>> User u
>>>>>>> WHERE u.email = :email"),
>>>>>>>        @NamedQuery(name = "User.findByFirstName", query = "SELECT u
>>>>>>> FROM
>>>>>>> User
>>>>>>> u WHERE u.firstName = :firstName"),
>>>>>>>        @NamedQuery(name = "User.findByLastName", query = "SELECT u
>>>>>>> FROM
>>>>>>> User
>>>>>>> u WHERE u.lastName = :lastName"),
>>>>>>>        @NamedQuery(name = "User.findByLoginFailures", query =
>>>>>>> "SELECT u
>>>>>>> FROM
>>>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>>>        @NamedQuery(name = "User.findByLastLoginFailure", query =
>>>>>>> "SELECT u
>>>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>>>> public class User implements Serializable {
>>>>>>>        private static final long serialVersionUID = 1L;
>>>>>>>        @Id
>>>>>>>        @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>>>        @Basic(optional = false)
>>>>>>>        @Column(name = "user_id")
>>>>>>>        private Integer userId;
>>>>>>>        @Basic(optional = false)
>>>>>>>        @Column(name = "user_name")
>>>>>>>        private String userName;
>>>>>>>        @Basic(optional = false)
>>>>>>>        @Column(name = "password")
>>>>>>>        private String password;
>>>>>>>        @Column(name = "email")
>>>>>>>        private String email;
>>>>>>>        @Column(name = "first_name")
>>>>>>>        private String firstName;
>>>>>>>        @Column(name = "last_name")
>>>>>>>        private String lastName;
>>>>>>>        @Column(name = "login_failures")
>>>>>>>        private Integer loginFailures;
>>>>>>>        @Column(name = "last_login_failure")
>>>>>>>        @Temporal(TemporalType.********TIMESTAMP)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>        private Date lastLoginFailure;
>>>>>>>        @JoinColumn(name = "associated_customer",
>>>>>>> referencedColumnName =
>>>>>>> "customer_id")
>>>>>>>        @ManyToOne
>>>>>>>
>>>>>>>
>>>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>>>
>>>>>>>    Hi,
>>>>>>>
>>>>>>>  any entity listener playing with id or special field on User entity?
>>>>>>>>
>>>>>>>> - Romain
>>>>>>>>
>>>>>>>>
>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>
>>>>>>>>     I'm attempting the code:
>>>>>>>>
>>>>>>>>   Properties properties = new Properties();
>>>>>>>>
>>>>>>>>> properties.setProperty(**********Context.INITIAL_CONTEXT_*******
>>>>>>>>> ***
>>>>>>>>> FACTORY,
>>>>>>>>> "org.apache.openejb.client.************
>>>>>>>>> LocalInitialContextFactory"**)**;
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>>>>> Object object = initialContext.lookup("*********
>>>>>>>>> *UserFacadeLocal");
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>>>> User newuser = new User();
>>>>>>>>> newuser.setEmail("[hidden email]"**********);
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> newuser.setUserName("steve");
>>>>>>>>> newuser.setPassword("cows");
>>>>>>>>> userFacade.create(newuser);
>>>>>>>>>
>>>>>>>>> but keep getting "org.apache.openjpa.**********persistence.****
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> InvalidStateException:
>>>>>>>>>
>>>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>>>> callback
>>>>>>>>> methods or event listeners do not invoke any operations that
>>>>>>>>> require
>>>>>>>>> the
>>>>>>>>> in-progress flush to complete."
>>>>>>>>>
>>>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to see
>>>>>>>>> if
>>>>>>>>> I
>>>>>>>>> can
>>>>>>>>> get the error to go away, but it makes no difference.  I can't
>>>>>>>>> find a
>>>>>>>>> flush() call in my project and according to the table in the docs,
>>>>>>>>> flush
>>>>>>>>> is
>>>>>>>>> not called if this parameter is set.  What am I not doing correctly
>>>>>>>>> here?
>>>>>>>>>
>>>>>>>>> Thank you,
>>>>>>>>> David
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

slimsalmon
Tried the snap shot.. I get an error in Netbeans saying that it can't
deploy the app and to check the server log, yet the server log has no
errors and shows the app deploying successfully yet I cannot open the
web host in the browser.  I give up... I could have written all the
middle ware needed for this project myself by now.  Thanks for your
efforts.

On 7/8/2012 4:56 PM, Romain Manni-Bucau wrote:

> hmm
>
> you use tomee 1.0.0
>
> can you give it a try to the snapshot please? we worked a bit on netbeans
> integration.
>
> - Romain
>
>
> 2012/7/8 David Nordahl<[hidden email]>
>
>> Btw.. Is it normal to have these exceptions on startup?  I saw another
>> post saying they were, but I thought I might double check.  I seem to be
>> able to query through open EJB, but not update and add.  I'm also wondering
>> if there is anyway that the reentrant flush error is covering up another
>> error.  I guess I can start working on a test case.. I wish I could just
>> find a netbeans JSP2.0/EJB/TomEE sample project where everything was
>> already setup correctly.
>>
>> SEVERE: Error in safeBind method
>> javax.naming.**NameNotFoundException: Name [openejb] is not bound in this
>> Context. Unable to find [openejb].
>>      at org.apache.naming.**NamingContext.lookup(**NamingContext.java:820)
>>      at org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
>> TomcatWebAppBuilder.java:1196)
>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
>> TomcatWebAppBuilder.java:776)
>>      at org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
>> **GlobalListenerSupport.java:**103)
>>      at org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
>> LifecycleSupport.java:119)
>>      at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
>> LifecycleBase.java:90)
>>      at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
>> LifecycleBase.java:401)
>>      at org.apache.catalina.util.**LifecycleBase.start(**
>> LifecycleBase.java:168)
>>      at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
>> ContainerBase.java:895)
>>      at org.apache.catalina.core.**ContainerBase.addChild(**
>> ContainerBase.java:871)
>>      at org.apache.catalina.core.**StandardHost.addChild(**
>> StandardHost.java:615)
>>      at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
>> HostConfig.java:649)
>>      at org.apache.catalina.startup.**HostConfig.deployApps(**
>> HostConfig.java:530)
>>      at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
>> java:1471)
>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
>> NativeMethodAccessorImpl.java:**57)
>>      at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
>> DelegatingMethodAccessorImpl.**java:43)
>>      at java.lang.reflect.Method.**invoke(Method.java:601)
>>      at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
>> BaseModelMBean.java:301)
>>      at com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
>> DefaultMBeanServerInterceptor.**java:819)
>>      at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
>> JmxMBeanServer.java:791)
>>      at org.apache.catalina.manager.**ManagerServlet.check(**
>> ManagerServlet.java:1436)
>>      at org.apache.catalina.manager.**ManagerServlet.deploy(**
>> ManagerServlet.java:856)
>>      at org.apache.catalina.manager.**ManagerServlet.doGet(**
>> ManagerServlet.java:353)
>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>> internalDoFilter(**ApplicationFilterChain.java:**305)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>> ApplicationFilterChain.java:**210)
>>      at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
>> doFilter(**SetCharacterEncodingFilter.**java:108)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>> internalDoFilter(**ApplicationFilterChain.java:**243)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>> ApplicationFilterChain.java:**210)
>>      at org.apache.catalina.core.**StandardWrapperValve.invoke(**
>> StandardWrapperValve.java:225)
>>      at org.apache.catalina.core.**StandardContextValve.invoke(**
>> StandardContextValve.java:169)
>>      at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
>> OpenEJBValve.java:44)
>>      at org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
>> AuthenticatorBase.java:581)
>>      at org.apache.catalina.core.**StandardHostValve.invoke(**
>> StandardHostValve.java:168)
>>      at org.apache.catalina.valves.**ErrorReportValve.invoke(**
>> ErrorReportValve.java:98)
>>      at org.apache.catalina.valves.**AccessLogValve.invoke(**
>> AccessLogValve.java:927)
>>      at org.apache.catalina.core.**StandardEngineValve.invoke(**
>> StandardEngineValve.java:118)
>>      at org.apache.catalina.connector.**CoyoteAdapter.service(**
>> CoyoteAdapter.java:407)
>>      at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
>> AbstractHttp11Processor.java:**999)
>>      at org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
>> process(AbstractProtocol.java:**565)
>>      at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
>> run(JIoEndpoint.java:309)
>>      at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
>> ThreadPoolExecutor.java:1110)
>>      at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
>> ThreadPoolExecutor.java:603)
>>      at java.lang.Thread.run(Thread.**java:722)
>>
>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>> safeBind
>> INFO: TransactionManager already bound, ignoring
>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>> safeBind
>> INFO: TransactionSynchronizationRegi**stry already bound, ignoring
>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>> safeBind
>> SEVERE: Error in safeBind method
>> javax.naming.**NameNotFoundException: No ORB registered with the OpenEJB
>> system
>>      at org.apache.openejb.core.ivm.**naming.**SystemComponentReference.**
>> getObject(**SystemComponentReference.java:**38)
>>      at org.apache.openejb.core.ivm.**naming.Reference.getContent(**
>> Reference.java:40)
>>      at org.apache.xbean.naming.**reference.SimpleReference$**
>> SimpleObjectFactory.**getObjectInstance(**SimpleReference.java:137)
>>      at javax.naming.spi.**NamingManager.**getObjectInstance(**
>> NamingManager.java:321)
>>      at org.apache.naming.**NamingContext.lookup(**NamingContext.java:843)
>>      at org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
>> TomcatWebAppBuilder.java:1196)
>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
>> TomcatWebAppBuilder.java:806)
>>      at org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
>> **GlobalListenerSupport.java:**103)
>>      at org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
>> LifecycleSupport.java:119)
>>      at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
>> LifecycleBase.java:90)
>>      at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
>> LifecycleBase.java:401)
>>      at org.apache.catalina.util.**LifecycleBase.start(**
>> LifecycleBase.java:168)
>>      at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
>> ContainerBase.java:895)
>>      at org.apache.catalina.core.**ContainerBase.addChild(**
>> ContainerBase.java:871)
>>      at org.apache.catalina.core.**StandardHost.addChild(**
>> StandardHost.java:615)
>>      at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
>> HostConfig.java:649)
>>      at org.apache.catalina.startup.**HostConfig.deployApps(**
>> HostConfig.java:530)
>>      at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
>> java:1471)
>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
>> NativeMethodAccessorImpl.java:**57)
>>      at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
>> DelegatingMethodAccessorImpl.**java:43)
>>      at java.lang.reflect.Method.**invoke(Method.java:601)
>>      at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
>> BaseModelMBean.java:301)
>>      at com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
>> DefaultMBeanServerInterceptor.**java:819)
>>      at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
>> JmxMBeanServer.java:791)
>>      at org.apache.catalina.manager.**ManagerServlet.check(**
>> ManagerServlet.java:1436)
>>      at org.apache.catalina.manager.**ManagerServlet.deploy(**
>> ManagerServlet.java:856)
>>      at org.apache.catalina.manager.**ManagerServlet.doGet(**
>> ManagerServlet.java:353)
>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>> internalDoFilter(**ApplicationFilterChain.java:**305)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>> ApplicationFilterChain.java:**210)
>>      at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
>> doFilter(**SetCharacterEncodingFilter.**java:108)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>> internalDoFilter(**ApplicationFilterChain.java:**243)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>> ApplicationFilterChain.java:**210)
>>      at org.apache.catalina.core.**StandardWrapperValve.invoke(**
>> StandardWrapperValve.java:225)
>>      at org.apache.catalina.core.**StandardContextValve.invoke(**
>> StandardContextValve.java:169)
>>      at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
>> OpenEJBValve.java:44)
>>      at org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
>> AuthenticatorBase.java:581)
>>      at org.apache.catalina.core.**StandardHostValve.invoke(**
>> StandardHostValve.java:168)
>>      at org.apache.catalina.valves.**ErrorReportValve.invoke(**
>> ErrorReportValve.java:98)
>>      at org.apache.catalina.valves.**AccessLogValve.invoke(**
>> AccessLogValve.java:927)
>>      at org.apache.catalina.core.**StandardEngineValve.invoke(**
>> StandardEngineValve.java:118)
>>      at org.apache.catalina.connector.**CoyoteAdapter.service(**
>> CoyoteAdapter.java:407)
>>      at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
>> AbstractHttp11Processor.java:**999)
>>      at org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
>> process(AbstractProtocol.java:**565)
>>      at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
>> run(JIoEndpoint.java:309)
>>      at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
>> ThreadPoolExecutor.java:1110)
>>      at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
>> ThreadPoolExecutor.java:603)
>>      at java.lang.Thread.run(Thread.**java:722)
>>
>> Jul 08, 2012 4:40:43 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>> safeBind
>> SEVERE: Error in safeBind method
>> javax.naming.**NameNotFoundException: No HandleDelegate registered with
>> the OpenEJB system
>>      at org.apache.openejb.core.ivm.**naming.**SystemComponentReference.**
>> getObject(**SystemComponentReference.java:**38)
>>      at org.apache.openejb.core.ivm.**naming.Reference.getContent(**
>> Reference.java:40)
>>      at org.apache.xbean.naming.**reference.SimpleReference$**
>> SimpleObjectFactory.**getObjectInstance(**SimpleReference.java:137)
>>      at javax.naming.spi.**NamingManager.**getObjectInstance(**
>> NamingManager.java:321)
>>      at org.apache.naming.**NamingContext.lookup(**NamingContext.java:843)
>>      at org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
>> TomcatWebAppBuilder.java:1196)
>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
>> TomcatWebAppBuilder.java:807)
>>      at org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
>> **GlobalListenerSupport.java:**103)
>>      at org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
>> LifecycleSupport.java:119)
>>      at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
>> LifecycleBase.java:90)
>>      at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
>> LifecycleBase.java:401)
>>      at org.apache.catalina.util.**LifecycleBase.start(**
>> LifecycleBase.java:168)
>>      at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
>> ContainerBase.java:895)
>>      at org.apache.catalina.core.**ContainerBase.addChild(**
>> ContainerBase.java:871)
>>      at org.apache.catalina.core.**StandardHost.addChild(**
>> StandardHost.java:615)
>>      at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
>> HostConfig.java:649)
>>      at org.apache.catalina.startup.**HostConfig.deployApps(**
>> HostConfig.java:530)
>>      at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
>> java:1471)
>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
>> NativeMethodAccessorImpl.java:**57)
>>      at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
>> DelegatingMethodAccessorImpl.**java:43)
>>      at java.lang.reflect.Method.**invoke(Method.java:601)
>>      at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
>> BaseModelMBean.java:301)
>>      at com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
>> DefaultMBeanServerInterceptor.**java:819)
>>      at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
>> JmxMBeanServer.java:791)
>>      at org.apache.catalina.manager.**ManagerServlet.check(**
>> ManagerServlet.java:1436)
>>      at org.apache.catalina.manager.**ManagerServlet.deploy(**
>> ManagerServlet.java:856)
>>      at org.apache.catalina.manager.**ManagerServlet.doGet(**
>> ManagerServlet.java:353)
>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>> internalDoFilter(**ApplicationFilterChain.java:**305)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>> ApplicationFilterChain.java:**210)
>>      at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
>> doFilter(**SetCharacterEncodingFilter.**java:108)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>> internalDoFilter(**ApplicationFilterChain.java:**243)
>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>> ApplicationFilterChain.java:**210)
>>      at org.apache.catalina.core.**StandardWrapperValve.invoke(**
>> StandardWrapperValve.java:225)
>>      at org.apache.catalina.core.**StandardContextValve.invoke(**
>> StandardContextValve.java:169)
>>      at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
>> OpenEJBValve.java:44)
>>      at org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
>> AuthenticatorBase.java:581)
>>      at org.apache.catalina.core.**StandardHostValve.invoke(**
>> StandardHostValve.java:168)
>>      at org.apache.catalina.valves.**ErrorReportValve.invoke(**
>> ErrorReportValve.java:98)
>>      at org.apache.catalina.valves.**AccessLogValve.invoke(**
>> AccessLogValve.java:927)
>>      at org.apache.catalina.core.**StandardEngineValve.invoke(**
>> StandardEngineValve.java:118)
>>      at org.apache.catalina.connector.**CoyoteAdapter.service(**
>> CoyoteAdapter.java:407)
>>      at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
>> AbstractHttp11Processor.java:**999)
>>      at org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
>> process(AbstractProtocol.java:**565)
>>      at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
>> run(JIoEndpoint.java:309)
>>      at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
>> ThreadPoolExecutor.java:1110)
>>      at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
>> ThreadPoolExecutor.java:603)
>>      at java.lang.Thread.run(Thread.**java:722)
>>
>>
>>
>> On 7/8/2012 4:32 PM, Romain Manni-Bucau wrote:
>>
>>> i don't think so,
>>>
>>> can you try moving your code in a unit test to see if it still happen?
>>>
>>> - Romain
>>>
>>>
>>> 2012/7/8 David Nordahl<[hidden email]>
>>>
>>>   Could it be the Tomcat JDBCRealm I have enforcing container managed
>>>> security from user data in the same table?
>>>>
>>>>
>>>> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>>>>
>>>>   i can't say no but i'm pretty sure it is something in the container
>>>>> rather
>>>>> in the DB.
>>>>>
>>>>> - Romain
>>>>>
>>>>>
>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>
>>>>>    Maybe the DB settings could have something to do with it? I'm using
>>>>> MySQL
>>>>>
>>>>>> with it's default setup which uses InnoDB.  I notice in the
>>>>>> documentation
>>>>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes the
>>>>>> transaction log after each transaction, greatly improving reliability."
>>>>>>
>>>>>> Could some DB setting like this be causing the issue?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>>>>
>>>>>>    can you share a small sample to reproduce it, will be easier to help
>>>>>>
>>>>>>> you?
>>>>>>>
>>>>>>> - Romain
>>>>>>>
>>>>>>>
>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>
>>>>>>>     Not that I've configured.. Unless one of the annotations creates
>>>>>>> one:
>>>>>>>
>>>>>>>   @Entity
>>>>>>>> @Table(name = "user")
>>>>>>>> @XmlRootElement
>>>>>>>> @NamedQueries({
>>>>>>>>         @NamedQuery(name = "User.findAll", query = "SELECT u FROM User
>>>>>>>> u"),
>>>>>>>>         @NamedQuery(name = "User.findByUserId", query = "SELECT u FROM
>>>>>>>> User
>>>>>>>> u
>>>>>>>> WHERE u.userId = :userId"),
>>>>>>>>         @NamedQuery(name = "User.findByUserName", query = "SELECT u
>>>>>>>> FROM
>>>>>>>> User
>>>>>>>> u WHERE u.userName = :userName"),
>>>>>>>>         @NamedQuery(name = "User.findByPassword", query = "SELECT u
>>>>>>>> FROM
>>>>>>>> User
>>>>>>>> u WHERE u.password = :password"),
>>>>>>>>         @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM
>>>>>>>> User u
>>>>>>>> WHERE u.email = :email"),
>>>>>>>>         @NamedQuery(name = "User.findByFirstName", query = "SELECT u
>>>>>>>> FROM
>>>>>>>> User
>>>>>>>> u WHERE u.firstName = :firstName"),
>>>>>>>>         @NamedQuery(name = "User.findByLastName", query = "SELECT u
>>>>>>>> FROM
>>>>>>>> User
>>>>>>>> u WHERE u.lastName = :lastName"),
>>>>>>>>         @NamedQuery(name = "User.findByLoginFailures", query =
>>>>>>>> "SELECT u
>>>>>>>> FROM
>>>>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>>>>         @NamedQuery(name = "User.findByLastLoginFailure", query =
>>>>>>>> "SELECT u
>>>>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>>>>> public class User implements Serializable {
>>>>>>>>         private static final long serialVersionUID = 1L;
>>>>>>>>         @Id
>>>>>>>>         @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>>>>         @Basic(optional = false)
>>>>>>>>         @Column(name = "user_id")
>>>>>>>>         private Integer userId;
>>>>>>>>         @Basic(optional = false)
>>>>>>>>         @Column(name = "user_name")
>>>>>>>>         private String userName;
>>>>>>>>         @Basic(optional = false)
>>>>>>>>         @Column(name = "password")
>>>>>>>>         private String password;
>>>>>>>>         @Column(name = "email")
>>>>>>>>         private String email;
>>>>>>>>         @Column(name = "first_name")
>>>>>>>>         private String firstName;
>>>>>>>>         @Column(name = "last_name")
>>>>>>>>         private String lastName;
>>>>>>>>         @Column(name = "login_failures")
>>>>>>>>         private Integer loginFailures;
>>>>>>>>         @Column(name = "last_login_failure")
>>>>>>>>         @Temporal(TemporalType.********TIMESTAMP)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>         private Date lastLoginFailure;
>>>>>>>>         @JoinColumn(name = "associated_customer",
>>>>>>>> referencedColumnName =
>>>>>>>> "customer_id")
>>>>>>>>         @ManyToOne
>>>>>>>>
>>>>>>>>
>>>>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>>>>
>>>>>>>>     Hi,
>>>>>>>>
>>>>>>>>   any entity listener playing with id or special field on User entity?
>>>>>>>>> - Romain
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>
>>>>>>>>>      I'm attempting the code:
>>>>>>>>>
>>>>>>>>>    Properties properties = new Properties();
>>>>>>>>>
>>>>>>>>>> properties.setProperty(**********Context.INITIAL_CONTEXT_*******
>>>>>>>>>> ***
>>>>>>>>>> FACTORY,
>>>>>>>>>> "org.apache.openejb.client.************
>>>>>>>>>> LocalInitialContextFactory"**)**;
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>>>>>> Object object = initialContext.lookup("*********
>>>>>>>>>> *UserFacadeLocal");
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>>>>> User newuser = new User();
>>>>>>>>>> newuser.setEmail("[hidden email]"**********);
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> newuser.setUserName("steve");
>>>>>>>>>> newuser.setPassword("cows");
>>>>>>>>>> userFacade.create(newuser);
>>>>>>>>>>
>>>>>>>>>> but keep getting "org.apache.openjpa.**********persistence.****
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> InvalidStateException:
>>>>>>>>>>
>>>>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>>>>> callback
>>>>>>>>>> methods or event listeners do not invoke any operations that
>>>>>>>>>> require
>>>>>>>>>> the
>>>>>>>>>> in-progress flush to complete."
>>>>>>>>>>
>>>>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to see
>>>>>>>>>> if
>>>>>>>>>> I
>>>>>>>>>> can
>>>>>>>>>> get the error to go away, but it makes no difference.  I can't
>>>>>>>>>> find a
>>>>>>>>>> flush() call in my project and according to the table in the docs,
>>>>>>>>>> flush
>>>>>>>>>> is
>>>>>>>>>> not called if this parameter is set.  What am I not doing correctly
>>>>>>>>>> here?
>>>>>>>>>>
>>>>>>>>>> Thank you,
>>>>>>>>>> David
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

Martin Kjær Jørgensen
I've experienced the same in my application. My entities have generated
id's as well, and i "fixed" it by removing "optinal = false" from the
@Basic annotation of the @Id field, like so:

public class User implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Basic
        @Column(name = "user_id")
        private Integer userId;



On 09-07-2012 03:20, David Nordahl wrote:

> Tried the snap shot.. I get an error in Netbeans saying that it can't
> deploy the app and to check the server log, yet the server log has no
> errors and shows the app deploying successfully yet I cannot open the
> web host in the browser.  I give up... I could have written all the
> middle ware needed for this project myself by now.  Thanks for your
> efforts.
>
> On 7/8/2012 4:56 PM, Romain Manni-Bucau wrote:
>> hmm
>>
>> you use tomee 1.0.0
>>
>> can you give it a try to the snapshot please? we worked a bit on netbeans
>> integration.
>>
>> - Romain
>>
>>
>> 2012/7/8 David Nordahl<[hidden email]>
>>
>>> Btw.. Is it normal to have these exceptions on startup?  I saw another
>>> post saying they were, but I thought I might double check.  I seem to be
>>> able to query through open EJB, but not update and add.  I'm also
>>> wondering
>>> if there is anyway that the reentrant flush error is covering up another
>>> error.  I guess I can start working on a test case.. I wish I could just
>>> find a netbeans JSP2.0/EJB/TomEE sample project where everything was
>>> already setup correctly.
>>>
>>> SEVERE: Error in safeBind method
>>> javax.naming.**NameNotFoundException: Name [openejb] is not bound in
>>> this
>>> Context. Unable to find [openejb].
>>>      at
>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:820)
>>>      at
>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
>>> TomcatWebAppBuilder.java:1196)
>>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
>>> TomcatWebAppBuilder.java:776)
>>>      at
>>> org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
>>> **GlobalListenerSupport.java:**103)
>>>      at
>>> org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
>>> LifecycleSupport.java:119)
>>>      at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
>>> LifecycleBase.java:90)
>>>      at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
>>> LifecycleBase.java:401)
>>>      at org.apache.catalina.util.**LifecycleBase.start(**
>>> LifecycleBase.java:168)
>>>      at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
>>> ContainerBase.java:895)
>>>      at org.apache.catalina.core.**ContainerBase.addChild(**
>>> ContainerBase.java:871)
>>>      at org.apache.catalina.core.**StandardHost.addChild(**
>>> StandardHost.java:615)
>>>      at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
>>> HostConfig.java:649)
>>>      at org.apache.catalina.startup.**HostConfig.deployApps(**
>>> HostConfig.java:530)
>>>      at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
>>> java:1471)
>>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
>>> NativeMethodAccessorImpl.java:**57)
>>>      at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
>>> DelegatingMethodAccessorImpl.**java:43)
>>>      at java.lang.reflect.Method.**invoke(Method.java:601)
>>>      at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
>>> BaseModelMBean.java:301)
>>>      at
>>> com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
>>> DefaultMBeanServerInterceptor.**java:819)
>>>      at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
>>> JmxMBeanServer.java:791)
>>>      at org.apache.catalina.manager.**ManagerServlet.check(**
>>> ManagerServlet.java:1436)
>>>      at org.apache.catalina.manager.**ManagerServlet.deploy(**
>>> ManagerServlet.java:856)
>>>      at org.apache.catalina.manager.**ManagerServlet.doGet(**
>>> ManagerServlet.java:353)
>>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>>> internalDoFilter(**ApplicationFilterChain.java:**305)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>> ApplicationFilterChain.java:**210)
>>>      at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
>>> doFilter(**SetCharacterEncodingFilter.**java:108)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>>> internalDoFilter(**ApplicationFilterChain.java:**243)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>> ApplicationFilterChain.java:**210)
>>>      at org.apache.catalina.core.**StandardWrapperValve.invoke(**
>>> StandardWrapperValve.java:225)
>>>      at org.apache.catalina.core.**StandardContextValve.invoke(**
>>> StandardContextValve.java:169)
>>>      at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
>>> OpenEJBValve.java:44)
>>>      at
>>> org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
>>> AuthenticatorBase.java:581)
>>>      at org.apache.catalina.core.**StandardHostValve.invoke(**
>>> StandardHostValve.java:168)
>>>      at org.apache.catalina.valves.**ErrorReportValve.invoke(**
>>> ErrorReportValve.java:98)
>>>      at org.apache.catalina.valves.**AccessLogValve.invoke(**
>>> AccessLogValve.java:927)
>>>      at org.apache.catalina.core.**StandardEngineValve.invoke(**
>>> StandardEngineValve.java:118)
>>>      at org.apache.catalina.connector.**CoyoteAdapter.service(**
>>> CoyoteAdapter.java:407)
>>>      at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
>>> AbstractHttp11Processor.java:**999)
>>>      at
>>> org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
>>> process(AbstractProtocol.java:**565)
>>>      at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
>>> run(JIoEndpoint.java:309)
>>>      at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
>>> ThreadPoolExecutor.java:1110)
>>>      at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
>>> ThreadPoolExecutor.java:603)
>>>      at java.lang.Thread.run(Thread.**java:722)
>>>
>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>>> safeBind
>>> INFO: TransactionManager already bound, ignoring
>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>>> safeBind
>>> INFO: TransactionSynchronizationRegi**stry already bound, ignoring
>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>>> safeBind
>>> SEVERE: Error in safeBind method
>>> javax.naming.**NameNotFoundException: No ORB registered with the OpenEJB
>>> system
>>>      at
>>> org.apache.openejb.core.ivm.**naming.**SystemComponentReference.**
>>> getObject(**SystemComponentReference.java:**38)
>>>      at org.apache.openejb.core.ivm.**naming.Reference.getContent(**
>>> Reference.java:40)
>>>      at org.apache.xbean.naming.**reference.SimpleReference$**
>>> SimpleObjectFactory.**getObjectInstance(**SimpleReference.java:137)
>>>      at javax.naming.spi.**NamingManager.**getObjectInstance(**
>>> NamingManager.java:321)
>>>      at
>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:843)
>>>      at
>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
>>> TomcatWebAppBuilder.java:1196)
>>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
>>> TomcatWebAppBuilder.java:806)
>>>      at
>>> org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
>>> **GlobalListenerSupport.java:**103)
>>>      at
>>> org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
>>> LifecycleSupport.java:119)
>>>      at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
>>> LifecycleBase.java:90)
>>>      at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
>>> LifecycleBase.java:401)
>>>      at org.apache.catalina.util.**LifecycleBase.start(**
>>> LifecycleBase.java:168)
>>>      at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
>>> ContainerBase.java:895)
>>>      at org.apache.catalina.core.**ContainerBase.addChild(**
>>> ContainerBase.java:871)
>>>      at org.apache.catalina.core.**StandardHost.addChild(**
>>> StandardHost.java:615)
>>>      at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
>>> HostConfig.java:649)
>>>      at org.apache.catalina.startup.**HostConfig.deployApps(**
>>> HostConfig.java:530)
>>>      at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
>>> java:1471)
>>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
>>> NativeMethodAccessorImpl.java:**57)
>>>      at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
>>> DelegatingMethodAccessorImpl.**java:43)
>>>      at java.lang.reflect.Method.**invoke(Method.java:601)
>>>      at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
>>> BaseModelMBean.java:301)
>>>      at
>>> com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
>>> DefaultMBeanServerInterceptor.**java:819)
>>>      at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
>>> JmxMBeanServer.java:791)
>>>      at org.apache.catalina.manager.**ManagerServlet.check(**
>>> ManagerServlet.java:1436)
>>>      at org.apache.catalina.manager.**ManagerServlet.deploy(**
>>> ManagerServlet.java:856)
>>>      at org.apache.catalina.manager.**ManagerServlet.doGet(**
>>> ManagerServlet.java:353)
>>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>>> internalDoFilter(**ApplicationFilterChain.java:**305)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>> ApplicationFilterChain.java:**210)
>>>      at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
>>> doFilter(**SetCharacterEncodingFilter.**java:108)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>>> internalDoFilter(**ApplicationFilterChain.java:**243)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>> ApplicationFilterChain.java:**210)
>>>      at org.apache.catalina.core.**StandardWrapperValve.invoke(**
>>> StandardWrapperValve.java:225)
>>>      at org.apache.catalina.core.**StandardContextValve.invoke(**
>>> StandardContextValve.java:169)
>>>      at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
>>> OpenEJBValve.java:44)
>>>      at
>>> org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
>>> AuthenticatorBase.java:581)
>>>      at org.apache.catalina.core.**StandardHostValve.invoke(**
>>> StandardHostValve.java:168)
>>>      at org.apache.catalina.valves.**ErrorReportValve.invoke(**
>>> ErrorReportValve.java:98)
>>>      at org.apache.catalina.valves.**AccessLogValve.invoke(**
>>> AccessLogValve.java:927)
>>>      at org.apache.catalina.core.**StandardEngineValve.invoke(**
>>> StandardEngineValve.java:118)
>>>      at org.apache.catalina.connector.**CoyoteAdapter.service(**
>>> CoyoteAdapter.java:407)
>>>      at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
>>> AbstractHttp11Processor.java:**999)
>>>      at
>>> org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
>>> process(AbstractProtocol.java:**565)
>>>      at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
>>> run(JIoEndpoint.java:309)
>>>      at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
>>> ThreadPoolExecutor.java:1110)
>>>      at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
>>> ThreadPoolExecutor.java:603)
>>>      at java.lang.Thread.run(Thread.**java:722)
>>>
>>> Jul 08, 2012 4:40:43 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>>> safeBind
>>> SEVERE: Error in safeBind method
>>> javax.naming.**NameNotFoundException: No HandleDelegate registered with
>>> the OpenEJB system
>>>      at
>>> org.apache.openejb.core.ivm.**naming.**SystemComponentReference.**
>>> getObject(**SystemComponentReference.java:**38)
>>>      at org.apache.openejb.core.ivm.**naming.Reference.getContent(**
>>> Reference.java:40)
>>>      at org.apache.xbean.naming.**reference.SimpleReference$**
>>> SimpleObjectFactory.**getObjectInstance(**SimpleReference.java:137)
>>>      at javax.naming.spi.**NamingManager.**getObjectInstance(**
>>> NamingManager.java:321)
>>>      at
>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:843)
>>>      at
>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
>>> TomcatWebAppBuilder.java:1196)
>>>      at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
>>> TomcatWebAppBuilder.java:807)
>>>      at
>>> org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
>>> **GlobalListenerSupport.java:**103)
>>>      at
>>> org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
>>> LifecycleSupport.java:119)
>>>      at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
>>> LifecycleBase.java:90)
>>>      at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
>>> LifecycleBase.java:401)
>>>      at org.apache.catalina.util.**LifecycleBase.start(**
>>> LifecycleBase.java:168)
>>>      at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
>>> ContainerBase.java:895)
>>>      at org.apache.catalina.core.**ContainerBase.addChild(**
>>> ContainerBase.java:871)
>>>      at org.apache.catalina.core.**StandardHost.addChild(**
>>> StandardHost.java:615)
>>>      at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
>>> HostConfig.java:649)
>>>      at org.apache.catalina.startup.**HostConfig.deployApps(**
>>> HostConfig.java:530)
>>>      at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
>>> java:1471)
>>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>>>      at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
>>> NativeMethodAccessorImpl.java:**57)
>>>      at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
>>> DelegatingMethodAccessorImpl.**java:43)
>>>      at java.lang.reflect.Method.**invoke(Method.java:601)
>>>      at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
>>> BaseModelMBean.java:301)
>>>      at
>>> com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
>>> DefaultMBeanServerInterceptor.**java:819)
>>>      at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
>>> JmxMBeanServer.java:791)
>>>      at org.apache.catalina.manager.**ManagerServlet.check(**
>>> ManagerServlet.java:1436)
>>>      at org.apache.catalina.manager.**ManagerServlet.deploy(**
>>> ManagerServlet.java:856)
>>>      at org.apache.catalina.manager.**ManagerServlet.doGet(**
>>> ManagerServlet.java:353)
>>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>>>      at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>>> internalDoFilter(**ApplicationFilterChain.java:**305)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>> ApplicationFilterChain.java:**210)
>>>      at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
>>> doFilter(**SetCharacterEncodingFilter.**java:108)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**
>>> internalDoFilter(**ApplicationFilterChain.java:**243)
>>>      at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>> ApplicationFilterChain.java:**210)
>>>      at org.apache.catalina.core.**StandardWrapperValve.invoke(**
>>> StandardWrapperValve.java:225)
>>>      at org.apache.catalina.core.**StandardContextValve.invoke(**
>>> StandardContextValve.java:169)
>>>      at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
>>> OpenEJBValve.java:44)
>>>      at
>>> org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
>>> AuthenticatorBase.java:581)
>>>      at org.apache.catalina.core.**StandardHostValve.invoke(**
>>> StandardHostValve.java:168)
>>>      at org.apache.catalina.valves.**ErrorReportValve.invoke(**
>>> ErrorReportValve.java:98)
>>>      at org.apache.catalina.valves.**AccessLogValve.invoke(**
>>> AccessLogValve.java:927)
>>>      at org.apache.catalina.core.**StandardEngineValve.invoke(**
>>> StandardEngineValve.java:118)
>>>      at org.apache.catalina.connector.**CoyoteAdapter.service(**
>>> CoyoteAdapter.java:407)
>>>      at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
>>> AbstractHttp11Processor.java:**999)
>>>      at
>>> org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
>>> process(AbstractProtocol.java:**565)
>>>      at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
>>> run(JIoEndpoint.java:309)
>>>      at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
>>> ThreadPoolExecutor.java:1110)
>>>      at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
>>> ThreadPoolExecutor.java:603)
>>>      at java.lang.Thread.run(Thread.**java:722)
>>>
>>>
>>>
>>> On 7/8/2012 4:32 PM, Romain Manni-Bucau wrote:
>>>
>>>> i don't think so,
>>>>
>>>> can you try moving your code in a unit test to see if it still happen?
>>>>
>>>> - Romain
>>>>
>>>>
>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>
>>>>   Could it be the Tomcat JDBCRealm I have enforcing container managed
>>>>> security from user data in the same table?
>>>>>
>>>>>
>>>>> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>>>>>
>>>>>   i can't say no but i'm pretty sure it is something in the container
>>>>>> rather
>>>>>> in the DB.
>>>>>>
>>>>>> - Romain
>>>>>>
>>>>>>
>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>
>>>>>>    Maybe the DB settings could have something to do with it? I'm
>>>>>> using
>>>>>> MySQL
>>>>>>
>>>>>>> with it's default setup which uses InnoDB.  I notice in the
>>>>>>> documentation
>>>>>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1,
>>>>>>> flushes the
>>>>>>> transaction log after each transaction, greatly improving
>>>>>>> reliability."
>>>>>>>
>>>>>>> Could some DB setting like this be causing the issue?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>>>>>
>>>>>>>    can you share a small sample to reproduce it, will be easier
>>>>>>> to help
>>>>>>>
>>>>>>>> you?
>>>>>>>>
>>>>>>>> - Romain
>>>>>>>>
>>>>>>>>
>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>
>>>>>>>>     Not that I've configured.. Unless one of the annotations
>>>>>>>> creates
>>>>>>>> one:
>>>>>>>>
>>>>>>>>   @Entity
>>>>>>>>> @Table(name = "user")
>>>>>>>>> @XmlRootElement
>>>>>>>>> @NamedQueries({
>>>>>>>>>         @NamedQuery(name = "User.findAll", query = "SELECT u
>>>>>>>>> FROM User
>>>>>>>>> u"),
>>>>>>>>>         @NamedQuery(name = "User.findByUserId", query = "SELECT
>>>>>>>>> u FROM
>>>>>>>>> User
>>>>>>>>> u
>>>>>>>>> WHERE u.userId = :userId"),
>>>>>>>>>         @NamedQuery(name = "User.findByUserName", query =
>>>>>>>>> "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User
>>>>>>>>> u WHERE u.userName = :userName"),
>>>>>>>>>         @NamedQuery(name = "User.findByPassword", query =
>>>>>>>>> "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User
>>>>>>>>> u WHERE u.password = :password"),
>>>>>>>>>         @NamedQuery(name = "User.findByEmail", query = "SELECT
>>>>>>>>> u FROM
>>>>>>>>> User u
>>>>>>>>> WHERE u.email = :email"),
>>>>>>>>>         @NamedQuery(name = "User.findByFirstName", query =
>>>>>>>>> "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User
>>>>>>>>> u WHERE u.firstName = :firstName"),
>>>>>>>>>         @NamedQuery(name = "User.findByLastName", query =
>>>>>>>>> "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User
>>>>>>>>> u WHERE u.lastName = :lastName"),
>>>>>>>>>         @NamedQuery(name = "User.findByLoginFailures", query =
>>>>>>>>> "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>>>>>         @NamedQuery(name = "User.findByLastLoginFailure", query =
>>>>>>>>> "SELECT u
>>>>>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>>>>>> public class User implements Serializable {
>>>>>>>>>         private static final long serialVersionUID = 1L;
>>>>>>>>>         @Id
>>>>>>>>>         @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>>>>>         @Basic(optional = false)
>>>>>>>>>         @Column(name = "user_id")
>>>>>>>>>         private Integer userId;
>>>>>>>>>         @Basic(optional = false)
>>>>>>>>>         @Column(name = "user_name")
>>>>>>>>>         private String userName;
>>>>>>>>>         @Basic(optional = false)
>>>>>>>>>         @Column(name = "password")
>>>>>>>>>         private String password;
>>>>>>>>>         @Column(name = "email")
>>>>>>>>>         private String email;
>>>>>>>>>         @Column(name = "first_name")
>>>>>>>>>         private String firstName;
>>>>>>>>>         @Column(name = "last_name")
>>>>>>>>>         private String lastName;
>>>>>>>>>         @Column(name = "login_failures")
>>>>>>>>>         private Integer loginFailures;
>>>>>>>>>         @Column(name = "last_login_failure")
>>>>>>>>>         @Temporal(TemporalType.********TIMESTAMP)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>         private Date lastLoginFailure;
>>>>>>>>>         @JoinColumn(name = "associated_customer",
>>>>>>>>> referencedColumnName =
>>>>>>>>> "customer_id")
>>>>>>>>>         @ManyToOne
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>>>>>
>>>>>>>>>     Hi,
>>>>>>>>>
>>>>>>>>>   any entity listener playing with id or special field on User
>>>>>>>>> entity?
>>>>>>>>>> - Romain
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>
>>>>>>>>>>      I'm attempting the code:
>>>>>>>>>>
>>>>>>>>>>    Properties properties = new Properties();
>>>>>>>>>>
>>>>>>>>>>> properties.setProperty(**********Context.INITIAL_CONTEXT_*******
>>>>>>>>>>> ***
>>>>>>>>>>> FACTORY,
>>>>>>>>>>> "org.apache.openejb.client.************
>>>>>>>>>>> LocalInitialContextFactory"**)**;
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>>>>>>> Object object = initialContext.lookup("*********
>>>>>>>>>>> *UserFacadeLocal");
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>>>>>> User newuser = new User();
>>>>>>>>>>> newuser.setEmail("[hidden email]"**********);
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> newuser.setUserName("steve");
>>>>>>>>>>> newuser.setPassword("cows");
>>>>>>>>>>> userFacade.create(newuser);
>>>>>>>>>>>
>>>>>>>>>>> but keep getting "org.apache.openjpa.**********persistence.****
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> InvalidStateException:
>>>>>>>>>>>
>>>>>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>>>>>> callback
>>>>>>>>>>> methods or event listeners do not invoke any operations that
>>>>>>>>>>> require
>>>>>>>>>>> the
>>>>>>>>>>> in-progress flush to complete."
>>>>>>>>>>>
>>>>>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to
>>>>>>>>>>> see
>>>>>>>>>>> if
>>>>>>>>>>> I
>>>>>>>>>>> can
>>>>>>>>>>> get the error to go away, but it makes no difference.  I can't
>>>>>>>>>>> find a
>>>>>>>>>>> flush() call in my project and according to the table in the
>>>>>>>>>>> docs,
>>>>>>>>>>> flush
>>>>>>>>>>> is
>>>>>>>>>>> not called if this parameter is set.  What am I not doing
>>>>>>>>>>> correctly
>>>>>>>>>>> here?
>>>>>>>>>>>
>>>>>>>>>>> Thank you,
>>>>>>>>>>> David
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

slimsalmon
It worked!!!! Awesome.  Thank you

On 7/8/2012 10:05 PM, Martin Kjær Jørgensen wrote:

> I've experienced the same in my application. My entities have generated
> id's as well, and i "fixed" it by removing "optinal = false" from the
> @Basic annotation of the @Id field, like so:
>
> public class User implements Serializable {
> private static final long serialVersionUID = 1L;
> @Id
> @GeneratedValue(strategy = GenerationType.IDENTITY)
> @Basic
> @Column(name = "user_id")
> private Integer userId;
>
>
>
> On 09-07-2012 03:20, David Nordahl wrote:
>> Tried the snap shot.. I get an error in Netbeans saying that it can't
>> deploy the app and to check the server log, yet the server log has no
>> errors and shows the app deploying successfully yet I cannot open the
>> web host in the browser.  I give up... I could have written all the
>> middle ware needed for this project myself by now.  Thanks for your
>> efforts.
>>
>> On 7/8/2012 4:56 PM, Romain Manni-Bucau wrote:
>>> hmm
>>>
>>> you use tomee 1.0.0
>>>
>>> can you give it a try to the snapshot please? we worked a bit on netbeans
>>> integration.
>>>
>>> - Romain
>>>
>>>
>>> 2012/7/8 David Nordahl<[hidden email]>
>>>
>>>> Btw.. Is it normal to have these exceptions on startup?  I saw another
>>>> post saying they were, but I thought I might double check.  I seem to be
>>>> able to query through open EJB, but not update and add.  I'm also
>>>> wondering
>>>> if there is anyway that the reentrant flush error is covering up another
>>>> error.  I guess I can start working on a test case.. I wish I could just
>>>> find a netbeans JSP2.0/EJB/TomEE sample project where everything was
>>>> already setup correctly.
>>>>
>>>> SEVERE: Error in safeBind method
>>>> javax.naming.**NameNotFoundException: Name [openejb] is not bound in
>>>> this
>>>> Context. Unable to find [openejb].
>>>>       at
>>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:820)
>>>>       at
>>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>>>>       at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
>>>> TomcatWebAppBuilder.java:1196)
>>>>       at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
>>>> TomcatWebAppBuilder.java:776)
>>>>       at
>>>> org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
>>>> **GlobalListenerSupport.java:**103)
>>>>       at
>>>> org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
>>>> LifecycleSupport.java:119)
>>>>       at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
>>>> LifecycleBase.java:90)
>>>>       at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
>>>> LifecycleBase.java:401)
>>>>       at org.apache.catalina.util.**LifecycleBase.start(**
>>>> LifecycleBase.java:168)
>>>>       at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
>>>> ContainerBase.java:895)
>>>>       at org.apache.catalina.core.**ContainerBase.addChild(**
>>>> ContainerBase.java:871)
>>>>       at org.apache.catalina.core.**StandardHost.addChild(**
>>>> StandardHost.java:615)
>>>>       at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
>>>> HostConfig.java:649)
>>>>       at org.apache.catalina.startup.**HostConfig.deployApps(**
>>>> HostConfig.java:530)
>>>>       at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
>>>> java:1471)
>>>>       at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>>>>       at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
>>>> NativeMethodAccessorImpl.java:**57)
>>>>       at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
>>>> DelegatingMethodAccessorImpl.**java:43)
>>>>       at java.lang.reflect.Method.**invoke(Method.java:601)
>>>>       at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
>>>> BaseModelMBean.java:301)
>>>>       at
>>>> com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
>>>> DefaultMBeanServerInterceptor.**java:819)
>>>>       at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
>>>> JmxMBeanServer.java:791)
>>>>       at org.apache.catalina.manager.**ManagerServlet.check(**
>>>> ManagerServlet.java:1436)
>>>>       at org.apache.catalina.manager.**ManagerServlet.deploy(**
>>>> ManagerServlet.java:856)
>>>>       at org.apache.catalina.manager.**ManagerServlet.doGet(**
>>>> ManagerServlet.java:353)
>>>>       at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>>>>       at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**
>>>> internalDoFilter(**ApplicationFilterChain.java:**305)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>>> ApplicationFilterChain.java:**210)
>>>>       at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
>>>> doFilter(**SetCharacterEncodingFilter.**java:108)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**
>>>> internalDoFilter(**ApplicationFilterChain.java:**243)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>>> ApplicationFilterChain.java:**210)
>>>>       at org.apache.catalina.core.**StandardWrapperValve.invoke(**
>>>> StandardWrapperValve.java:225)
>>>>       at org.apache.catalina.core.**StandardContextValve.invoke(**
>>>> StandardContextValve.java:169)
>>>>       at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
>>>> OpenEJBValve.java:44)
>>>>       at
>>>> org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
>>>> AuthenticatorBase.java:581)
>>>>       at org.apache.catalina.core.**StandardHostValve.invoke(**
>>>> StandardHostValve.java:168)
>>>>       at org.apache.catalina.valves.**ErrorReportValve.invoke(**
>>>> ErrorReportValve.java:98)
>>>>       at org.apache.catalina.valves.**AccessLogValve.invoke(**
>>>> AccessLogValve.java:927)
>>>>       at org.apache.catalina.core.**StandardEngineValve.invoke(**
>>>> StandardEngineValve.java:118)
>>>>       at org.apache.catalina.connector.**CoyoteAdapter.service(**
>>>> CoyoteAdapter.java:407)
>>>>       at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
>>>> AbstractHttp11Processor.java:**999)
>>>>       at
>>>> org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
>>>> process(AbstractProtocol.java:**565)
>>>>       at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
>>>> run(JIoEndpoint.java:309)
>>>>       at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
>>>> ThreadPoolExecutor.java:1110)
>>>>       at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
>>>> ThreadPoolExecutor.java:603)
>>>>       at java.lang.Thread.run(Thread.**java:722)
>>>>
>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>>>> safeBind
>>>> INFO: TransactionManager already bound, ignoring
>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>>>> safeBind
>>>> INFO: TransactionSynchronizationRegi**stry already bound, ignoring
>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>>>> safeBind
>>>> SEVERE: Error in safeBind method
>>>> javax.naming.**NameNotFoundException: No ORB registered with the OpenEJB
>>>> system
>>>>       at
>>>> org.apache.openejb.core.ivm.**naming.**SystemComponentReference.**
>>>> getObject(**SystemComponentReference.java:**38)
>>>>       at org.apache.openejb.core.ivm.**naming.Reference.getContent(**
>>>> Reference.java:40)
>>>>       at org.apache.xbean.naming.**reference.SimpleReference$**
>>>> SimpleObjectFactory.**getObjectInstance(**SimpleReference.java:137)
>>>>       at javax.naming.spi.**NamingManager.**getObjectInstance(**
>>>> NamingManager.java:321)
>>>>       at
>>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:843)
>>>>       at
>>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>>>>       at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
>>>> TomcatWebAppBuilder.java:1196)
>>>>       at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
>>>> TomcatWebAppBuilder.java:806)
>>>>       at
>>>> org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
>>>> **GlobalListenerSupport.java:**103)
>>>>       at
>>>> org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
>>>> LifecycleSupport.java:119)
>>>>       at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
>>>> LifecycleBase.java:90)
>>>>       at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
>>>> LifecycleBase.java:401)
>>>>       at org.apache.catalina.util.**LifecycleBase.start(**
>>>> LifecycleBase.java:168)
>>>>       at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
>>>> ContainerBase.java:895)
>>>>       at org.apache.catalina.core.**ContainerBase.addChild(**
>>>> ContainerBase.java:871)
>>>>       at org.apache.catalina.core.**StandardHost.addChild(**
>>>> StandardHost.java:615)
>>>>       at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
>>>> HostConfig.java:649)
>>>>       at org.apache.catalina.startup.**HostConfig.deployApps(**
>>>> HostConfig.java:530)
>>>>       at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
>>>> java:1471)
>>>>       at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>>>>       at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
>>>> NativeMethodAccessorImpl.java:**57)
>>>>       at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
>>>> DelegatingMethodAccessorImpl.**java:43)
>>>>       at java.lang.reflect.Method.**invoke(Method.java:601)
>>>>       at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
>>>> BaseModelMBean.java:301)
>>>>       at
>>>> com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
>>>> DefaultMBeanServerInterceptor.**java:819)
>>>>       at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
>>>> JmxMBeanServer.java:791)
>>>>       at org.apache.catalina.manager.**ManagerServlet.check(**
>>>> ManagerServlet.java:1436)
>>>>       at org.apache.catalina.manager.**ManagerServlet.deploy(**
>>>> ManagerServlet.java:856)
>>>>       at org.apache.catalina.manager.**ManagerServlet.doGet(**
>>>> ManagerServlet.java:353)
>>>>       at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>>>>       at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**
>>>> internalDoFilter(**ApplicationFilterChain.java:**305)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>>> ApplicationFilterChain.java:**210)
>>>>       at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
>>>> doFilter(**SetCharacterEncodingFilter.**java:108)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**
>>>> internalDoFilter(**ApplicationFilterChain.java:**243)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>>> ApplicationFilterChain.java:**210)
>>>>       at org.apache.catalina.core.**StandardWrapperValve.invoke(**
>>>> StandardWrapperValve.java:225)
>>>>       at org.apache.catalina.core.**StandardContextValve.invoke(**
>>>> StandardContextValve.java:169)
>>>>       at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
>>>> OpenEJBValve.java:44)
>>>>       at
>>>> org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
>>>> AuthenticatorBase.java:581)
>>>>       at org.apache.catalina.core.**StandardHostValve.invoke(**
>>>> StandardHostValve.java:168)
>>>>       at org.apache.catalina.valves.**ErrorReportValve.invoke(**
>>>> ErrorReportValve.java:98)
>>>>       at org.apache.catalina.valves.**AccessLogValve.invoke(**
>>>> AccessLogValve.java:927)
>>>>       at org.apache.catalina.core.**StandardEngineValve.invoke(**
>>>> StandardEngineValve.java:118)
>>>>       at org.apache.catalina.connector.**CoyoteAdapter.service(**
>>>> CoyoteAdapter.java:407)
>>>>       at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
>>>> AbstractHttp11Processor.java:**999)
>>>>       at
>>>> org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
>>>> process(AbstractProtocol.java:**565)
>>>>       at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
>>>> run(JIoEndpoint.java:309)
>>>>       at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
>>>> ThreadPoolExecutor.java:1110)
>>>>       at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
>>>> ThreadPoolExecutor.java:603)
>>>>       at java.lang.Thread.run(Thread.**java:722)
>>>>
>>>> Jul 08, 2012 4:40:43 PM org.apache.tomee.catalina.**TomcatWebAppBuilder
>>>> safeBind
>>>> SEVERE: Error in safeBind method
>>>> javax.naming.**NameNotFoundException: No HandleDelegate registered with
>>>> the OpenEJB system
>>>>       at
>>>> org.apache.openejb.core.ivm.**naming.**SystemComponentReference.**
>>>> getObject(**SystemComponentReference.java:**38)
>>>>       at org.apache.openejb.core.ivm.**naming.Reference.getContent(**
>>>> Reference.java:40)
>>>>       at org.apache.xbean.naming.**reference.SimpleReference$**
>>>> SimpleObjectFactory.**getObjectInstance(**SimpleReference.java:137)
>>>>       at javax.naming.spi.**NamingManager.**getObjectInstance(**
>>>> NamingManager.java:321)
>>>>       at
>>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:843)
>>>>       at
>>>> org.apache.naming.**NamingContext.lookup(**NamingContext.java:168)
>>>>       at org.apache.tomee.catalina.**TomcatWebAppBuilder.safeBind(**
>>>> TomcatWebAppBuilder.java:1196)
>>>>       at org.apache.tomee.catalina.**TomcatWebAppBuilder.**afterStart(**
>>>> TomcatWebAppBuilder.java:807)
>>>>       at
>>>> org.apache.tomee.catalina.**GlobalListenerSupport.**lifecycleEvent(
>>>> **GlobalListenerSupport.java:**103)
>>>>       at
>>>> org.apache.catalina.util.**LifecycleSupport.**fireLifecycleEvent(**
>>>> LifecycleSupport.java:119)
>>>>       at org.apache.catalina.util.**LifecycleBase.**fireLifecycleEvent(**
>>>> LifecycleBase.java:90)
>>>>       at org.apache.catalina.util.**LifecycleBase.**setStateInternal(**
>>>> LifecycleBase.java:401)
>>>>       at org.apache.catalina.util.**LifecycleBase.start(**
>>>> LifecycleBase.java:168)
>>>>       at org.apache.catalina.core.**ContainerBase.**addChildInternal(**
>>>> ContainerBase.java:895)
>>>>       at org.apache.catalina.core.**ContainerBase.addChild(**
>>>> ContainerBase.java:871)
>>>>       at org.apache.catalina.core.**StandardHost.addChild(**
>>>> StandardHost.java:615)
>>>>       at org.apache.catalina.startup.**HostConfig.deployDescriptor(**
>>>> HostConfig.java:649)
>>>>       at org.apache.catalina.startup.**HostConfig.deployApps(**
>>>> HostConfig.java:530)
>>>>       at org.apache.catalina.startup.**HostConfig.check(HostConfig.**
>>>> java:1471)
>>>>       at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native Method)
>>>>       at sun.reflect.**NativeMethodAccessorImpl.**invoke(**
>>>> NativeMethodAccessorImpl.java:**57)
>>>>       at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
>>>> DelegatingMethodAccessorImpl.**java:43)
>>>>       at java.lang.reflect.Method.**invoke(Method.java:601)
>>>>       at org.apache.tomcat.util.**modeler.BaseModelMBean.invoke(**
>>>> BaseModelMBean.java:301)
>>>>       at
>>>> com.sun.jmx.interceptor.**DefaultMBeanServerInterceptor.**invoke(**
>>>> DefaultMBeanServerInterceptor.**java:819)
>>>>       at com.sun.jmx.mbeanserver.**JmxMBeanServer.invoke(**
>>>> JmxMBeanServer.java:791)
>>>>       at org.apache.catalina.manager.**ManagerServlet.check(**
>>>> ManagerServlet.java:1436)
>>>>       at org.apache.catalina.manager.**ManagerServlet.deploy(**
>>>> ManagerServlet.java:856)
>>>>       at org.apache.catalina.manager.**ManagerServlet.doGet(**
>>>> ManagerServlet.java:353)
>>>>       at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:621)
>>>>       at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:722)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**
>>>> internalDoFilter(**ApplicationFilterChain.java:**305)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>>> ApplicationFilterChain.java:**210)
>>>>       at org.apache.catalina.filters.**SetCharacterEncodingFilter.**
>>>> doFilter(**SetCharacterEncodingFilter.**java:108)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**
>>>> internalDoFilter(**ApplicationFilterChain.java:**243)
>>>>       at org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
>>>> ApplicationFilterChain.java:**210)
>>>>       at org.apache.catalina.core.**StandardWrapperValve.invoke(**
>>>> StandardWrapperValve.java:225)
>>>>       at org.apache.catalina.core.**StandardContextValve.invoke(**
>>>> StandardContextValve.java:169)
>>>>       at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
>>>> OpenEJBValve.java:44)
>>>>       at
>>>> org.apache.catalina.**authenticator.**AuthenticatorBase.invoke(**
>>>> AuthenticatorBase.java:581)
>>>>       at org.apache.catalina.core.**StandardHostValve.invoke(**
>>>> StandardHostValve.java:168)
>>>>       at org.apache.catalina.valves.**ErrorReportValve.invoke(**
>>>> ErrorReportValve.java:98)
>>>>       at org.apache.catalina.valves.**AccessLogValve.invoke(**
>>>> AccessLogValve.java:927)
>>>>       at org.apache.catalina.core.**StandardEngineValve.invoke(**
>>>> StandardEngineValve.java:118)
>>>>       at org.apache.catalina.connector.**CoyoteAdapter.service(**
>>>> CoyoteAdapter.java:407)
>>>>       at org.apache.coyote.http11.**AbstractHttp11Processor.**process(**
>>>> AbstractHttp11Processor.java:**999)
>>>>       at
>>>> org.apache.coyote.**AbstractProtocol$**AbstractConnectionHandler.**
>>>> process(AbstractProtocol.java:**565)
>>>>       at org.apache.tomcat.util.net.**JIoEndpoint$SocketProcessor.**
>>>> run(JIoEndpoint.java:309)
>>>>       at java.util.concurrent.**ThreadPoolExecutor.runWorker(**
>>>> ThreadPoolExecutor.java:1110)
>>>>       at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
>>>> ThreadPoolExecutor.java:603)
>>>>       at java.lang.Thread.run(Thread.**java:722)
>>>>
>>>>
>>>>
>>>> On 7/8/2012 4:32 PM, Romain Manni-Bucau wrote:
>>>>
>>>>> i don't think so,
>>>>>
>>>>> can you try moving your code in a unit test to see if it still happen?
>>>>>
>>>>> - Romain
>>>>>
>>>>>
>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>
>>>>>    Could it be the Tomcat JDBCRealm I have enforcing container managed
>>>>>> security from user data in the same table?
>>>>>>
>>>>>>
>>>>>> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>>>>>>
>>>>>>    i can't say no but i'm pretty sure it is something in the container
>>>>>>> rather
>>>>>>> in the DB.
>>>>>>>
>>>>>>> - Romain
>>>>>>>
>>>>>>>
>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>
>>>>>>>     Maybe the DB settings could have something to do with it? I'm
>>>>>>> using
>>>>>>> MySQL
>>>>>>>
>>>>>>>> with it's default setup which uses InnoDB.  I notice in the
>>>>>>>> documentation
>>>>>>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1,
>>>>>>>> flushes the
>>>>>>>> transaction log after each transaction, greatly improving
>>>>>>>> reliability."
>>>>>>>>
>>>>>>>> Could some DB setting like this be causing the issue?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>>>>>>
>>>>>>>>     can you share a small sample to reproduce it, will be easier
>>>>>>>> to help
>>>>>>>>
>>>>>>>>> you?
>>>>>>>>>
>>>>>>>>> - Romain
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>
>>>>>>>>>      Not that I've configured.. Unless one of the annotations
>>>>>>>>> creates
>>>>>>>>> one:
>>>>>>>>>
>>>>>>>>>    @Entity
>>>>>>>>>> @Table(name = "user")
>>>>>>>>>> @XmlRootElement
>>>>>>>>>> @NamedQueries({
>>>>>>>>>>          @NamedQuery(name = "User.findAll", query = "SELECT u
>>>>>>>>>> FROM User
>>>>>>>>>> u"),
>>>>>>>>>>          @NamedQuery(name = "User.findByUserId", query = "SELECT
>>>>>>>>>> u FROM
>>>>>>>>>> User
>>>>>>>>>> u
>>>>>>>>>> WHERE u.userId = :userId"),
>>>>>>>>>>          @NamedQuery(name = "User.findByUserName", query =
>>>>>>>>>> "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User
>>>>>>>>>> u WHERE u.userName = :userName"),
>>>>>>>>>>          @NamedQuery(name = "User.findByPassword", query =
>>>>>>>>>> "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User
>>>>>>>>>> u WHERE u.password = :password"),
>>>>>>>>>>          @NamedQuery(name = "User.findByEmail", query = "SELECT
>>>>>>>>>> u FROM
>>>>>>>>>> User u
>>>>>>>>>> WHERE u.email = :email"),
>>>>>>>>>>          @NamedQuery(name = "User.findByFirstName", query =
>>>>>>>>>> "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User
>>>>>>>>>> u WHERE u.firstName = :firstName"),
>>>>>>>>>>          @NamedQuery(name = "User.findByLastName", query =
>>>>>>>>>> "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User
>>>>>>>>>> u WHERE u.lastName = :lastName"),
>>>>>>>>>>          @NamedQuery(name = "User.findByLoginFailures", query =
>>>>>>>>>> "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>>>>>>          @NamedQuery(name = "User.findByLastLoginFailure", query =
>>>>>>>>>> "SELECT u
>>>>>>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>>>>>>> public class User implements Serializable {
>>>>>>>>>>          private static final long serialVersionUID = 1L;
>>>>>>>>>>          @Id
>>>>>>>>>>          @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>>>>>>          @Basic(optional = false)
>>>>>>>>>>          @Column(name = "user_id")
>>>>>>>>>>          private Integer userId;
>>>>>>>>>>          @Basic(optional = false)
>>>>>>>>>>          @Column(name = "user_name")
>>>>>>>>>>          private String userName;
>>>>>>>>>>          @Basic(optional = false)
>>>>>>>>>>          @Column(name = "password")
>>>>>>>>>>          private String password;
>>>>>>>>>>          @Column(name = "email")
>>>>>>>>>>          private String email;
>>>>>>>>>>          @Column(name = "first_name")
>>>>>>>>>>          private String firstName;
>>>>>>>>>>          @Column(name = "last_name")
>>>>>>>>>>          private String lastName;
>>>>>>>>>>          @Column(name = "login_failures")
>>>>>>>>>>          private Integer loginFailures;
>>>>>>>>>>          @Column(name = "last_login_failure")
>>>>>>>>>>          @Temporal(TemporalType.********TIMESTAMP)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>          private Date lastLoginFailure;
>>>>>>>>>>          @JoinColumn(name = "associated_customer",
>>>>>>>>>> referencedColumnName =
>>>>>>>>>> "customer_id")
>>>>>>>>>>          @ManyToOne
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>>>>>>
>>>>>>>>>>      Hi,
>>>>>>>>>>
>>>>>>>>>>    any entity listener playing with id or special field on User
>>>>>>>>>> entity?
>>>>>>>>>>> - Romain
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>>
>>>>>>>>>>>       I'm attempting the code:
>>>>>>>>>>>
>>>>>>>>>>>     Properties properties = new Properties();
>>>>>>>>>>>
>>>>>>>>>>>> properties.setProperty(**********Context.INITIAL_CONTEXT_*******
>>>>>>>>>>>> ***
>>>>>>>>>>>> FACTORY,
>>>>>>>>>>>> "org.apache.openejb.client.************
>>>>>>>>>>>> LocalInitialContextFactory"**)**;
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>>>>>>>> Object object = initialContext.lookup("*********
>>>>>>>>>>>> *UserFacadeLocal");
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>>>>>>> User newuser = new User();
>>>>>>>>>>>> newuser.setEmail("[hidden email]"**********);
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> newuser.setUserName("steve");
>>>>>>>>>>>> newuser.setPassword("cows");
>>>>>>>>>>>> userFacade.create(newuser);
>>>>>>>>>>>>
>>>>>>>>>>>> but keep getting "org.apache.openjpa.**********persistence.****
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> InvalidStateException:
>>>>>>>>>>>>
>>>>>>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>>>>>>> callback
>>>>>>>>>>>> methods or event listeners do not invoke any operations that
>>>>>>>>>>>> require
>>>>>>>>>>>> the
>>>>>>>>>>>> in-progress flush to complete."
>>>>>>>>>>>>
>>>>>>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to
>>>>>>>>>>>> see
>>>>>>>>>>>> if
>>>>>>>>>>>> I
>>>>>>>>>>>> can
>>>>>>>>>>>> get the error to go away, but it makes no difference.  I can't
>>>>>>>>>>>> find a
>>>>>>>>>>>> flush() call in my project and according to the table in the
>>>>>>>>>>>> docs,
>>>>>>>>>>>> flush
>>>>>>>>>>>> is
>>>>>>>>>>>> not called if this parameter is set.  What am I not doing
>>>>>>>>>>>> correctly
>>>>>>>>>>>> here?
>>>>>>>>>>>>
>>>>>>>>>>>> Thank you,
>>>>>>>>>>>> David
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush

Romain Manni-Bucau
In reply to this post by slimsalmon
You should at least share your logs or (better) a sample otherwise helping
you is hard. Generally it is faster than 'trying' things.

- Romun
Le 9 juil. 2012 03:20, "David Nordahl" <[hidden email]> a écrit :

> Tried the snap shot.. I get an error in Netbeans saying that it can't
> deploy the app and to check the server log, yet the server log has no
> errors and shows the app deploying successfully yet I cannot open the web
> host in the browser.  I give up... I could have written all the middle ware
> needed for this project myself by now.  Thanks for your efforts.
>
> On 7/8/2012 4:56 PM, Romain Manni-Bucau wrote:
>
>> hmm
>>
>> you use tomee 1.0.0
>>
>> can you give it a try to the snapshot please? we worked a bit on netbeans
>> integration.
>>
>> - Romain
>>
>>
>> 2012/7/8 David Nordahl<[hidden email]>
>>
>>  Btw.. Is it normal to have these exceptions on startup?  I saw another
>>> post saying they were, but I thought I might double check.  I seem to be
>>> able to query through open EJB, but not update and add.  I'm also
>>> wondering
>>> if there is anyway that the reentrant flush error is covering up another
>>> error.  I guess I can start working on a test case.. I wish I could just
>>> find a netbeans JSP2.0/EJB/TomEE sample project where everything was
>>> already setup correctly.
>>>
>>> SEVERE: Error in safeBind method
>>> javax.naming.****NameNotFoundException: Name [openejb] is not bound in
>>> this
>>> Context. Unable to find [openejb].
>>>      at org.apache.naming.****NamingContext.lookup(****
>>> NamingContext.java:820)
>>>      at org.apache.naming.****NamingContext.lookup(****
>>> NamingContext.java:168)
>>>      at org.apache.tomee.catalina.****TomcatWebAppBuilder.safeBind(****
>>> TomcatWebAppBuilder.java:1196)
>>>      at org.apache.tomee.catalina.****TomcatWebAppBuilder.****
>>> afterStart(**
>>> TomcatWebAppBuilder.java:776)
>>>      at org.apache.tomee.catalina.****GlobalListenerSupport.****
>>> lifecycleEvent(
>>> **GlobalListenerSupport.java:****103)
>>>      at org.apache.catalina.util.****LifecycleSupport.****
>>> fireLifecycleEvent(**
>>> LifecycleSupport.java:119)
>>>      at org.apache.catalina.util.****LifecycleBase.****
>>> fireLifecycleEvent(**
>>> LifecycleBase.java:90)
>>>      at org.apache.catalina.util.****LifecycleBase.****
>>> setStateInternal(**
>>> LifecycleBase.java:401)
>>>      at org.apache.catalina.util.****LifecycleBase.start(**
>>> LifecycleBase.java:168)
>>>      at org.apache.catalina.core.****ContainerBase.****
>>> addChildInternal(**
>>> ContainerBase.java:895)
>>>      at org.apache.catalina.core.****ContainerBase.addChild(**
>>> ContainerBase.java:871)
>>>      at org.apache.catalina.core.****StandardHost.addChild(**
>>> StandardHost.java:615)
>>>      at org.apache.catalina.startup.****HostConfig.deployDescriptor(**
>>> HostConfig.java:649)
>>>      at org.apache.catalina.startup.****HostConfig.deployApps(**
>>> HostConfig.java:530)
>>>      at org.apache.catalina.startup.****HostConfig.check(HostConfig.**
>>> java:1471)
>>>      at sun.reflect.****NativeMethodAccessorImpl.****invoke0(Native
>>> Method)
>>>      at sun.reflect.****NativeMethodAccessorImpl.****invoke(**
>>> NativeMethodAccessorImpl.java:****57)
>>>      at sun.reflect.****DelegatingMethodAccessorImpl.****invoke(**
>>> DelegatingMethodAccessorImpl.****java:43)
>>>      at java.lang.reflect.Method.****invoke(Method.java:601)
>>>      at org.apache.tomcat.util.****modeler.BaseModelMBean.invoke(****
>>> BaseModelMBean.java:301)
>>>      at com.sun.jmx.interceptor.****DefaultMBeanServerInterceptor.**
>>> **invoke(**
>>> DefaultMBeanServerInterceptor.****java:819)
>>>      at com.sun.jmx.mbeanserver.****JmxMBeanServer.invoke(**
>>> JmxMBeanServer.java:791)
>>>      at org.apache.catalina.manager.****ManagerServlet.check(**
>>> ManagerServlet.java:1436)
>>>      at org.apache.catalina.manager.****ManagerServlet.deploy(**
>>> ManagerServlet.java:856)
>>>      at org.apache.catalina.manager.****ManagerServlet.doGet(**
>>> ManagerServlet.java:353)
>>>      at javax.servlet.http.****HttpServlet.service(****
>>> HttpServlet.java:621)
>>>      at javax.servlet.http.****HttpServlet.service(****
>>> HttpServlet.java:722)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.**
>>> internalDoFilter(****ApplicationFilterChain.java:****305)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.****
>>> doFilter(**
>>> ApplicationFilterChain.java:****210)
>>>      at org.apache.catalina.filters.****SetCharacterEncodingFilter.**
>>> doFilter(****SetCharacterEncodingFilter.****java:108)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.**
>>> internalDoFilter(****ApplicationFilterChain.java:****243)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.****
>>> doFilter(**
>>> ApplicationFilterChain.java:****210)
>>>      at org.apache.catalina.core.****StandardWrapperValve.invoke(**
>>> StandardWrapperValve.java:225)
>>>      at org.apache.catalina.core.****StandardContextValve.invoke(**
>>> StandardContextValve.java:169)
>>>      at org.apache.tomee.catalina.****OpenEJBValve.invoke(**
>>> OpenEJBValve.java:44)
>>>      at org.apache.catalina.****authenticator.****
>>> AuthenticatorBase.invoke(**
>>> AuthenticatorBase.java:581)
>>>      at org.apache.catalina.core.****StandardHostValve.invoke(**
>>> StandardHostValve.java:168)
>>>      at org.apache.catalina.valves.****ErrorReportValve.invoke(**
>>> ErrorReportValve.java:98)
>>>      at org.apache.catalina.valves.****AccessLogValve.invoke(**
>>> AccessLogValve.java:927)
>>>      at org.apache.catalina.core.****StandardEngineValve.invoke(**
>>> StandardEngineValve.java:118)
>>>      at org.apache.catalina.connector.****CoyoteAdapter.service(**
>>> CoyoteAdapter.java:407)
>>>      at org.apache.coyote.http11.****AbstractHttp11Processor.****
>>> process(**
>>> AbstractHttp11Processor.java:****999)
>>>      at org.apache.coyote.****AbstractProtocol$****
>>> AbstractConnectionHandler.**
>>> process(AbstractProtocol.java:****565)
>>>      at org.apache.tomcat.util.net.****JIoEndpoint$SocketProcessor.**
>>> run(JIoEndpoint.java:309)
>>>      at java.util.concurrent.****ThreadPoolExecutor.runWorker(****
>>> ThreadPoolExecutor.java:1110)
>>>      at java.util.concurrent.****ThreadPoolExecutor$Worker.run(****
>>> ThreadPoolExecutor.java:603)
>>>      at java.lang.Thread.run(Thread.****java:722)
>>>
>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>> TomcatWebAppBuilder
>>> safeBind
>>> INFO: TransactionManager already bound, ignoring
>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>> TomcatWebAppBuilder
>>> safeBind
>>> INFO: TransactionSynchronizationRegi****stry already bound, ignoring
>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>> TomcatWebAppBuilder
>>> safeBind
>>> SEVERE: Error in safeBind method
>>> javax.naming.****NameNotFoundException: No ORB registered with the
>>> OpenEJB
>>> system
>>>      at org.apache.openejb.core.ivm.****naming.****
>>> SystemComponentReference.**
>>> getObject(****SystemComponentReference.java:****38)
>>>      at org.apache.openejb.core.ivm.****naming.Reference.getContent(**
>>> Reference.java:40)
>>>      at org.apache.xbean.naming.****reference.SimpleReference$**
>>> SimpleObjectFactory.****getObjectInstance(****SimpleReference.java:137)
>>>      at javax.naming.spi.****NamingManager.****getObjectInstance(**
>>> NamingManager.java:321)
>>>      at org.apache.naming.****NamingContext.lookup(****
>>> NamingContext.java:843)
>>>      at org.apache.naming.****NamingContext.lookup(****
>>> NamingContext.java:168)
>>>      at org.apache.tomee.catalina.****TomcatWebAppBuilder.safeBind(****
>>> TomcatWebAppBuilder.java:1196)
>>>      at org.apache.tomee.catalina.****TomcatWebAppBuilder.****
>>> afterStart(**
>>> TomcatWebAppBuilder.java:806)
>>>      at org.apache.tomee.catalina.****GlobalListenerSupport.****
>>> lifecycleEvent(
>>> **GlobalListenerSupport.java:****103)
>>>      at org.apache.catalina.util.****LifecycleSupport.****
>>> fireLifecycleEvent(**
>>> LifecycleSupport.java:119)
>>>      at org.apache.catalina.util.****LifecycleBase.****
>>> fireLifecycleEvent(**
>>> LifecycleBase.java:90)
>>>      at org.apache.catalina.util.****LifecycleBase.****
>>> setStateInternal(**
>>> LifecycleBase.java:401)
>>>      at org.apache.catalina.util.****LifecycleBase.start(**
>>> LifecycleBase.java:168)
>>>      at org.apache.catalina.core.****ContainerBase.****
>>> addChildInternal(**
>>> ContainerBase.java:895)
>>>      at org.apache.catalina.core.****ContainerBase.addChild(**
>>> ContainerBase.java:871)
>>>      at org.apache.catalina.core.****StandardHost.addChild(**
>>> StandardHost.java:615)
>>>      at org.apache.catalina.startup.****HostConfig.deployDescriptor(**
>>> HostConfig.java:649)
>>>      at org.apache.catalina.startup.****HostConfig.deployApps(**
>>> HostConfig.java:530)
>>>      at org.apache.catalina.startup.****HostConfig.check(HostConfig.**
>>> java:1471)
>>>      at sun.reflect.****NativeMethodAccessorImpl.****invoke0(Native
>>> Method)
>>>      at sun.reflect.****NativeMethodAccessorImpl.****invoke(**
>>> NativeMethodAccessorImpl.java:****57)
>>>      at sun.reflect.****DelegatingMethodAccessorImpl.****invoke(**
>>> DelegatingMethodAccessorImpl.****java:43)
>>>      at java.lang.reflect.Method.****invoke(Method.java:601)
>>>      at org.apache.tomcat.util.****modeler.BaseModelMBean.invoke(****
>>> BaseModelMBean.java:301)
>>>      at com.sun.jmx.interceptor.****DefaultMBeanServerInterceptor.**
>>> **invoke(**
>>> DefaultMBeanServerInterceptor.****java:819)
>>>      at com.sun.jmx.mbeanserver.****JmxMBeanServer.invoke(**
>>> JmxMBeanServer.java:791)
>>>      at org.apache.catalina.manager.****ManagerServlet.check(**
>>> ManagerServlet.java:1436)
>>>      at org.apache.catalina.manager.****ManagerServlet.deploy(**
>>> ManagerServlet.java:856)
>>>      at org.apache.catalina.manager.****ManagerServlet.doGet(**
>>> ManagerServlet.java:353)
>>>      at javax.servlet.http.****HttpServlet.service(****
>>> HttpServlet.java:621)
>>>      at javax.servlet.http.****HttpServlet.service(****
>>> HttpServlet.java:722)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.**
>>> internalDoFilter(****ApplicationFilterChain.java:****305)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.****
>>> doFilter(**
>>> ApplicationFilterChain.java:****210)
>>>      at org.apache.catalina.filters.****SetCharacterEncodingFilter.**
>>> doFilter(****SetCharacterEncodingFilter.****java:108)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.**
>>> internalDoFilter(****ApplicationFilterChain.java:****243)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.****
>>> doFilter(**
>>> ApplicationFilterChain.java:****210)
>>>      at org.apache.catalina.core.****StandardWrapperValve.invoke(**
>>> StandardWrapperValve.java:225)
>>>      at org.apache.catalina.core.****StandardContextValve.invoke(**
>>> StandardContextValve.java:169)
>>>      at org.apache.tomee.catalina.****OpenEJBValve.invoke(**
>>> OpenEJBValve.java:44)
>>>      at org.apache.catalina.****authenticator.****
>>> AuthenticatorBase.invoke(**
>>> AuthenticatorBase.java:581)
>>>      at org.apache.catalina.core.****StandardHostValve.invoke(**
>>> StandardHostValve.java:168)
>>>      at org.apache.catalina.valves.****ErrorReportValve.invoke(**
>>> ErrorReportValve.java:98)
>>>      at org.apache.catalina.valves.****AccessLogValve.invoke(**
>>> AccessLogValve.java:927)
>>>      at org.apache.catalina.core.****StandardEngineValve.invoke(**
>>> StandardEngineValve.java:118)
>>>      at org.apache.catalina.connector.****CoyoteAdapter.service(**
>>> CoyoteAdapter.java:407)
>>>      at org.apache.coyote.http11.****AbstractHttp11Processor.****
>>> process(**
>>> AbstractHttp11Processor.java:****999)
>>>      at org.apache.coyote.****AbstractProtocol$****
>>> AbstractConnectionHandler.**
>>> process(AbstractProtocol.java:****565)
>>>      at org.apache.tomcat.util.net.****JIoEndpoint$SocketProcessor.**
>>> run(JIoEndpoint.java:309)
>>>      at java.util.concurrent.****ThreadPoolExecutor.runWorker(****
>>> ThreadPoolExecutor.java:1110)
>>>      at java.util.concurrent.****ThreadPoolExecutor$Worker.run(****
>>> ThreadPoolExecutor.java:603)
>>>      at java.lang.Thread.run(Thread.****java:722)
>>>
>>> Jul 08, 2012 4:40:43 PM org.apache.tomee.catalina.****
>>> TomcatWebAppBuilder
>>> safeBind
>>> SEVERE: Error in safeBind method
>>> javax.naming.****NameNotFoundException: No HandleDelegate registered
>>> with
>>> the OpenEJB system
>>>      at org.apache.openejb.core.ivm.****naming.****
>>> SystemComponentReference.**
>>> getObject(****SystemComponentReference.java:****38)
>>>      at org.apache.openejb.core.ivm.****naming.Reference.getContent(**
>>> Reference.java:40)
>>>      at org.apache.xbean.naming.****reference.SimpleReference$**
>>> SimpleObjectFactory.****getObjectInstance(****SimpleReference.java:137)
>>>      at javax.naming.spi.****NamingManager.****getObjectInstance(**
>>> NamingManager.java:321)
>>>      at org.apache.naming.****NamingContext.lookup(****
>>> NamingContext.java:843)
>>>      at org.apache.naming.****NamingContext.lookup(****
>>> NamingContext.java:168)
>>>      at org.apache.tomee.catalina.****TomcatWebAppBuilder.safeBind(****
>>> TomcatWebAppBuilder.java:1196)
>>>      at org.apache.tomee.catalina.****TomcatWebAppBuilder.****
>>> afterStart(**
>>> TomcatWebAppBuilder.java:807)
>>>      at org.apache.tomee.catalina.****GlobalListenerSupport.****
>>> lifecycleEvent(
>>> **GlobalListenerSupport.java:****103)
>>>      at org.apache.catalina.util.****LifecycleSupport.****
>>> fireLifecycleEvent(**
>>> LifecycleSupport.java:119)
>>>      at org.apache.catalina.util.****LifecycleBase.****
>>> fireLifecycleEvent(**
>>> LifecycleBase.java:90)
>>>      at org.apache.catalina.util.****LifecycleBase.****
>>> setStateInternal(**
>>> LifecycleBase.java:401)
>>>      at org.apache.catalina.util.****LifecycleBase.start(**
>>> LifecycleBase.java:168)
>>>      at org.apache.catalina.core.****ContainerBase.****
>>> addChildInternal(**
>>> ContainerBase.java:895)
>>>      at org.apache.catalina.core.****ContainerBase.addChild(**
>>> ContainerBase.java:871)
>>>      at org.apache.catalina.core.****StandardHost.addChild(**
>>> StandardHost.java:615)
>>>      at org.apache.catalina.startup.****HostConfig.deployDescriptor(**
>>> HostConfig.java:649)
>>>      at org.apache.catalina.startup.****HostConfig.deployApps(**
>>> HostConfig.java:530)
>>>      at org.apache.catalina.startup.****HostConfig.check(HostConfig.**
>>> java:1471)
>>>      at sun.reflect.****NativeMethodAccessorImpl.****invoke0(Native
>>> Method)
>>>      at sun.reflect.****NativeMethodAccessorImpl.****invoke(**
>>> NativeMethodAccessorImpl.java:****57)
>>>      at sun.reflect.****DelegatingMethodAccessorImpl.****invoke(**
>>> DelegatingMethodAccessorImpl.****java:43)
>>>      at java.lang.reflect.Method.****invoke(Method.java:601)
>>>      at org.apache.tomcat.util.****modeler.BaseModelMBean.invoke(****
>>> BaseModelMBean.java:301)
>>>      at com.sun.jmx.interceptor.****DefaultMBeanServerInterceptor.**
>>> **invoke(**
>>> DefaultMBeanServerInterceptor.****java:819)
>>>      at com.sun.jmx.mbeanserver.****JmxMBeanServer.invoke(**
>>> JmxMBeanServer.java:791)
>>>      at org.apache.catalina.manager.****ManagerServlet.check(**
>>> ManagerServlet.java:1436)
>>>      at org.apache.catalina.manager.****ManagerServlet.deploy(**
>>> ManagerServlet.java:856)
>>>      at org.apache.catalina.manager.****ManagerServlet.doGet(**
>>> ManagerServlet.java:353)
>>>      at javax.servlet.http.****HttpServlet.service(****
>>> HttpServlet.java:621)
>>>      at javax.servlet.http.****HttpServlet.service(****
>>> HttpServlet.java:722)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.**
>>> internalDoFilter(****ApplicationFilterChain.java:****305)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.****
>>> doFilter(**
>>> ApplicationFilterChain.java:****210)
>>>      at org.apache.catalina.filters.****SetCharacterEncodingFilter.**
>>> doFilter(****SetCharacterEncodingFilter.****java:108)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.**
>>> internalDoFilter(****ApplicationFilterChain.java:****243)
>>>      at org.apache.catalina.core.****ApplicationFilterChain.****
>>> doFilter(**
>>> ApplicationFilterChain.java:****210)
>>>      at org.apache.catalina.core.****StandardWrapperValve.invoke(**
>>> StandardWrapperValve.java:225)
>>>      at org.apache.catalina.core.****StandardContextValve.invoke(**
>>> StandardContextValve.java:169)
>>>      at org.apache.tomee.catalina.****OpenEJBValve.invoke(**
>>> OpenEJBValve.java:44)
>>>      at org.apache.catalina.****authenticator.****
>>> AuthenticatorBase.invoke(**
>>> AuthenticatorBase.java:581)
>>>      at org.apache.catalina.core.****StandardHostValve.invoke(**
>>> StandardHostValve.java:168)
>>>      at org.apache.catalina.valves.****ErrorReportValve.invoke(**
>>> ErrorReportValve.java:98)
>>>      at org.apache.catalina.valves.****AccessLogValve.invoke(**
>>> AccessLogValve.java:927)
>>>      at org.apache.catalina.core.****StandardEngineValve.invoke(**
>>> StandardEngineValve.java:118)
>>>      at org.apache.catalina.connector.****CoyoteAdapter.service(**
>>> CoyoteAdapter.java:407)
>>>      at org.apache.coyote.http11.****AbstractHttp11Processor.****
>>> process(**
>>> AbstractHttp11Processor.java:****999)
>>>      at org.apache.coyote.****AbstractProtocol$****
>>> AbstractConnectionHandler.**
>>> process(AbstractProtocol.java:****565)
>>>      at org.apache.tomcat.util.net.****JIoEndpoint$SocketProcessor.**
>>> run(JIoEndpoint.java:309)
>>>      at java.util.concurrent.****ThreadPoolExecutor.runWorker(****
>>> ThreadPoolExecutor.java:1110)
>>>      at java.util.concurrent.****ThreadPoolExecutor$Worker.run(****
>>> ThreadPoolExecutor.java:603)
>>>      at java.lang.Thread.run(Thread.****java:722)
>>>
>>>
>>>
>>> On 7/8/2012 4:32 PM, Romain Manni-Bucau wrote:
>>>
>>>  i don't think so,
>>>>
>>>> can you try moving your code in a unit test to see if it still happen?
>>>>
>>>> - Romain
>>>>
>>>>
>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>
>>>>   Could it be the Tomcat JDBCRealm I have enforcing container managed
>>>>
>>>>> security from user data in the same table?
>>>>>
>>>>>
>>>>> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>>>>>
>>>>>   i can't say no but i'm pretty sure it is something in the container
>>>>>
>>>>>> rather
>>>>>> in the DB.
>>>>>>
>>>>>> - Romain
>>>>>>
>>>>>>
>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>
>>>>>>    Maybe the DB settings could have something to do with it? I'm using
>>>>>> MySQL
>>>>>>
>>>>>>  with it's default setup which uses InnoDB.  I notice in the
>>>>>>> documentation
>>>>>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes
>>>>>>> the
>>>>>>> transaction log after each transaction, greatly improving
>>>>>>> reliability."
>>>>>>>
>>>>>>> Could some DB setting like this be causing the issue?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>>>>>
>>>>>>>    can you share a small sample to reproduce it, will be easier to
>>>>>>> help
>>>>>>>
>>>>>>>  you?
>>>>>>>>
>>>>>>>> - Romain
>>>>>>>>
>>>>>>>>
>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>
>>>>>>>>     Not that I've configured.. Unless one of the annotations creates
>>>>>>>> one:
>>>>>>>>
>>>>>>>>   @Entity
>>>>>>>>
>>>>>>>>> @Table(name = "user")
>>>>>>>>> @XmlRootElement
>>>>>>>>> @NamedQueries({
>>>>>>>>>         @NamedQuery(name = "User.findAll", query = "SELECT u FROM
>>>>>>>>> User
>>>>>>>>> u"),
>>>>>>>>>         @NamedQuery(name = "User.findByUserId", query = "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User
>>>>>>>>> u
>>>>>>>>> WHERE u.userId = :userId"),
>>>>>>>>>         @NamedQuery(name = "User.findByUserName", query = "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User
>>>>>>>>> u WHERE u.userName = :userName"),
>>>>>>>>>         @NamedQuery(name = "User.findByPassword", query = "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User
>>>>>>>>> u WHERE u.password = :password"),
>>>>>>>>>         @NamedQuery(name = "User.findByEmail", query = "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User u
>>>>>>>>> WHERE u.email = :email"),
>>>>>>>>>         @NamedQuery(name = "User.findByFirstName", query = "SELECT
>>>>>>>>> u
>>>>>>>>> FROM
>>>>>>>>> User
>>>>>>>>> u WHERE u.firstName = :firstName"),
>>>>>>>>>         @NamedQuery(name = "User.findByLastName", query = "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User
>>>>>>>>> u WHERE u.lastName = :lastName"),
>>>>>>>>>         @NamedQuery(name = "User.findByLoginFailures", query =
>>>>>>>>> "SELECT u
>>>>>>>>> FROM
>>>>>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>>>>>         @NamedQuery(name = "User.findByLastLoginFailure", query =
>>>>>>>>> "SELECT u
>>>>>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>>>>>> public class User implements Serializable {
>>>>>>>>>         private static final long serialVersionUID = 1L;
>>>>>>>>>         @Id
>>>>>>>>>         @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>>>>>         @Basic(optional = false)
>>>>>>>>>         @Column(name = "user_id")
>>>>>>>>>         private Integer userId;
>>>>>>>>>         @Basic(optional = false)
>>>>>>>>>         @Column(name = "user_name")
>>>>>>>>>         private String userName;
>>>>>>>>>         @Basic(optional = false)
>>>>>>>>>         @Column(name = "password")
>>>>>>>>>         private String password;
>>>>>>>>>         @Column(name = "email")
>>>>>>>>>         private String email;
>>>>>>>>>         @Column(name = "first_name")
>>>>>>>>>         private String firstName;
>>>>>>>>>         @Column(name = "last_name")
>>>>>>>>>         private String lastName;
>>>>>>>>>         @Column(name = "login_failures")
>>>>>>>>>         private Integer loginFailures;
>>>>>>>>>         @Column(name = "last_login_failure")
>>>>>>>>>         @Temporal(TemporalType.**********TIMESTAMP)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>         private Date lastLoginFailure;
>>>>>>>>>         @JoinColumn(name = "associated_customer",
>>>>>>>>> referencedColumnName =
>>>>>>>>> "customer_id")
>>>>>>>>>         @ManyToOne
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>>>>>
>>>>>>>>>     Hi,
>>>>>>>>>
>>>>>>>>>   any entity listener playing with id or special field on User
>>>>>>>>> entity?
>>>>>>>>>
>>>>>>>>>> - Romain
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>
>>>>>>>>>>      I'm attempting the code:
>>>>>>>>>>
>>>>>>>>>>    Properties properties = new Properties();
>>>>>>>>>>
>>>>>>>>>>  properties.setProperty(************Context.INITIAL_CONTEXT_*****
>>>>>>>>>>> ****
>>>>>>>>>>> ***
>>>>>>>>>>> FACTORY,
>>>>>>>>>>> "org.apache.openejb.client.**************
>>>>>>>>>>> LocalInitialContextFactory"**)****;
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>>>>>>> Object object = initialContext.lookup("***********
>>>>>>>>>>> *UserFacadeLocal");
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>>>>>> User newuser = new User();
>>>>>>>>>>> newuser.setEmail("[hidden email]"************);
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> newuser.setUserName("steve");
>>>>>>>>>>> newuser.setPassword("cows");
>>>>>>>>>>> userFacade.create(newuser);
>>>>>>>>>>>
>>>>>>>>>>> but keep getting "org.apache.openjpa.************
>>>>>>>>>>> persistence.****
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> InvalidStateException:
>>>>>>>>>>>
>>>>>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>>>>>> callback
>>>>>>>>>>> methods or event listeners do not invoke any operations that
>>>>>>>>>>> require
>>>>>>>>>>> the
>>>>>>>>>>> in-progress flush to complete."
>>>>>>>>>>>
>>>>>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to see
>>>>>>>>>>> if
>>>>>>>>>>> I
>>>>>>>>>>> can
>>>>>>>>>>> get the error to go away, but it makes no difference.  I can't
>>>>>>>>>>> find a
>>>>>>>>>>> flush() call in my project and according to the table in the
>>>>>>>>>>> docs,
>>>>>>>>>>> flush
>>>>>>>>>>> is
>>>>>>>>>>> not called if this parameter is set.  What am I not doing
>>>>>>>>>>> correctly
>>>>>>>>>>> here?
>>>>>>>>>>>
>>>>>>>>>>> Thank you,
>>>>>>>>>>> David
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush - Trouble with merge / update

slimsalmon
I looked at it again today, and it looks like it is not deploying on the
beta3 version for some reason, but I don't see any errors or attempts in
the log.  I will look at it more later, but for now I would like to try
to work around any issues with the last production release if possible.

I can now get queries and inserts to work, but am having trouble with
the updates.  It looks like it is also related to
auto-increment/generated key stuff.  Perhaps the way I'm going about it
is incorrect:

Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");
InitialContext initialContext = new InitialContext(properties);
Object object = initialContext.lookup("UserFacadeLocal");
UserFacadeLocal userFacade = (UserFacadeLocal) object;
EntityManager em = userFacade.getEntityManager();
Query query = em.createNamedQuery("User.findByUserName");
query.setParameter("userName", "admin");
User result;
try {
     result = (User) query.getSingleResult();
} catch (NoResultException e) {
     result = null;
}
result.setEmail("[hidden email]");
userFacade.edit(result);

I get the error:

"Primary key field com.iball.server.entities.User.userId of
com.iball.server.entities.User@64def7 has non-default value. The
instance life cycle is in PNewState state and hence an existing
non-default value for the identity field is not permitted. You either
need to remove the @GeneratedValue annotation or modify the code to
remove the initializer processing."

The generated value annotation present is:

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic
@Column(name = "user_id")
private Integer userId;

I also tried GenerationType.AUTO and removing the auto increment setting
on the DB but it didn't help

The userFacade.edit(result) method is calling
getEntityManager().merge(entity);



On 7/9/2012 12:11 AM, Romain Manni-Bucau wrote:

> You should at least share your logs or (better) a sample otherwise helping
> you is hard. Generally it is faster than 'trying' things.
>
> - Romun
> Le 9 juil. 2012 03:20, "David Nordahl"<[hidden email]>  a écrit :
>
>> Tried the snap shot.. I get an error in Netbeans saying that it can't
>> deploy the app and to check the server log, yet the server log has no
>> errors and shows the app deploying successfully yet I cannot open the web
>> host in the browser.  I give up... I could have written all the middle ware
>> needed for this project myself by now.  Thanks for your efforts.
>>
>> On 7/8/2012 4:56 PM, Romain Manni-Bucau wrote:
>>
>>> hmm
>>>
>>> you use tomee 1.0.0
>>>
>>> can you give it a try to the snapshot please? we worked a bit on netbeans
>>> integration.
>>>
>>> - Romain
>>>
>>>
>>> 2012/7/8 David Nordahl<[hidden email]>
>>>
>>>   Btw.. Is it normal to have these exceptions on startup?  I saw another
>>>> post saying they were, but I thought I might double check.  I seem to be
>>>> able to query through open EJB, but not update and add.  I'm also
>>>> wondering
>>>> if there is anyway that the reentrant flush error is covering up another
>>>> error.  I guess I can start working on a test case.. I wish I could just
>>>> find a netbeans JSP2.0/EJB/TomEE sample project where everything was
>>>> already setup correctly.
>>>>
>>>> SEVERE: Error in safeBind method
>>>> javax.naming.****NameNotFoundException: Name [openejb] is not bound in
>>>> this
>>>> Context. Unable to find [openejb].
>>>>       at org.apache.naming.****NamingContext.lookup(****
>>>> NamingContext.java:820)
>>>>       at org.apache.naming.****NamingContext.lookup(****
>>>> NamingContext.java:168)
>>>>       at org.apache.tomee.catalina.****TomcatWebAppBuilder.safeBind(****
>>>> TomcatWebAppBuilder.java:1196)
>>>>       at org.apache.tomee.catalina.****TomcatWebAppBuilder.****
>>>> afterStart(**
>>>> TomcatWebAppBuilder.java:776)
>>>>       at org.apache.tomee.catalina.****GlobalListenerSupport.****
>>>> lifecycleEvent(
>>>> **GlobalListenerSupport.java:****103)
>>>>       at org.apache.catalina.util.****LifecycleSupport.****
>>>> fireLifecycleEvent(**
>>>> LifecycleSupport.java:119)
>>>>       at org.apache.catalina.util.****LifecycleBase.****
>>>> fireLifecycleEvent(**
>>>> LifecycleBase.java:90)
>>>>       at org.apache.catalina.util.****LifecycleBase.****
>>>> setStateInternal(**
>>>> LifecycleBase.java:401)
>>>>       at org.apache.catalina.util.****LifecycleBase.start(**
>>>> LifecycleBase.java:168)
>>>>       at org.apache.catalina.core.****ContainerBase.****
>>>> addChildInternal(**
>>>> ContainerBase.java:895)
>>>>       at org.apache.catalina.core.****ContainerBase.addChild(**
>>>> ContainerBase.java:871)
>>>>       at org.apache.catalina.core.****StandardHost.addChild(**
>>>> StandardHost.java:615)
>>>>       at org.apache.catalina.startup.****HostConfig.deployDescriptor(**
>>>> HostConfig.java:649)
>>>>       at org.apache.catalina.startup.****HostConfig.deployApps(**
>>>> HostConfig.java:530)
>>>>       at org.apache.catalina.startup.****HostConfig.check(HostConfig.**
>>>> java:1471)
>>>>       at sun.reflect.****NativeMethodAccessorImpl.****invoke0(Native
>>>> Method)
>>>>       at sun.reflect.****NativeMethodAccessorImpl.****invoke(**
>>>> NativeMethodAccessorImpl.java:****57)
>>>>       at sun.reflect.****DelegatingMethodAccessorImpl.****invoke(**
>>>> DelegatingMethodAccessorImpl.****java:43)
>>>>       at java.lang.reflect.Method.****invoke(Method.java:601)
>>>>       at org.apache.tomcat.util.****modeler.BaseModelMBean.invoke(****
>>>> BaseModelMBean.java:301)
>>>>       at com.sun.jmx.interceptor.****DefaultMBeanServerInterceptor.**
>>>> **invoke(**
>>>> DefaultMBeanServerInterceptor.****java:819)
>>>>       at com.sun.jmx.mbeanserver.****JmxMBeanServer.invoke(**
>>>> JmxMBeanServer.java:791)
>>>>       at org.apache.catalina.manager.****ManagerServlet.check(**
>>>> ManagerServlet.java:1436)
>>>>       at org.apache.catalina.manager.****ManagerServlet.deploy(**
>>>> ManagerServlet.java:856)
>>>>       at org.apache.catalina.manager.****ManagerServlet.doGet(**
>>>> ManagerServlet.java:353)
>>>>       at javax.servlet.http.****HttpServlet.service(****
>>>> HttpServlet.java:621)
>>>>       at javax.servlet.http.****HttpServlet.service(****
>>>> HttpServlet.java:722)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.**
>>>> internalDoFilter(****ApplicationFilterChain.java:****305)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.****
>>>> doFilter(**
>>>> ApplicationFilterChain.java:****210)
>>>>       at org.apache.catalina.filters.****SetCharacterEncodingFilter.**
>>>> doFilter(****SetCharacterEncodingFilter.****java:108)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.**
>>>> internalDoFilter(****ApplicationFilterChain.java:****243)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.****
>>>> doFilter(**
>>>> ApplicationFilterChain.java:****210)
>>>>       at org.apache.catalina.core.****StandardWrapperValve.invoke(**
>>>> StandardWrapperValve.java:225)
>>>>       at org.apache.catalina.core.****StandardContextValve.invoke(**
>>>> StandardContextValve.java:169)
>>>>       at org.apache.tomee.catalina.****OpenEJBValve.invoke(**
>>>> OpenEJBValve.java:44)
>>>>       at org.apache.catalina.****authenticator.****
>>>> AuthenticatorBase.invoke(**
>>>> AuthenticatorBase.java:581)
>>>>       at org.apache.catalina.core.****StandardHostValve.invoke(**
>>>> StandardHostValve.java:168)
>>>>       at org.apache.catalina.valves.****ErrorReportValve.invoke(**
>>>> ErrorReportValve.java:98)
>>>>       at org.apache.catalina.valves.****AccessLogValve.invoke(**
>>>> AccessLogValve.java:927)
>>>>       at org.apache.catalina.core.****StandardEngineValve.invoke(**
>>>> StandardEngineValve.java:118)
>>>>       at org.apache.catalina.connector.****CoyoteAdapter.service(**
>>>> CoyoteAdapter.java:407)
>>>>       at org.apache.coyote.http11.****AbstractHttp11Processor.****
>>>> process(**
>>>> AbstractHttp11Processor.java:****999)
>>>>       at org.apache.coyote.****AbstractProtocol$****
>>>> AbstractConnectionHandler.**
>>>> process(AbstractProtocol.java:****565)
>>>>       at org.apache.tomcat.util.net.****JIoEndpoint$SocketProcessor.**
>>>> run(JIoEndpoint.java:309)
>>>>       at java.util.concurrent.****ThreadPoolExecutor.runWorker(****
>>>> ThreadPoolExecutor.java:1110)
>>>>       at java.util.concurrent.****ThreadPoolExecutor$Worker.run(****
>>>> ThreadPoolExecutor.java:603)
>>>>       at java.lang.Thread.run(Thread.****java:722)
>>>>
>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>> TomcatWebAppBuilder
>>>> safeBind
>>>> INFO: TransactionManager already bound, ignoring
>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>> TomcatWebAppBuilder
>>>> safeBind
>>>> INFO: TransactionSynchronizationRegi****stry already bound, ignoring
>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>> TomcatWebAppBuilder
>>>> safeBind
>>>> SEVERE: Error in safeBind method
>>>> javax.naming.****NameNotFoundException: No ORB registered with the
>>>> OpenEJB
>>>> system
>>>>       at org.apache.openejb.core.ivm.****naming.****
>>>> SystemComponentReference.**
>>>> getObject(****SystemComponentReference.java:****38)
>>>>       at org.apache.openejb.core.ivm.****naming.Reference.getContent(**
>>>> Reference.java:40)
>>>>       at org.apache.xbean.naming.****reference.SimpleReference$**
>>>> SimpleObjectFactory.****getObjectInstance(****SimpleReference.java:137)
>>>>       at javax.naming.spi.****NamingManager.****getObjectInstance(**
>>>> NamingManager.java:321)
>>>>       at org.apache.naming.****NamingContext.lookup(****
>>>> NamingContext.java:843)
>>>>       at org.apache.naming.****NamingContext.lookup(****
>>>> NamingContext.java:168)
>>>>       at org.apache.tomee.catalina.****TomcatWebAppBuilder.safeBind(****
>>>> TomcatWebAppBuilder.java:1196)
>>>>       at org.apache.tomee.catalina.****TomcatWebAppBuilder.****
>>>> afterStart(**
>>>> TomcatWebAppBuilder.java:806)
>>>>       at org.apache.tomee.catalina.****GlobalListenerSupport.****
>>>> lifecycleEvent(
>>>> **GlobalListenerSupport.java:****103)
>>>>       at org.apache.catalina.util.****LifecycleSupport.****
>>>> fireLifecycleEvent(**
>>>> LifecycleSupport.java:119)
>>>>       at org.apache.catalina.util.****LifecycleBase.****
>>>> fireLifecycleEvent(**
>>>> LifecycleBase.java:90)
>>>>       at org.apache.catalina.util.****LifecycleBase.****
>>>> setStateInternal(**
>>>> LifecycleBase.java:401)
>>>>       at org.apache.catalina.util.****LifecycleBase.start(**
>>>> LifecycleBase.java:168)
>>>>       at org.apache.catalina.core.****ContainerBase.****
>>>> addChildInternal(**
>>>> ContainerBase.java:895)
>>>>       at org.apache.catalina.core.****ContainerBase.addChild(**
>>>> ContainerBase.java:871)
>>>>       at org.apache.catalina.core.****StandardHost.addChild(**
>>>> StandardHost.java:615)
>>>>       at org.apache.catalina.startup.****HostConfig.deployDescriptor(**
>>>> HostConfig.java:649)
>>>>       at org.apache.catalina.startup.****HostConfig.deployApps(**
>>>> HostConfig.java:530)
>>>>       at org.apache.catalina.startup.****HostConfig.check(HostConfig.**
>>>> java:1471)
>>>>       at sun.reflect.****NativeMethodAccessorImpl.****invoke0(Native
>>>> Method)
>>>>       at sun.reflect.****NativeMethodAccessorImpl.****invoke(**
>>>> NativeMethodAccessorImpl.java:****57)
>>>>       at sun.reflect.****DelegatingMethodAccessorImpl.****invoke(**
>>>> DelegatingMethodAccessorImpl.****java:43)
>>>>       at java.lang.reflect.Method.****invoke(Method.java:601)
>>>>       at org.apache.tomcat.util.****modeler.BaseModelMBean.invoke(****
>>>> BaseModelMBean.java:301)
>>>>       at com.sun.jmx.interceptor.****DefaultMBeanServerInterceptor.**
>>>> **invoke(**
>>>> DefaultMBeanServerInterceptor.****java:819)
>>>>       at com.sun.jmx.mbeanserver.****JmxMBeanServer.invoke(**
>>>> JmxMBeanServer.java:791)
>>>>       at org.apache.catalina.manager.****ManagerServlet.check(**
>>>> ManagerServlet.java:1436)
>>>>       at org.apache.catalina.manager.****ManagerServlet.deploy(**
>>>> ManagerServlet.java:856)
>>>>       at org.apache.catalina.manager.****ManagerServlet.doGet(**
>>>> ManagerServlet.java:353)
>>>>       at javax.servlet.http.****HttpServlet.service(****
>>>> HttpServlet.java:621)
>>>>       at javax.servlet.http.****HttpServlet.service(****
>>>> HttpServlet.java:722)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.**
>>>> internalDoFilter(****ApplicationFilterChain.java:****305)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.****
>>>> doFilter(**
>>>> ApplicationFilterChain.java:****210)
>>>>       at org.apache.catalina.filters.****SetCharacterEncodingFilter.**
>>>> doFilter(****SetCharacterEncodingFilter.****java:108)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.**
>>>> internalDoFilter(****ApplicationFilterChain.java:****243)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.****
>>>> doFilter(**
>>>> ApplicationFilterChain.java:****210)
>>>>       at org.apache.catalina.core.****StandardWrapperValve.invoke(**
>>>> StandardWrapperValve.java:225)
>>>>       at org.apache.catalina.core.****StandardContextValve.invoke(**
>>>> StandardContextValve.java:169)
>>>>       at org.apache.tomee.catalina.****OpenEJBValve.invoke(**
>>>> OpenEJBValve.java:44)
>>>>       at org.apache.catalina.****authenticator.****
>>>> AuthenticatorBase.invoke(**
>>>> AuthenticatorBase.java:581)
>>>>       at org.apache.catalina.core.****StandardHostValve.invoke(**
>>>> StandardHostValve.java:168)
>>>>       at org.apache.catalina.valves.****ErrorReportValve.invoke(**
>>>> ErrorReportValve.java:98)
>>>>       at org.apache.catalina.valves.****AccessLogValve.invoke(**
>>>> AccessLogValve.java:927)
>>>>       at org.apache.catalina.core.****StandardEngineValve.invoke(**
>>>> StandardEngineValve.java:118)
>>>>       at org.apache.catalina.connector.****CoyoteAdapter.service(**
>>>> CoyoteAdapter.java:407)
>>>>       at org.apache.coyote.http11.****AbstractHttp11Processor.****
>>>> process(**
>>>> AbstractHttp11Processor.java:****999)
>>>>       at org.apache.coyote.****AbstractProtocol$****
>>>> AbstractConnectionHandler.**
>>>> process(AbstractProtocol.java:****565)
>>>>       at org.apache.tomcat.util.net.****JIoEndpoint$SocketProcessor.**
>>>> run(JIoEndpoint.java:309)
>>>>       at java.util.concurrent.****ThreadPoolExecutor.runWorker(****
>>>> ThreadPoolExecutor.java:1110)
>>>>       at java.util.concurrent.****ThreadPoolExecutor$Worker.run(****
>>>> ThreadPoolExecutor.java:603)
>>>>       at java.lang.Thread.run(Thread.****java:722)
>>>>
>>>> Jul 08, 2012 4:40:43 PM org.apache.tomee.catalina.****
>>>> TomcatWebAppBuilder
>>>> safeBind
>>>> SEVERE: Error in safeBind method
>>>> javax.naming.****NameNotFoundException: No HandleDelegate registered
>>>> with
>>>> the OpenEJB system
>>>>       at org.apache.openejb.core.ivm.****naming.****
>>>> SystemComponentReference.**
>>>> getObject(****SystemComponentReference.java:****38)
>>>>       at org.apache.openejb.core.ivm.****naming.Reference.getContent(**
>>>> Reference.java:40)
>>>>       at org.apache.xbean.naming.****reference.SimpleReference$**
>>>> SimpleObjectFactory.****getObjectInstance(****SimpleReference.java:137)
>>>>       at javax.naming.spi.****NamingManager.****getObjectInstance(**
>>>> NamingManager.java:321)
>>>>       at org.apache.naming.****NamingContext.lookup(****
>>>> NamingContext.java:843)
>>>>       at org.apache.naming.****NamingContext.lookup(****
>>>> NamingContext.java:168)
>>>>       at org.apache.tomee.catalina.****TomcatWebAppBuilder.safeBind(****
>>>> TomcatWebAppBuilder.java:1196)
>>>>       at org.apache.tomee.catalina.****TomcatWebAppBuilder.****
>>>> afterStart(**
>>>> TomcatWebAppBuilder.java:807)
>>>>       at org.apache.tomee.catalina.****GlobalListenerSupport.****
>>>> lifecycleEvent(
>>>> **GlobalListenerSupport.java:****103)
>>>>       at org.apache.catalina.util.****LifecycleSupport.****
>>>> fireLifecycleEvent(**
>>>> LifecycleSupport.java:119)
>>>>       at org.apache.catalina.util.****LifecycleBase.****
>>>> fireLifecycleEvent(**
>>>> LifecycleBase.java:90)
>>>>       at org.apache.catalina.util.****LifecycleBase.****
>>>> setStateInternal(**
>>>> LifecycleBase.java:401)
>>>>       at org.apache.catalina.util.****LifecycleBase.start(**
>>>> LifecycleBase.java:168)
>>>>       at org.apache.catalina.core.****ContainerBase.****
>>>> addChildInternal(**
>>>> ContainerBase.java:895)
>>>>       at org.apache.catalina.core.****ContainerBase.addChild(**
>>>> ContainerBase.java:871)
>>>>       at org.apache.catalina.core.****StandardHost.addChild(**
>>>> StandardHost.java:615)
>>>>       at org.apache.catalina.startup.****HostConfig.deployDescriptor(**
>>>> HostConfig.java:649)
>>>>       at org.apache.catalina.startup.****HostConfig.deployApps(**
>>>> HostConfig.java:530)
>>>>       at org.apache.catalina.startup.****HostConfig.check(HostConfig.**
>>>> java:1471)
>>>>       at sun.reflect.****NativeMethodAccessorImpl.****invoke0(Native
>>>> Method)
>>>>       at sun.reflect.****NativeMethodAccessorImpl.****invoke(**
>>>> NativeMethodAccessorImpl.java:****57)
>>>>       at sun.reflect.****DelegatingMethodAccessorImpl.****invoke(**
>>>> DelegatingMethodAccessorImpl.****java:43)
>>>>       at java.lang.reflect.Method.****invoke(Method.java:601)
>>>>       at org.apache.tomcat.util.****modeler.BaseModelMBean.invoke(****
>>>> BaseModelMBean.java:301)
>>>>       at com.sun.jmx.interceptor.****DefaultMBeanServerInterceptor.**
>>>> **invoke(**
>>>> DefaultMBeanServerInterceptor.****java:819)
>>>>       at com.sun.jmx.mbeanserver.****JmxMBeanServer.invoke(**
>>>> JmxMBeanServer.java:791)
>>>>       at org.apache.catalina.manager.****ManagerServlet.check(**
>>>> ManagerServlet.java:1436)
>>>>       at org.apache.catalina.manager.****ManagerServlet.deploy(**
>>>> ManagerServlet.java:856)
>>>>       at org.apache.catalina.manager.****ManagerServlet.doGet(**
>>>> ManagerServlet.java:353)
>>>>       at javax.servlet.http.****HttpServlet.service(****
>>>> HttpServlet.java:621)
>>>>       at javax.servlet.http.****HttpServlet.service(****
>>>> HttpServlet.java:722)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.**
>>>> internalDoFilter(****ApplicationFilterChain.java:****305)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.****
>>>> doFilter(**
>>>> ApplicationFilterChain.java:****210)
>>>>       at org.apache.catalina.filters.****SetCharacterEncodingFilter.**
>>>> doFilter(****SetCharacterEncodingFilter.****java:108)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.**
>>>> internalDoFilter(****ApplicationFilterChain.java:****243)
>>>>       at org.apache.catalina.core.****ApplicationFilterChain.****
>>>> doFilter(**
>>>> ApplicationFilterChain.java:****210)
>>>>       at org.apache.catalina.core.****StandardWrapperValve.invoke(**
>>>> StandardWrapperValve.java:225)
>>>>       at org.apache.catalina.core.****StandardContextValve.invoke(**
>>>> StandardContextValve.java:169)
>>>>       at org.apache.tomee.catalina.****OpenEJBValve.invoke(**
>>>> OpenEJBValve.java:44)
>>>>       at org.apache.catalina.****authenticator.****
>>>> AuthenticatorBase.invoke(**
>>>> AuthenticatorBase.java:581)
>>>>       at org.apache.catalina.core.****StandardHostValve.invoke(**
>>>> StandardHostValve.java:168)
>>>>       at org.apache.catalina.valves.****ErrorReportValve.invoke(**
>>>> ErrorReportValve.java:98)
>>>>       at org.apache.catalina.valves.****AccessLogValve.invoke(**
>>>> AccessLogValve.java:927)
>>>>       at org.apache.catalina.core.****StandardEngineValve.invoke(**
>>>> StandardEngineValve.java:118)
>>>>       at org.apache.catalina.connector.****CoyoteAdapter.service(**
>>>> CoyoteAdapter.java:407)
>>>>       at org.apache.coyote.http11.****AbstractHttp11Processor.****
>>>> process(**
>>>> AbstractHttp11Processor.java:****999)
>>>>       at org.apache.coyote.****AbstractProtocol$****
>>>> AbstractConnectionHandler.**
>>>> process(AbstractProtocol.java:****565)
>>>>       at org.apache.tomcat.util.net.****JIoEndpoint$SocketProcessor.**
>>>> run(JIoEndpoint.java:309)
>>>>       at java.util.concurrent.****ThreadPoolExecutor.runWorker(****
>>>> ThreadPoolExecutor.java:1110)
>>>>       at java.util.concurrent.****ThreadPoolExecutor$Worker.run(****
>>>> ThreadPoolExecutor.java:603)
>>>>       at java.lang.Thread.run(Thread.****java:722)
>>>>
>>>>
>>>>
>>>> On 7/8/2012 4:32 PM, Romain Manni-Bucau wrote:
>>>>
>>>>   i don't think so,
>>>>> can you try moving your code in a unit test to see if it still happen?
>>>>>
>>>>> - Romain
>>>>>
>>>>>
>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>
>>>>>    Could it be the Tomcat JDBCRealm I have enforcing container managed
>>>>>
>>>>>> security from user data in the same table?
>>>>>>
>>>>>>
>>>>>> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>>>>>>
>>>>>>    i can't say no but i'm pretty sure it is something in the container
>>>>>>
>>>>>>> rather
>>>>>>> in the DB.
>>>>>>>
>>>>>>> - Romain
>>>>>>>
>>>>>>>
>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>
>>>>>>>     Maybe the DB settings could have something to do with it? I'm using
>>>>>>> MySQL
>>>>>>>
>>>>>>>   with it's default setup which uses InnoDB.  I notice in the
>>>>>>>> documentation
>>>>>>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes
>>>>>>>> the
>>>>>>>> transaction log after each transaction, greatly improving
>>>>>>>> reliability."
>>>>>>>>
>>>>>>>> Could some DB setting like this be causing the issue?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>>>>>>
>>>>>>>>     can you share a small sample to reproduce it, will be easier to
>>>>>>>> help
>>>>>>>>
>>>>>>>>   you?
>>>>>>>>> - Romain
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>
>>>>>>>>>      Not that I've configured.. Unless one of the annotations creates
>>>>>>>>> one:
>>>>>>>>>
>>>>>>>>>    @Entity
>>>>>>>>>
>>>>>>>>>> @Table(name = "user")
>>>>>>>>>> @XmlRootElement
>>>>>>>>>> @NamedQueries({
>>>>>>>>>>          @NamedQuery(name = "User.findAll", query = "SELECT u FROM
>>>>>>>>>> User
>>>>>>>>>> u"),
>>>>>>>>>>          @NamedQuery(name = "User.findByUserId", query = "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User
>>>>>>>>>> u
>>>>>>>>>> WHERE u.userId = :userId"),
>>>>>>>>>>          @NamedQuery(name = "User.findByUserName", query = "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User
>>>>>>>>>> u WHERE u.userName = :userName"),
>>>>>>>>>>          @NamedQuery(name = "User.findByPassword", query = "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User
>>>>>>>>>> u WHERE u.password = :password"),
>>>>>>>>>>          @NamedQuery(name = "User.findByEmail", query = "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User u
>>>>>>>>>> WHERE u.email = :email"),
>>>>>>>>>>          @NamedQuery(name = "User.findByFirstName", query = "SELECT
>>>>>>>>>> u
>>>>>>>>>> FROM
>>>>>>>>>> User
>>>>>>>>>> u WHERE u.firstName = :firstName"),
>>>>>>>>>>          @NamedQuery(name = "User.findByLastName", query = "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User
>>>>>>>>>> u WHERE u.lastName = :lastName"),
>>>>>>>>>>          @NamedQuery(name = "User.findByLoginFailures", query =
>>>>>>>>>> "SELECT u
>>>>>>>>>> FROM
>>>>>>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>>>>>>          @NamedQuery(name = "User.findByLastLoginFailure", query =
>>>>>>>>>> "SELECT u
>>>>>>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>>>>>>> public class User implements Serializable {
>>>>>>>>>>          private static final long serialVersionUID = 1L;
>>>>>>>>>>          @Id
>>>>>>>>>>          @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>>>>>>          @Basic(optional = false)
>>>>>>>>>>          @Column(name = "user_id")
>>>>>>>>>>          private Integer userId;
>>>>>>>>>>          @Basic(optional = false)
>>>>>>>>>>          @Column(name = "user_name")
>>>>>>>>>>          private String userName;
>>>>>>>>>>          @Basic(optional = false)
>>>>>>>>>>          @Column(name = "password")
>>>>>>>>>>          private String password;
>>>>>>>>>>          @Column(name = "email")
>>>>>>>>>>          private String email;
>>>>>>>>>>          @Column(name = "first_name")
>>>>>>>>>>          private String firstName;
>>>>>>>>>>          @Column(name = "last_name")
>>>>>>>>>>          private String lastName;
>>>>>>>>>>          @Column(name = "login_failures")
>>>>>>>>>>          private Integer loginFailures;
>>>>>>>>>>          @Column(name = "last_login_failure")
>>>>>>>>>>          @Temporal(TemporalType.**********TIMESTAMP)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>          private Date lastLoginFailure;
>>>>>>>>>>          @JoinColumn(name = "associated_customer",
>>>>>>>>>> referencedColumnName =
>>>>>>>>>> "customer_id")
>>>>>>>>>>          @ManyToOne
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>>>>>>
>>>>>>>>>>      Hi,
>>>>>>>>>>
>>>>>>>>>>    any entity listener playing with id or special field on User
>>>>>>>>>> entity?
>>>>>>>>>>
>>>>>>>>>>> - Romain
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>>
>>>>>>>>>>>       I'm attempting the code:
>>>>>>>>>>>
>>>>>>>>>>>     Properties properties = new Properties();
>>>>>>>>>>>
>>>>>>>>>>>   properties.setProperty(************Context.INITIAL_CONTEXT_*****
>>>>>>>>>>>> ****
>>>>>>>>>>>> ***
>>>>>>>>>>>> FACTORY,
>>>>>>>>>>>> "org.apache.openejb.client.**************
>>>>>>>>>>>> LocalInitialContextFactory"**)****;
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>>>>>>>> Object object = initialContext.lookup("***********
>>>>>>>>>>>> *UserFacadeLocal");
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>>>>>>> User newuser = new User();
>>>>>>>>>>>> newuser.setEmail("[hidden email]"************);
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> newuser.setUserName("steve");
>>>>>>>>>>>> newuser.setPassword("cows");
>>>>>>>>>>>> userFacade.create(newuser);
>>>>>>>>>>>>
>>>>>>>>>>>> but keep getting "org.apache.openjpa.************
>>>>>>>>>>>> persistence.****
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> InvalidStateException:
>>>>>>>>>>>>
>>>>>>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>>>>>>> callback
>>>>>>>>>>>> methods or event listeners do not invoke any operations that
>>>>>>>>>>>> require
>>>>>>>>>>>> the
>>>>>>>>>>>> in-progress flush to complete."
>>>>>>>>>>>>
>>>>>>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to see
>>>>>>>>>>>> if
>>>>>>>>>>>> I
>>>>>>>>>>>> can
>>>>>>>>>>>> get the error to go away, but it makes no difference.  I can't
>>>>>>>>>>>> find a
>>>>>>>>>>>> flush() call in my project and according to the table in the
>>>>>>>>>>>> docs,
>>>>>>>>>>>> flush
>>>>>>>>>>>> is
>>>>>>>>>>>> not called if this parameter is set.  What am I not doing
>>>>>>>>>>>> correctly
>>>>>>>>>>>> here?
>>>>>>>>>>>>
>>>>>>>>>>>> Thank you,
>>>>>>>>>>>> David
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush - Trouble with merge / update

Romain Manni-Bucau
maybe try a find in your ejb before the merge to let you rentity be managed
and to be allowed to merge.

FYI the snapshot is not the beta-3 but the 1.1.0-SNAPSHOT.

- Romain


2012/7/9 David Nordahl <[hidden email]>

> I looked at it again today, and it looks like it is not deploying on the
> beta3 version for some reason, but I don't see any errors or attempts in
> the log.  I will look at it more later, but for now I would like to try to
> work around any issues with the last production release if possible.
>
> I can now get queries and inserts to work, but am having trouble with the
> updates.  It looks like it is also related to auto-increment/generated key
> stuff.  Perhaps the way I'm going about it is incorrect:
>
> Properties properties = new Properties();
> properties.setProperty(**Context.INITIAL_CONTEXT_**FACTORY,
> "org.apache.openejb.client.**LocalInitialContextFactory");
> InitialContext initialContext = new InitialContext(properties);
> Object object = initialContext.lookup("**UserFacadeLocal");
> UserFacadeLocal userFacade = (UserFacadeLocal) object;
> EntityManager em = userFacade.getEntityManager();
> Query query = em.createNamedQuery("User.**findByUserName");
> query.setParameter("userName", "admin");
> User result;
> try {
>     result = (User) query.getSingleResult();
> } catch (NoResultException e) {
>     result = null;
> }
> result.setEmail("[hidden email]**");
> userFacade.edit(result);
>
> I get the error:
>
> "Primary key field com.iball.server.entities.**User.userId of
> com.iball.server.entities.**User@64def7 has non-default value. The
> instance life cycle is in PNewState state and hence an existing non-default
> value for the identity field is not permitted. You either need to remove
> the @GeneratedValue annotation or modify the code to remove the initializer
> processing."
>
> The generated value annotation present is:
>
> @Id
> @GeneratedValue(strategy = GenerationType.IDENTITY)
> @Basic
> @Column(name = "user_id")
> private Integer userId;
>
> I also tried GenerationType.AUTO and removing the auto increment setting
> on the DB but it didn't help
>
> The userFacade.edit(result) method is calling getEntityManager().merge(**
> entity);
>
>
>
> On 7/9/2012 12:11 AM, Romain Manni-Bucau wrote:
>
>> You should at least share your logs or (better) a sample otherwise helping
>> you is hard. Generally it is faster than 'trying' things.
>>
>> - Romun
>> Le 9 juil. 2012 03:20, "David Nordahl"<[hidden email]>  a écrit :
>>
>>  Tried the snap shot.. I get an error in Netbeans saying that it can't
>>> deploy the app and to check the server log, yet the server log has no
>>> errors and shows the app deploying successfully yet I cannot open the web
>>> host in the browser.  I give up... I could have written all the middle
>>> ware
>>> needed for this project myself by now.  Thanks for your efforts.
>>>
>>> On 7/8/2012 4:56 PM, Romain Manni-Bucau wrote:
>>>
>>>  hmm
>>>>
>>>> you use tomee 1.0.0
>>>>
>>>> can you give it a try to the snapshot please? we worked a bit on
>>>> netbeans
>>>> integration.
>>>>
>>>> - Romain
>>>>
>>>>
>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>
>>>>   Btw.. Is it normal to have these exceptions on startup?  I saw another
>>>>
>>>>> post saying they were, but I thought I might double check.  I seem to
>>>>> be
>>>>> able to query through open EJB, but not update and add.  I'm also
>>>>> wondering
>>>>> if there is anyway that the reentrant flush error is covering up
>>>>> another
>>>>> error.  I guess I can start working on a test case.. I wish I could
>>>>> just
>>>>> find a netbeans JSP2.0/EJB/TomEE sample project where everything was
>>>>> already setup correctly.
>>>>>
>>>>> SEVERE: Error in safeBind method
>>>>> javax.naming.******NameNotFoundException: Name [openejb] is not bound
>>>>> in
>>>>> this
>>>>> Context. Unable to find [openejb].
>>>>>       at org.apache.naming.******NamingContext.lookup(****
>>>>> NamingContext.java:820)
>>>>>       at org.apache.naming.******NamingContext.lookup(****
>>>>> NamingContext.java:168)
>>>>>       at org.apache.tomee.catalina.******
>>>>> TomcatWebAppBuilder.safeBind(******
>>>>> TomcatWebAppBuilder.java:1196)
>>>>>       at org.apache.tomee.catalina.******TomcatWebAppBuilder.****
>>>>> afterStart(**
>>>>> TomcatWebAppBuilder.java:776)
>>>>>       at org.apache.tomee.catalina.******GlobalListenerSupport.****
>>>>> lifecycleEvent(
>>>>> **GlobalListenerSupport.java:******103)
>>>>>       at org.apache.catalina.util.******LifecycleSupport.****
>>>>> fireLifecycleEvent(**
>>>>> LifecycleSupport.java:119)
>>>>>       at org.apache.catalina.util.******LifecycleBase.****
>>>>> fireLifecycleEvent(**
>>>>> LifecycleBase.java:90)
>>>>>       at org.apache.catalina.util.******LifecycleBase.****
>>>>> setStateInternal(**
>>>>> LifecycleBase.java:401)
>>>>>       at org.apache.catalina.util.******LifecycleBase.start(**
>>>>> LifecycleBase.java:168)
>>>>>       at org.apache.catalina.core.******ContainerBase.****
>>>>> addChildInternal(**
>>>>> ContainerBase.java:895)
>>>>>       at org.apache.catalina.core.******ContainerBase.addChild(**
>>>>> ContainerBase.java:871)
>>>>>       at org.apache.catalina.core.******StandardHost.addChild(**
>>>>> StandardHost.java:615)
>>>>>       at org.apache.catalina.startup.****
>>>>> **HostConfig.deployDescriptor(****
>>>>> HostConfig.java:649)
>>>>>       at org.apache.catalina.startup.******HostConfig.deployApps(**
>>>>> HostConfig.java:530)
>>>>>       at org.apache.catalina.startup.****
>>>>> **HostConfig.check(HostConfig.****
>>>>> java:1471)
>>>>>       at sun.reflect.******NativeMethodAccessorImpl.******
>>>>> invoke0(Native
>>>>> Method)
>>>>>       at sun.reflect.******NativeMethodAccessorImpl.******invoke(**
>>>>> NativeMethodAccessorImpl.java:******57)
>>>>>       at sun.reflect.******DelegatingMethodAccessorImpl.***
>>>>> ***invoke(**
>>>>> DelegatingMethodAccessorImpl.******java:43)
>>>>>       at java.lang.reflect.Method.******invoke(Method.java:601)
>>>>>       at org.apache.tomcat.util.******modeler.BaseModelMBean.invoke(**
>>>>> ****
>>>>> BaseModelMBean.java:301)
>>>>>       at com.sun.jmx.interceptor.******DefaultMBeanServerInterceptor.*
>>>>> ***
>>>>> **invoke(**
>>>>> DefaultMBeanServerInterceptor.******java:819)
>>>>>       at com.sun.jmx.mbeanserver.******JmxMBeanServer.invoke(**
>>>>> JmxMBeanServer.java:791)
>>>>>       at org.apache.catalina.manager.******ManagerServlet.check(**
>>>>> ManagerServlet.java:1436)
>>>>>       at org.apache.catalina.manager.******ManagerServlet.deploy(**
>>>>> ManagerServlet.java:856)
>>>>>       at org.apache.catalina.manager.******ManagerServlet.doGet(**
>>>>> ManagerServlet.java:353)
>>>>>       at javax.servlet.http.******HttpServlet.service(****
>>>>> HttpServlet.java:621)
>>>>>       at javax.servlet.http.******HttpServlet.service(****
>>>>> HttpServlet.java:722)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>> internalDoFilter(******ApplicationFilterChain.java:******305)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>> doFilter(**
>>>>> ApplicationFilterChain.java:******210)
>>>>>       at org.apache.catalina.filters.****
>>>>> **SetCharacterEncodingFilter.****
>>>>> doFilter(******SetCharacterEncodingFilter.******java:108)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>> internalDoFilter(******ApplicationFilterChain.java:******243)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>> doFilter(**
>>>>> ApplicationFilterChain.java:******210)
>>>>>       at org.apache.catalina.core.******StandardWrapperValve.invoke(**
>>>>> StandardWrapperValve.java:225)
>>>>>       at org.apache.catalina.core.******StandardContextValve.invoke(**
>>>>> StandardContextValve.java:169)
>>>>>       at org.apache.tomee.catalina.******OpenEJBValve.invoke(**
>>>>> OpenEJBValve.java:44)
>>>>>       at org.apache.catalina.******authenticator.****
>>>>> AuthenticatorBase.invoke(**
>>>>> AuthenticatorBase.java:581)
>>>>>       at org.apache.catalina.core.******StandardHostValve.invoke(**
>>>>> StandardHostValve.java:168)
>>>>>       at org.apache.catalina.valves.******ErrorReportValve.invoke(**
>>>>> ErrorReportValve.java:98)
>>>>>       at org.apache.catalina.valves.******AccessLogValve.invoke(**
>>>>> AccessLogValve.java:927)
>>>>>       at org.apache.catalina.core.******StandardEngineValve.invoke(**
>>>>> StandardEngineValve.java:118)
>>>>>       at org.apache.catalina.connector.******CoyoteAdapter.service(**
>>>>> CoyoteAdapter.java:407)
>>>>>       at org.apache.coyote.http11.******AbstractHttp11Processor.****
>>>>> process(**
>>>>> AbstractHttp11Processor.java:******999)
>>>>>       at org.apache.coyote.******AbstractProtocol$****
>>>>> AbstractConnectionHandler.**
>>>>> process(AbstractProtocol.java:******565)
>>>>>       at org.apache.tomcat.util.net.*****
>>>>> *JIoEndpoint$SocketProcessor.****
>>>>> run(JIoEndpoint.java:309)
>>>>>       at java.util.concurrent.******ThreadPoolExecutor.runWorker(***
>>>>> ***
>>>>> ThreadPoolExecutor.java:1110)
>>>>>       at java.util.concurrent.******ThreadPoolExecutor$Worker.run(**
>>>>> ****
>>>>> ThreadPoolExecutor.java:603)
>>>>>       at java.lang.Thread.run(Thread.******java:722)
>>>>>
>>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>>> TomcatWebAppBuilder
>>>>> safeBind
>>>>> INFO: TransactionManager already bound, ignoring
>>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>>> TomcatWebAppBuilder
>>>>> safeBind
>>>>> INFO: TransactionSynchronizationRegi******stry already bound, ignoring
>>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>>> TomcatWebAppBuilder
>>>>> safeBind
>>>>> SEVERE: Error in safeBind method
>>>>> javax.naming.******NameNotFoundException: No ORB registered with the
>>>>> OpenEJB
>>>>> system
>>>>>       at org.apache.openejb.core.ivm.******naming.****
>>>>> SystemComponentReference.**
>>>>> getObject(******SystemComponentReference.java:******38)
>>>>>       at org.apache.openejb.core.ivm.****
>>>>> **naming.Reference.getContent(****
>>>>> Reference.java:40)
>>>>>       at org.apache.xbean.naming.******reference.SimpleReference$**
>>>>> SimpleObjectFactory.******getObjectInstance(******
>>>>> SimpleReference.java:137)
>>>>>       at javax.naming.spi.******NamingManager.******
>>>>> getObjectInstance(**
>>>>> NamingManager.java:321)
>>>>>       at org.apache.naming.******NamingContext.lookup(****
>>>>> NamingContext.java:843)
>>>>>       at org.apache.naming.******NamingContext.lookup(****
>>>>> NamingContext.java:168)
>>>>>       at org.apache.tomee.catalina.******
>>>>> TomcatWebAppBuilder.safeBind(******
>>>>> TomcatWebAppBuilder.java:1196)
>>>>>       at org.apache.tomee.catalina.******TomcatWebAppBuilder.****
>>>>> afterStart(**
>>>>> TomcatWebAppBuilder.java:806)
>>>>>       at org.apache.tomee.catalina.******GlobalListenerSupport.****
>>>>> lifecycleEvent(
>>>>> **GlobalListenerSupport.java:******103)
>>>>>       at org.apache.catalina.util.******LifecycleSupport.****
>>>>> fireLifecycleEvent(**
>>>>> LifecycleSupport.java:119)
>>>>>       at org.apache.catalina.util.******LifecycleBase.****
>>>>> fireLifecycleEvent(**
>>>>> LifecycleBase.java:90)
>>>>>       at org.apache.catalina.util.******LifecycleBase.****
>>>>> setStateInternal(**
>>>>> LifecycleBase.java:401)
>>>>>       at org.apache.catalina.util.******LifecycleBase.start(**
>>>>> LifecycleBase.java:168)
>>>>>       at org.apache.catalina.core.******ContainerBase.****
>>>>> addChildInternal(**
>>>>> ContainerBase.java:895)
>>>>>       at org.apache.catalina.core.******ContainerBase.addChild(**
>>>>> ContainerBase.java:871)
>>>>>       at org.apache.catalina.core.******StandardHost.addChild(**
>>>>> StandardHost.java:615)
>>>>>       at org.apache.catalina.startup.****
>>>>> **HostConfig.deployDescriptor(****
>>>>> HostConfig.java:649)
>>>>>       at org.apache.catalina.startup.******HostConfig.deployApps(**
>>>>> HostConfig.java:530)
>>>>>       at org.apache.catalina.startup.****
>>>>> **HostConfig.check(HostConfig.****
>>>>> java:1471)
>>>>>       at sun.reflect.******NativeMethodAccessorImpl.******
>>>>> invoke0(Native
>>>>> Method)
>>>>>       at sun.reflect.******NativeMethodAccessorImpl.******invoke(**
>>>>> NativeMethodAccessorImpl.java:******57)
>>>>>       at sun.reflect.******DelegatingMethodAccessorImpl.***
>>>>> ***invoke(**
>>>>> DelegatingMethodAccessorImpl.******java:43)
>>>>>       at java.lang.reflect.Method.******invoke(Method.java:601)
>>>>>       at org.apache.tomcat.util.******modeler.BaseModelMBean.invoke(**
>>>>> ****
>>>>> BaseModelMBean.java:301)
>>>>>       at com.sun.jmx.interceptor.******DefaultMBeanServerInterceptor.*
>>>>> ***
>>>>> **invoke(**
>>>>> DefaultMBeanServerInterceptor.******java:819)
>>>>>       at com.sun.jmx.mbeanserver.******JmxMBeanServer.invoke(**
>>>>> JmxMBeanServer.java:791)
>>>>>       at org.apache.catalina.manager.******ManagerServlet.check(**
>>>>> ManagerServlet.java:1436)
>>>>>       at org.apache.catalina.manager.******ManagerServlet.deploy(**
>>>>> ManagerServlet.java:856)
>>>>>       at org.apache.catalina.manager.******ManagerServlet.doGet(**
>>>>> ManagerServlet.java:353)
>>>>>       at javax.servlet.http.******HttpServlet.service(****
>>>>> HttpServlet.java:621)
>>>>>       at javax.servlet.http.******HttpServlet.service(****
>>>>> HttpServlet.java:722)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>> internalDoFilter(******ApplicationFilterChain.java:******305)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>> doFilter(**
>>>>> ApplicationFilterChain.java:******210)
>>>>>       at org.apache.catalina.filters.****
>>>>> **SetCharacterEncodingFilter.****
>>>>> doFilter(******SetCharacterEncodingFilter.******java:108)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>> internalDoFilter(******ApplicationFilterChain.java:******243)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>> doFilter(**
>>>>> ApplicationFilterChain.java:******210)
>>>>>       at org.apache.catalina.core.******StandardWrapperValve.invoke(**
>>>>> StandardWrapperValve.java:225)
>>>>>       at org.apache.catalina.core.******StandardContextValve.invoke(**
>>>>> StandardContextValve.java:169)
>>>>>       at org.apache.tomee.catalina.******OpenEJBValve.invoke(**
>>>>> OpenEJBValve.java:44)
>>>>>       at org.apache.catalina.******authenticator.****
>>>>> AuthenticatorBase.invoke(**
>>>>> AuthenticatorBase.java:581)
>>>>>       at org.apache.catalina.core.******StandardHostValve.invoke(**
>>>>> StandardHostValve.java:168)
>>>>>       at org.apache.catalina.valves.******ErrorReportValve.invoke(**
>>>>> ErrorReportValve.java:98)
>>>>>       at org.apache.catalina.valves.******AccessLogValve.invoke(**
>>>>> AccessLogValve.java:927)
>>>>>       at org.apache.catalina.core.******StandardEngineValve.invoke(**
>>>>> StandardEngineValve.java:118)
>>>>>       at org.apache.catalina.connector.******CoyoteAdapter.service(**
>>>>> CoyoteAdapter.java:407)
>>>>>       at org.apache.coyote.http11.******AbstractHttp11Processor.****
>>>>> process(**
>>>>> AbstractHttp11Processor.java:******999)
>>>>>       at org.apache.coyote.******AbstractProtocol$****
>>>>> AbstractConnectionHandler.**
>>>>> process(AbstractProtocol.java:******565)
>>>>>       at org.apache.tomcat.util.net.*****
>>>>> *JIoEndpoint$SocketProcessor.****
>>>>> run(JIoEndpoint.java:309)
>>>>>       at java.util.concurrent.******ThreadPoolExecutor.runWorker(***
>>>>> ***
>>>>> ThreadPoolExecutor.java:1110)
>>>>>       at java.util.concurrent.******ThreadPoolExecutor$Worker.run(**
>>>>> ****
>>>>> ThreadPoolExecutor.java:603)
>>>>>       at java.lang.Thread.run(Thread.******java:722)
>>>>>
>>>>> Jul 08, 2012 4:40:43 PM org.apache.tomee.catalina.****
>>>>> TomcatWebAppBuilder
>>>>> safeBind
>>>>> SEVERE: Error in safeBind method
>>>>> javax.naming.******NameNotFoundException: No HandleDelegate registered
>>>>> with
>>>>> the OpenEJB system
>>>>>       at org.apache.openejb.core.ivm.******naming.****
>>>>> SystemComponentReference.**
>>>>> getObject(******SystemComponentReference.java:******38)
>>>>>       at org.apache.openejb.core.ivm.****
>>>>> **naming.Reference.getContent(****
>>>>> Reference.java:40)
>>>>>       at org.apache.xbean.naming.******reference.SimpleReference$**
>>>>> SimpleObjectFactory.******getObjectInstance(******
>>>>> SimpleReference.java:137)
>>>>>       at javax.naming.spi.******NamingManager.******
>>>>> getObjectInstance(**
>>>>> NamingManager.java:321)
>>>>>       at org.apache.naming.******NamingContext.lookup(****
>>>>> NamingContext.java:843)
>>>>>       at org.apache.naming.******NamingContext.lookup(****
>>>>> NamingContext.java:168)
>>>>>       at org.apache.tomee.catalina.******
>>>>> TomcatWebAppBuilder.safeBind(******
>>>>> TomcatWebAppBuilder.java:1196)
>>>>>       at org.apache.tomee.catalina.******TomcatWebAppBuilder.****
>>>>> afterStart(**
>>>>> TomcatWebAppBuilder.java:807)
>>>>>       at org.apache.tomee.catalina.******GlobalListenerSupport.****
>>>>> lifecycleEvent(
>>>>> **GlobalListenerSupport.java:******103)
>>>>>       at org.apache.catalina.util.******LifecycleSupport.****
>>>>> fireLifecycleEvent(**
>>>>> LifecycleSupport.java:119)
>>>>>       at org.apache.catalina.util.******LifecycleBase.****
>>>>> fireLifecycleEvent(**
>>>>> LifecycleBase.java:90)
>>>>>       at org.apache.catalina.util.******LifecycleBase.****
>>>>> setStateInternal(**
>>>>> LifecycleBase.java:401)
>>>>>       at org.apache.catalina.util.******LifecycleBase.start(**
>>>>> LifecycleBase.java:168)
>>>>>       at org.apache.catalina.core.******ContainerBase.****
>>>>> addChildInternal(**
>>>>> ContainerBase.java:895)
>>>>>       at org.apache.catalina.core.******ContainerBase.addChild(**
>>>>> ContainerBase.java:871)
>>>>>       at org.apache.catalina.core.******StandardHost.addChild(**
>>>>> StandardHost.java:615)
>>>>>       at org.apache.catalina.startup.****
>>>>> **HostConfig.deployDescriptor(****
>>>>> HostConfig.java:649)
>>>>>       at org.apache.catalina.startup.******HostConfig.deployApps(**
>>>>> HostConfig.java:530)
>>>>>       at org.apache.catalina.startup.****
>>>>> **HostConfig.check(HostConfig.****
>>>>> java:1471)
>>>>>       at sun.reflect.******NativeMethodAccessorImpl.******
>>>>> invoke0(Native
>>>>> Method)
>>>>>       at sun.reflect.******NativeMethodAccessorImpl.******invoke(**
>>>>> NativeMethodAccessorImpl.java:******57)
>>>>>       at sun.reflect.******DelegatingMethodAccessorImpl.***
>>>>> ***invoke(**
>>>>> DelegatingMethodAccessorImpl.******java:43)
>>>>>       at java.lang.reflect.Method.******invoke(Method.java:601)
>>>>>       at org.apache.tomcat.util.******modeler.BaseModelMBean.invoke(**
>>>>> ****
>>>>> BaseModelMBean.java:301)
>>>>>       at com.sun.jmx.interceptor.******DefaultMBeanServerInterceptor.*
>>>>> ***
>>>>> **invoke(**
>>>>> DefaultMBeanServerInterceptor.******java:819)
>>>>>       at com.sun.jmx.mbeanserver.******JmxMBeanServer.invoke(**
>>>>> JmxMBeanServer.java:791)
>>>>>       at org.apache.catalina.manager.******ManagerServlet.check(**
>>>>> ManagerServlet.java:1436)
>>>>>       at org.apache.catalina.manager.******ManagerServlet.deploy(**
>>>>> ManagerServlet.java:856)
>>>>>       at org.apache.catalina.manager.******ManagerServlet.doGet(**
>>>>> ManagerServlet.java:353)
>>>>>       at javax.servlet.http.******HttpServlet.service(****
>>>>> HttpServlet.java:621)
>>>>>       at javax.servlet.http.******HttpServlet.service(****
>>>>> HttpServlet.java:722)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>> internalDoFilter(******ApplicationFilterChain.java:******305)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>> doFilter(**
>>>>> ApplicationFilterChain.java:******210)
>>>>>       at org.apache.catalina.filters.****
>>>>> **SetCharacterEncodingFilter.****
>>>>> doFilter(******SetCharacterEncodingFilter.******java:108)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>> internalDoFilter(******ApplicationFilterChain.java:******243)
>>>>>       at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>> doFilter(**
>>>>> ApplicationFilterChain.java:******210)
>>>>>       at org.apache.catalina.core.******StandardWrapperValve.invoke(**
>>>>> StandardWrapperValve.java:225)
>>>>>       at org.apache.catalina.core.******StandardContextValve.invoke(**
>>>>> StandardContextValve.java:169)
>>>>>       at org.apache.tomee.catalina.******OpenEJBValve.invoke(**
>>>>> OpenEJBValve.java:44)
>>>>>       at org.apache.catalina.******authenticator.****
>>>>> AuthenticatorBase.invoke(**
>>>>> AuthenticatorBase.java:581)
>>>>>       at org.apache.catalina.core.******StandardHostValve.invoke(**
>>>>> StandardHostValve.java:168)
>>>>>       at org.apache.catalina.valves.******ErrorReportValve.invoke(**
>>>>> ErrorReportValve.java:98)
>>>>>       at org.apache.catalina.valves.******AccessLogValve.invoke(**
>>>>> AccessLogValve.java:927)
>>>>>       at org.apache.catalina.core.******StandardEngineValve.invoke(**
>>>>> StandardEngineValve.java:118)
>>>>>       at org.apache.catalina.connector.******CoyoteAdapter.service(**
>>>>> CoyoteAdapter.java:407)
>>>>>       at org.apache.coyote.http11.******AbstractHttp11Processor.****
>>>>> process(**
>>>>> AbstractHttp11Processor.java:******999)
>>>>>       at org.apache.coyote.******AbstractProtocol$****
>>>>> AbstractConnectionHandler.**
>>>>> process(AbstractProtocol.java:******565)
>>>>>       at org.apache.tomcat.util.net.*****
>>>>> *JIoEndpoint$SocketProcessor.****
>>>>> run(JIoEndpoint.java:309)
>>>>>       at java.util.concurrent.******ThreadPoolExecutor.runWorker(***
>>>>> ***
>>>>> ThreadPoolExecutor.java:1110)
>>>>>       at java.util.concurrent.******ThreadPoolExecutor$Worker.run(**
>>>>> ****
>>>>> ThreadPoolExecutor.java:603)
>>>>>       at java.lang.Thread.run(Thread.******java:722)
>>>>>
>>>>>
>>>>>
>>>>> On 7/8/2012 4:32 PM, Romain Manni-Bucau wrote:
>>>>>
>>>>>   i don't think so,
>>>>>
>>>>>> can you try moving your code in a unit test to see if it still happen?
>>>>>>
>>>>>> - Romain
>>>>>>
>>>>>>
>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>
>>>>>>    Could it be the Tomcat JDBCRealm I have enforcing container managed
>>>>>>
>>>>>>  security from user data in the same table?
>>>>>>>
>>>>>>>
>>>>>>> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>>>>>>>
>>>>>>>    i can't say no but i'm pretty sure it is something in the
>>>>>>> container
>>>>>>>
>>>>>>>  rather
>>>>>>>> in the DB.
>>>>>>>>
>>>>>>>> - Romain
>>>>>>>>
>>>>>>>>
>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>
>>>>>>>>     Maybe the DB settings could have something to do with it? I'm
>>>>>>>> using
>>>>>>>> MySQL
>>>>>>>>
>>>>>>>>   with it's default setup which uses InnoDB.  I notice in the
>>>>>>>>
>>>>>>>>> documentation
>>>>>>>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes
>>>>>>>>> the
>>>>>>>>> transaction log after each transaction, greatly improving
>>>>>>>>> reliability."
>>>>>>>>>
>>>>>>>>> Could some DB setting like this be causing the issue?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>>>>>>>
>>>>>>>>>     can you share a small sample to reproduce it, will be easier to
>>>>>>>>> help
>>>>>>>>>
>>>>>>>>>   you?
>>>>>>>>>
>>>>>>>>>> - Romain
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>
>>>>>>>>>>      Not that I've configured.. Unless one of the annotations
>>>>>>>>>> creates
>>>>>>>>>> one:
>>>>>>>>>>
>>>>>>>>>>    @Entity
>>>>>>>>>>
>>>>>>>>>>  @Table(name = "user")
>>>>>>>>>>> @XmlRootElement
>>>>>>>>>>> @NamedQueries({
>>>>>>>>>>>          @NamedQuery(name = "User.findAll", query = "SELECT u
>>>>>>>>>>> FROM
>>>>>>>>>>> User
>>>>>>>>>>> u"),
>>>>>>>>>>>          @NamedQuery(name = "User.findByUserId", query = "SELECT
>>>>>>>>>>> u
>>>>>>>>>>> FROM
>>>>>>>>>>> User
>>>>>>>>>>> u
>>>>>>>>>>> WHERE u.userId = :userId"),
>>>>>>>>>>>          @NamedQuery(name = "User.findByUserName", query =
>>>>>>>>>>> "SELECT u
>>>>>>>>>>> FROM
>>>>>>>>>>> User
>>>>>>>>>>> u WHERE u.userName = :userName"),
>>>>>>>>>>>          @NamedQuery(name = "User.findByPassword", query =
>>>>>>>>>>> "SELECT u
>>>>>>>>>>> FROM
>>>>>>>>>>> User
>>>>>>>>>>> u WHERE u.password = :password"),
>>>>>>>>>>>          @NamedQuery(name = "User.findByEmail", query = "SELECT u
>>>>>>>>>>> FROM
>>>>>>>>>>> User u
>>>>>>>>>>> WHERE u.email = :email"),
>>>>>>>>>>>          @NamedQuery(name = "User.findByFirstName", query =
>>>>>>>>>>> "SELECT
>>>>>>>>>>> u
>>>>>>>>>>> FROM
>>>>>>>>>>> User
>>>>>>>>>>> u WHERE u.firstName = :firstName"),
>>>>>>>>>>>          @NamedQuery(name = "User.findByLastName", query =
>>>>>>>>>>> "SELECT u
>>>>>>>>>>> FROM
>>>>>>>>>>> User
>>>>>>>>>>> u WHERE u.lastName = :lastName"),
>>>>>>>>>>>          @NamedQuery(name = "User.findByLoginFailures", query =
>>>>>>>>>>> "SELECT u
>>>>>>>>>>> FROM
>>>>>>>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>>>>>>>          @NamedQuery(name = "User.findByLastLoginFailure", query
>>>>>>>>>>> =
>>>>>>>>>>> "SELECT u
>>>>>>>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>>>>>>>> public class User implements Serializable {
>>>>>>>>>>>          private static final long serialVersionUID = 1L;
>>>>>>>>>>>          @Id
>>>>>>>>>>>          @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>>>>>>>          @Basic(optional = false)
>>>>>>>>>>>          @Column(name = "user_id")
>>>>>>>>>>>          private Integer userId;
>>>>>>>>>>>          @Basic(optional = false)
>>>>>>>>>>>          @Column(name = "user_name")
>>>>>>>>>>>          private String userName;
>>>>>>>>>>>          @Basic(optional = false)
>>>>>>>>>>>          @Column(name = "password")
>>>>>>>>>>>          private String password;
>>>>>>>>>>>          @Column(name = "email")
>>>>>>>>>>>          private String email;
>>>>>>>>>>>          @Column(name = "first_name")
>>>>>>>>>>>          private String firstName;
>>>>>>>>>>>          @Column(name = "last_name")
>>>>>>>>>>>          private String lastName;
>>>>>>>>>>>          @Column(name = "login_failures")
>>>>>>>>>>>          private Integer loginFailures;
>>>>>>>>>>>          @Column(name = "last_login_failure")
>>>>>>>>>>>          @Temporal(TemporalType.************TIMESTAMP)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>          private Date lastLoginFailure;
>>>>>>>>>>>          @JoinColumn(name = "associated_customer",
>>>>>>>>>>> referencedColumnName =
>>>>>>>>>>> "customer_id")
>>>>>>>>>>>          @ManyToOne
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>>>>>>>
>>>>>>>>>>>      Hi,
>>>>>>>>>>>
>>>>>>>>>>>    any entity listener playing with id or special field on User
>>>>>>>>>>> entity?
>>>>>>>>>>>
>>>>>>>>>>>  - Romain
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>>>
>>>>>>>>>>>>       I'm attempting the code:
>>>>>>>>>>>>
>>>>>>>>>>>>     Properties properties = new Properties();
>>>>>>>>>>>>
>>>>>>>>>>>>   properties.setProperty(*********
>>>>>>>>>>>> *****Context.INITIAL_CONTEXT_*******
>>>>>>>>>>>>
>>>>>>>>>>>>> ****
>>>>>>>>>>>>> ***
>>>>>>>>>>>>> FACTORY,
>>>>>>>>>>>>> "org.apache.openejb.client.****************
>>>>>>>>>>>>> LocalInitialContextFactory"**)******;
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>>>>>>>>> Object object = initialContext.lookup("*************
>>>>>>>>>>>>> *UserFacadeLocal");
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>>>>>>>> User newuser = new User();
>>>>>>>>>>>>> newuser.setEmail("[hidden email]"**************);
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> newuser.setUserName("steve");
>>>>>>>>>>>>> newuser.setPassword("cows");
>>>>>>>>>>>>> userFacade.create(newuser);
>>>>>>>>>>>>>
>>>>>>>>>>>>> but keep getting "org.apache.openjpa.**************
>>>>>>>>>>>>> persistence.****
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> InvalidStateException:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>>>>>>>> callback
>>>>>>>>>>>>> methods or event listeners do not invoke any operations that
>>>>>>>>>>>>> require
>>>>>>>>>>>>> the
>>>>>>>>>>>>> in-progress flush to complete."
>>>>>>>>>>>>>
>>>>>>>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to
>>>>>>>>>>>>> see
>>>>>>>>>>>>> if
>>>>>>>>>>>>> I
>>>>>>>>>>>>> can
>>>>>>>>>>>>> get the error to go away, but it makes no difference.  I can't
>>>>>>>>>>>>> find a
>>>>>>>>>>>>> flush() call in my project and according to the table in the
>>>>>>>>>>>>> docs,
>>>>>>>>>>>>> flush
>>>>>>>>>>>>> is
>>>>>>>>>>>>> not called if this parameter is set.  What am I not doing
>>>>>>>>>>>>> correctly
>>>>>>>>>>>>> here?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thank you,
>>>>>>>>>>>>> David
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush - Trouble with merge / update

slimsalmon
I got it running on the snap shot version, and that did away with those
four startup exceptions.  I still get the error below though.. Is this
added line to get the email address what you mean by doing a find on the
ejb?

String currentEmail = result.getEmail();
result.setEmail("[hidden email]");
userFacade.edit(result);



On 7/9/2012 12:15 PM, Romain Manni-Bucau wrote:

> maybe try a find in your ejb before the merge to let you rentity be managed
> and to be allowed to merge.
>
> FYI the snapshot is not the beta-3 but the 1.1.0-SNAPSHOT.
>
> - Romain
>
>
> 2012/7/9 David Nordahl<[hidden email]>
>
>> I looked at it again today, and it looks like it is not deploying on the
>> beta3 version for some reason, but I don't see any errors or attempts in
>> the log.  I will look at it more later, but for now I would like to try to
>> work around any issues with the last production release if possible.
>>
>> I can now get queries and inserts to work, but am having trouble with the
>> updates.  It looks like it is also related to auto-increment/generated key
>> stuff.  Perhaps the way I'm going about it is incorrect:
>>
>> Properties properties = new Properties();
>> properties.setProperty(**Context.INITIAL_CONTEXT_**FACTORY,
>> "org.apache.openejb.client.**LocalInitialContextFactory");
>> InitialContext initialContext = new InitialContext(properties);
>> Object object = initialContext.lookup("**UserFacadeLocal");
>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>> EntityManager em = userFacade.getEntityManager();
>> Query query = em.createNamedQuery("User.**findByUserName");
>> query.setParameter("userName", "admin");
>> User result;
>> try {
>>      result = (User) query.getSingleResult();
>> } catch (NoResultException e) {
>>      result = null;
>> }
>> result.setEmail("[hidden email]**");
>> userFacade.edit(result);
>>
>> I get the error:
>>
>> "Primary key field com.iball.server.entities.**User.userId of
>> com.iball.server.entities.**User@64def7 has non-default value. The
>> instance life cycle is in PNewState state and hence an existing non-default
>> value for the identity field is not permitted. You either need to remove
>> the @GeneratedValue annotation or modify the code to remove the initializer
>> processing."
>>
>> The generated value annotation present is:
>>
>> @Id
>> @GeneratedValue(strategy = GenerationType.IDENTITY)
>> @Basic
>> @Column(name = "user_id")
>> private Integer userId;
>>
>> I also tried GenerationType.AUTO and removing the auto increment setting
>> on the DB but it didn't help
>>
>> The userFacade.edit(result) method is calling getEntityManager().merge(**
>> entity);
>>
>>
>>
>> On 7/9/2012 12:11 AM, Romain Manni-Bucau wrote:
>>
>>> You should at least share your logs or (better) a sample otherwise helping
>>> you is hard. Generally it is faster than 'trying' things.
>>>
>>> - Romun
>>> Le 9 juil. 2012 03:20, "David Nordahl"<[hidden email]>   a écrit :
>>>
>>>   Tried the snap shot.. I get an error in Netbeans saying that it can't
>>>> deploy the app and to check the server log, yet the server log has no
>>>> errors and shows the app deploying successfully yet I cannot open the web
>>>> host in the browser.  I give up... I could have written all the middle
>>>> ware
>>>> needed for this project myself by now.  Thanks for your efforts.
>>>>
>>>> On 7/8/2012 4:56 PM, Romain Manni-Bucau wrote:
>>>>
>>>>   hmm
>>>>> you use tomee 1.0.0
>>>>>
>>>>> can you give it a try to the snapshot please? we worked a bit on
>>>>> netbeans
>>>>> integration.
>>>>>
>>>>> - Romain
>>>>>
>>>>>
>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>
>>>>>    Btw.. Is it normal to have these exceptions on startup?  I saw another
>>>>>
>>>>>> post saying they were, but I thought I might double check.  I seem to
>>>>>> be
>>>>>> able to query through open EJB, but not update and add.  I'm also
>>>>>> wondering
>>>>>> if there is anyway that the reentrant flush error is covering up
>>>>>> another
>>>>>> error.  I guess I can start working on a test case.. I wish I could
>>>>>> just
>>>>>> find a netbeans JSP2.0/EJB/TomEE sample project where everything was
>>>>>> already setup correctly.
>>>>>>
>>>>>> SEVERE: Error in safeBind method
>>>>>> javax.naming.******NameNotFoundException: Name [openejb] is not bound
>>>>>> in
>>>>>> this
>>>>>> Context. Unable to find [openejb].
>>>>>>        at org.apache.naming.******NamingContext.lookup(****
>>>>>> NamingContext.java:820)
>>>>>>        at org.apache.naming.******NamingContext.lookup(****
>>>>>> NamingContext.java:168)
>>>>>>        at org.apache.tomee.catalina.******
>>>>>> TomcatWebAppBuilder.safeBind(******
>>>>>> TomcatWebAppBuilder.java:1196)
>>>>>>        at org.apache.tomee.catalina.******TomcatWebAppBuilder.****
>>>>>> afterStart(**
>>>>>> TomcatWebAppBuilder.java:776)
>>>>>>        at org.apache.tomee.catalina.******GlobalListenerSupport.****
>>>>>> lifecycleEvent(
>>>>>> **GlobalListenerSupport.java:******103)
>>>>>>        at org.apache.catalina.util.******LifecycleSupport.****
>>>>>> fireLifecycleEvent(**
>>>>>> LifecycleSupport.java:119)
>>>>>>        at org.apache.catalina.util.******LifecycleBase.****
>>>>>> fireLifecycleEvent(**
>>>>>> LifecycleBase.java:90)
>>>>>>        at org.apache.catalina.util.******LifecycleBase.****
>>>>>> setStateInternal(**
>>>>>> LifecycleBase.java:401)
>>>>>>        at org.apache.catalina.util.******LifecycleBase.start(**
>>>>>> LifecycleBase.java:168)
>>>>>>        at org.apache.catalina.core.******ContainerBase.****
>>>>>> addChildInternal(**
>>>>>> ContainerBase.java:895)
>>>>>>        at org.apache.catalina.core.******ContainerBase.addChild(**
>>>>>> ContainerBase.java:871)
>>>>>>        at org.apache.catalina.core.******StandardHost.addChild(**
>>>>>> StandardHost.java:615)
>>>>>>        at org.apache.catalina.startup.****
>>>>>> **HostConfig.deployDescriptor(****
>>>>>> HostConfig.java:649)
>>>>>>        at org.apache.catalina.startup.******HostConfig.deployApps(**
>>>>>> HostConfig.java:530)
>>>>>>        at org.apache.catalina.startup.****
>>>>>> **HostConfig.check(HostConfig.****
>>>>>> java:1471)
>>>>>>        at sun.reflect.******NativeMethodAccessorImpl.******
>>>>>> invoke0(Native
>>>>>> Method)
>>>>>>        at sun.reflect.******NativeMethodAccessorImpl.******invoke(**
>>>>>> NativeMethodAccessorImpl.java:******57)
>>>>>>        at sun.reflect.******DelegatingMethodAccessorImpl.***
>>>>>> ***invoke(**
>>>>>> DelegatingMethodAccessorImpl.******java:43)
>>>>>>        at java.lang.reflect.Method.******invoke(Method.java:601)
>>>>>>        at org.apache.tomcat.util.******modeler.BaseModelMBean.invoke(**
>>>>>> ****
>>>>>> BaseModelMBean.java:301)
>>>>>>        at com.sun.jmx.interceptor.******DefaultMBeanServerInterceptor.*
>>>>>> ***
>>>>>> **invoke(**
>>>>>> DefaultMBeanServerInterceptor.******java:819)
>>>>>>        at com.sun.jmx.mbeanserver.******JmxMBeanServer.invoke(**
>>>>>> JmxMBeanServer.java:791)
>>>>>>        at org.apache.catalina.manager.******ManagerServlet.check(**
>>>>>> ManagerServlet.java:1436)
>>>>>>        at org.apache.catalina.manager.******ManagerServlet.deploy(**
>>>>>> ManagerServlet.java:856)
>>>>>>        at org.apache.catalina.manager.******ManagerServlet.doGet(**
>>>>>> ManagerServlet.java:353)
>>>>>>        at javax.servlet.http.******HttpServlet.service(****
>>>>>> HttpServlet.java:621)
>>>>>>        at javax.servlet.http.******HttpServlet.service(****
>>>>>> HttpServlet.java:722)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>>> internalDoFilter(******ApplicationFilterChain.java:******305)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>>> doFilter(**
>>>>>> ApplicationFilterChain.java:******210)
>>>>>>        at org.apache.catalina.filters.****
>>>>>> **SetCharacterEncodingFilter.****
>>>>>> doFilter(******SetCharacterEncodingFilter.******java:108)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>>> internalDoFilter(******ApplicationFilterChain.java:******243)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>>> doFilter(**
>>>>>> ApplicationFilterChain.java:******210)
>>>>>>        at org.apache.catalina.core.******StandardWrapperValve.invoke(**
>>>>>> StandardWrapperValve.java:225)
>>>>>>        at org.apache.catalina.core.******StandardContextValve.invoke(**
>>>>>> StandardContextValve.java:169)
>>>>>>        at org.apache.tomee.catalina.******OpenEJBValve.invoke(**
>>>>>> OpenEJBValve.java:44)
>>>>>>        at org.apache.catalina.******authenticator.****
>>>>>> AuthenticatorBase.invoke(**
>>>>>> AuthenticatorBase.java:581)
>>>>>>        at org.apache.catalina.core.******StandardHostValve.invoke(**
>>>>>> StandardHostValve.java:168)
>>>>>>        at org.apache.catalina.valves.******ErrorReportValve.invoke(**
>>>>>> ErrorReportValve.java:98)
>>>>>>        at org.apache.catalina.valves.******AccessLogValve.invoke(**
>>>>>> AccessLogValve.java:927)
>>>>>>        at org.apache.catalina.core.******StandardEngineValve.invoke(**
>>>>>> StandardEngineValve.java:118)
>>>>>>        at org.apache.catalina.connector.******CoyoteAdapter.service(**
>>>>>> CoyoteAdapter.java:407)
>>>>>>        at org.apache.coyote.http11.******AbstractHttp11Processor.****
>>>>>> process(**
>>>>>> AbstractHttp11Processor.java:******999)
>>>>>>        at org.apache.coyote.******AbstractProtocol$****
>>>>>> AbstractConnectionHandler.**
>>>>>> process(AbstractProtocol.java:******565)
>>>>>>        at org.apache.tomcat.util.net.*****
>>>>>> *JIoEndpoint$SocketProcessor.****
>>>>>> run(JIoEndpoint.java:309)
>>>>>>        at java.util.concurrent.******ThreadPoolExecutor.runWorker(***
>>>>>> ***
>>>>>> ThreadPoolExecutor.java:1110)
>>>>>>        at java.util.concurrent.******ThreadPoolExecutor$Worker.run(**
>>>>>> ****
>>>>>> ThreadPoolExecutor.java:603)
>>>>>>        at java.lang.Thread.run(Thread.******java:722)
>>>>>>
>>>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>>>> TomcatWebAppBuilder
>>>>>> safeBind
>>>>>> INFO: TransactionManager already bound, ignoring
>>>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>>>> TomcatWebAppBuilder
>>>>>> safeBind
>>>>>> INFO: TransactionSynchronizationRegi******stry already bound, ignoring
>>>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>>>> TomcatWebAppBuilder
>>>>>> safeBind
>>>>>> SEVERE: Error in safeBind method
>>>>>> javax.naming.******NameNotFoundException: No ORB registered with the
>>>>>> OpenEJB
>>>>>> system
>>>>>>        at org.apache.openejb.core.ivm.******naming.****
>>>>>> SystemComponentReference.**
>>>>>> getObject(******SystemComponentReference.java:******38)
>>>>>>        at org.apache.openejb.core.ivm.****
>>>>>> **naming.Reference.getContent(****
>>>>>> Reference.java:40)
>>>>>>        at org.apache.xbean.naming.******reference.SimpleReference$**
>>>>>> SimpleObjectFactory.******getObjectInstance(******
>>>>>> SimpleReference.java:137)
>>>>>>        at javax.naming.spi.******NamingManager.******
>>>>>> getObjectInstance(**
>>>>>> NamingManager.java:321)
>>>>>>        at org.apache.naming.******NamingContext.lookup(****
>>>>>> NamingContext.java:843)
>>>>>>        at org.apache.naming.******NamingContext.lookup(****
>>>>>> NamingContext.java:168)
>>>>>>        at org.apache.tomee.catalina.******
>>>>>> TomcatWebAppBuilder.safeBind(******
>>>>>> TomcatWebAppBuilder.java:1196)
>>>>>>        at org.apache.tomee.catalina.******TomcatWebAppBuilder.****
>>>>>> afterStart(**
>>>>>> TomcatWebAppBuilder.java:806)
>>>>>>        at org.apache.tomee.catalina.******GlobalListenerSupport.****
>>>>>> lifecycleEvent(
>>>>>> **GlobalListenerSupport.java:******103)
>>>>>>        at org.apache.catalina.util.******LifecycleSupport.****
>>>>>> fireLifecycleEvent(**
>>>>>> LifecycleSupport.java:119)
>>>>>>        at org.apache.catalina.util.******LifecycleBase.****
>>>>>> fireLifecycleEvent(**
>>>>>> LifecycleBase.java:90)
>>>>>>        at org.apache.catalina.util.******LifecycleBase.****
>>>>>> setStateInternal(**
>>>>>> LifecycleBase.java:401)
>>>>>>        at org.apache.catalina.util.******LifecycleBase.start(**
>>>>>> LifecycleBase.java:168)
>>>>>>        at org.apache.catalina.core.******ContainerBase.****
>>>>>> addChildInternal(**
>>>>>> ContainerBase.java:895)
>>>>>>        at org.apache.catalina.core.******ContainerBase.addChild(**
>>>>>> ContainerBase.java:871)
>>>>>>        at org.apache.catalina.core.******StandardHost.addChild(**
>>>>>> StandardHost.java:615)
>>>>>>        at org.apache.catalina.startup.****
>>>>>> **HostConfig.deployDescriptor(****
>>>>>> HostConfig.java:649)
>>>>>>        at org.apache.catalina.startup.******HostConfig.deployApps(**
>>>>>> HostConfig.java:530)
>>>>>>        at org.apache.catalina.startup.****
>>>>>> **HostConfig.check(HostConfig.****
>>>>>> java:1471)
>>>>>>        at sun.reflect.******NativeMethodAccessorImpl.******
>>>>>> invoke0(Native
>>>>>> Method)
>>>>>>        at sun.reflect.******NativeMethodAccessorImpl.******invoke(**
>>>>>> NativeMethodAccessorImpl.java:******57)
>>>>>>        at sun.reflect.******DelegatingMethodAccessorImpl.***
>>>>>> ***invoke(**
>>>>>> DelegatingMethodAccessorImpl.******java:43)
>>>>>>        at java.lang.reflect.Method.******invoke(Method.java:601)
>>>>>>        at org.apache.tomcat.util.******modeler.BaseModelMBean.invoke(**
>>>>>> ****
>>>>>> BaseModelMBean.java:301)
>>>>>>        at com.sun.jmx.interceptor.******DefaultMBeanServerInterceptor.*
>>>>>> ***
>>>>>> **invoke(**
>>>>>> DefaultMBeanServerInterceptor.******java:819)
>>>>>>        at com.sun.jmx.mbeanserver.******JmxMBeanServer.invoke(**
>>>>>> JmxMBeanServer.java:791)
>>>>>>        at org.apache.catalina.manager.******ManagerServlet.check(**
>>>>>> ManagerServlet.java:1436)
>>>>>>        at org.apache.catalina.manager.******ManagerServlet.deploy(**
>>>>>> ManagerServlet.java:856)
>>>>>>        at org.apache.catalina.manager.******ManagerServlet.doGet(**
>>>>>> ManagerServlet.java:353)
>>>>>>        at javax.servlet.http.******HttpServlet.service(****
>>>>>> HttpServlet.java:621)
>>>>>>        at javax.servlet.http.******HttpServlet.service(****
>>>>>> HttpServlet.java:722)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>>> internalDoFilter(******ApplicationFilterChain.java:******305)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>>> doFilter(**
>>>>>> ApplicationFilterChain.java:******210)
>>>>>>        at org.apache.catalina.filters.****
>>>>>> **SetCharacterEncodingFilter.****
>>>>>> doFilter(******SetCharacterEncodingFilter.******java:108)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>>> internalDoFilter(******ApplicationFilterChain.java:******243)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>>> doFilter(**
>>>>>> ApplicationFilterChain.java:******210)
>>>>>>        at org.apache.catalina.core.******StandardWrapperValve.invoke(**
>>>>>> StandardWrapperValve.java:225)
>>>>>>        at org.apache.catalina.core.******StandardContextValve.invoke(**
>>>>>> StandardContextValve.java:169)
>>>>>>        at org.apache.tomee.catalina.******OpenEJBValve.invoke(**
>>>>>> OpenEJBValve.java:44)
>>>>>>        at org.apache.catalina.******authenticator.****
>>>>>> AuthenticatorBase.invoke(**
>>>>>> AuthenticatorBase.java:581)
>>>>>>        at org.apache.catalina.core.******StandardHostValve.invoke(**
>>>>>> StandardHostValve.java:168)
>>>>>>        at org.apache.catalina.valves.******ErrorReportValve.invoke(**
>>>>>> ErrorReportValve.java:98)
>>>>>>        at org.apache.catalina.valves.******AccessLogValve.invoke(**
>>>>>> AccessLogValve.java:927)
>>>>>>        at org.apache.catalina.core.******StandardEngineValve.invoke(**
>>>>>> StandardEngineValve.java:118)
>>>>>>        at org.apache.catalina.connector.******CoyoteAdapter.service(**
>>>>>> CoyoteAdapter.java:407)
>>>>>>        at org.apache.coyote.http11.******AbstractHttp11Processor.****
>>>>>> process(**
>>>>>> AbstractHttp11Processor.java:******999)
>>>>>>        at org.apache.coyote.******AbstractProtocol$****
>>>>>> AbstractConnectionHandler.**
>>>>>> process(AbstractProtocol.java:******565)
>>>>>>        at org.apache.tomcat.util.net.*****
>>>>>> *JIoEndpoint$SocketProcessor.****
>>>>>> run(JIoEndpoint.java:309)
>>>>>>        at java.util.concurrent.******ThreadPoolExecutor.runWorker(***
>>>>>> ***
>>>>>> ThreadPoolExecutor.java:1110)
>>>>>>        at java.util.concurrent.******ThreadPoolExecutor$Worker.run(**
>>>>>> ****
>>>>>> ThreadPoolExecutor.java:603)
>>>>>>        at java.lang.Thread.run(Thread.******java:722)
>>>>>>
>>>>>> Jul 08, 2012 4:40:43 PM org.apache.tomee.catalina.****
>>>>>> TomcatWebAppBuilder
>>>>>> safeBind
>>>>>> SEVERE: Error in safeBind method
>>>>>> javax.naming.******NameNotFoundException: No HandleDelegate registered
>>>>>> with
>>>>>> the OpenEJB system
>>>>>>        at org.apache.openejb.core.ivm.******naming.****
>>>>>> SystemComponentReference.**
>>>>>> getObject(******SystemComponentReference.java:******38)
>>>>>>        at org.apache.openejb.core.ivm.****
>>>>>> **naming.Reference.getContent(****
>>>>>> Reference.java:40)
>>>>>>        at org.apache.xbean.naming.******reference.SimpleReference$**
>>>>>> SimpleObjectFactory.******getObjectInstance(******
>>>>>> SimpleReference.java:137)
>>>>>>        at javax.naming.spi.******NamingManager.******
>>>>>> getObjectInstance(**
>>>>>> NamingManager.java:321)
>>>>>>        at org.apache.naming.******NamingContext.lookup(****
>>>>>> NamingContext.java:843)
>>>>>>        at org.apache.naming.******NamingContext.lookup(****
>>>>>> NamingContext.java:168)
>>>>>>        at org.apache.tomee.catalina.******
>>>>>> TomcatWebAppBuilder.safeBind(******
>>>>>> TomcatWebAppBuilder.java:1196)
>>>>>>        at org.apache.tomee.catalina.******TomcatWebAppBuilder.****
>>>>>> afterStart(**
>>>>>> TomcatWebAppBuilder.java:807)
>>>>>>        at org.apache.tomee.catalina.******GlobalListenerSupport.****
>>>>>> lifecycleEvent(
>>>>>> **GlobalListenerSupport.java:******103)
>>>>>>        at org.apache.catalina.util.******LifecycleSupport.****
>>>>>> fireLifecycleEvent(**
>>>>>> LifecycleSupport.java:119)
>>>>>>        at org.apache.catalina.util.******LifecycleBase.****
>>>>>> fireLifecycleEvent(**
>>>>>> LifecycleBase.java:90)
>>>>>>        at org.apache.catalina.util.******LifecycleBase.****
>>>>>> setStateInternal(**
>>>>>> LifecycleBase.java:401)
>>>>>>        at org.apache.catalina.util.******LifecycleBase.start(**
>>>>>> LifecycleBase.java:168)
>>>>>>        at org.apache.catalina.core.******ContainerBase.****
>>>>>> addChildInternal(**
>>>>>> ContainerBase.java:895)
>>>>>>        at org.apache.catalina.core.******ContainerBase.addChild(**
>>>>>> ContainerBase.java:871)
>>>>>>        at org.apache.catalina.core.******StandardHost.addChild(**
>>>>>> StandardHost.java:615)
>>>>>>        at org.apache.catalina.startup.****
>>>>>> **HostConfig.deployDescriptor(****
>>>>>> HostConfig.java:649)
>>>>>>        at org.apache.catalina.startup.******HostConfig.deployApps(**
>>>>>> HostConfig.java:530)
>>>>>>        at org.apache.catalina.startup.****
>>>>>> **HostConfig.check(HostConfig.****
>>>>>> java:1471)
>>>>>>        at sun.reflect.******NativeMethodAccessorImpl.******
>>>>>> invoke0(Native
>>>>>> Method)
>>>>>>        at sun.reflect.******NativeMethodAccessorImpl.******invoke(**
>>>>>> NativeMethodAccessorImpl.java:******57)
>>>>>>        at sun.reflect.******DelegatingMethodAccessorImpl.***
>>>>>> ***invoke(**
>>>>>> DelegatingMethodAccessorImpl.******java:43)
>>>>>>        at java.lang.reflect.Method.******invoke(Method.java:601)
>>>>>>        at org.apache.tomcat.util.******modeler.BaseModelMBean.invoke(**
>>>>>> ****
>>>>>> BaseModelMBean.java:301)
>>>>>>        at com.sun.jmx.interceptor.******DefaultMBeanServerInterceptor.*
>>>>>> ***
>>>>>> **invoke(**
>>>>>> DefaultMBeanServerInterceptor.******java:819)
>>>>>>        at com.sun.jmx.mbeanserver.******JmxMBeanServer.invoke(**
>>>>>> JmxMBeanServer.java:791)
>>>>>>        at org.apache.catalina.manager.******ManagerServlet.check(**
>>>>>> ManagerServlet.java:1436)
>>>>>>        at org.apache.catalina.manager.******ManagerServlet.deploy(**
>>>>>> ManagerServlet.java:856)
>>>>>>        at org.apache.catalina.manager.******ManagerServlet.doGet(**
>>>>>> ManagerServlet.java:353)
>>>>>>        at javax.servlet.http.******HttpServlet.service(****
>>>>>> HttpServlet.java:621)
>>>>>>        at javax.servlet.http.******HttpServlet.service(****
>>>>>> HttpServlet.java:722)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>>> internalDoFilter(******ApplicationFilterChain.java:******305)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>>> doFilter(**
>>>>>> ApplicationFilterChain.java:******210)
>>>>>>        at org.apache.catalina.filters.****
>>>>>> **SetCharacterEncodingFilter.****
>>>>>> doFilter(******SetCharacterEncodingFilter.******java:108)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.**
>>>>>> internalDoFilter(******ApplicationFilterChain.java:******243)
>>>>>>        at org.apache.catalina.core.******ApplicationFilterChain.****
>>>>>> doFilter(**
>>>>>> ApplicationFilterChain.java:******210)
>>>>>>        at org.apache.catalina.core.******StandardWrapperValve.invoke(**
>>>>>> StandardWrapperValve.java:225)
>>>>>>        at org.apache.catalina.core.******StandardContextValve.invoke(**
>>>>>> StandardContextValve.java:169)
>>>>>>        at org.apache.tomee.catalina.******OpenEJBValve.invoke(**
>>>>>> OpenEJBValve.java:44)
>>>>>>        at org.apache.catalina.******authenticator.****
>>>>>> AuthenticatorBase.invoke(**
>>>>>> AuthenticatorBase.java:581)
>>>>>>        at org.apache.catalina.core.******StandardHostValve.invoke(**
>>>>>> StandardHostValve.java:168)
>>>>>>        at org.apache.catalina.valves.******ErrorReportValve.invoke(**
>>>>>> ErrorReportValve.java:98)
>>>>>>        at org.apache.catalina.valves.******AccessLogValve.invoke(**
>>>>>> AccessLogValve.java:927)
>>>>>>        at org.apache.catalina.core.******StandardEngineValve.invoke(**
>>>>>> StandardEngineValve.java:118)
>>>>>>        at org.apache.catalina.connector.******CoyoteAdapter.service(**
>>>>>> CoyoteAdapter.java:407)
>>>>>>        at org.apache.coyote.http11.******AbstractHttp11Processor.****
>>>>>> process(**
>>>>>> AbstractHttp11Processor.java:******999)
>>>>>>        at org.apache.coyote.******AbstractProtocol$****
>>>>>> AbstractConnectionHandler.**
>>>>>> process(AbstractProtocol.java:******565)
>>>>>>        at org.apache.tomcat.util.net.*****
>>>>>> *JIoEndpoint$SocketProcessor.****
>>>>>> run(JIoEndpoint.java:309)
>>>>>>        at java.util.concurrent.******ThreadPoolExecutor.runWorker(***
>>>>>> ***
>>>>>> ThreadPoolExecutor.java:1110)
>>>>>>        at java.util.concurrent.******ThreadPoolExecutor$Worker.run(**
>>>>>> ****
>>>>>> ThreadPoolExecutor.java:603)
>>>>>>        at java.lang.Thread.run(Thread.******java:722)
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 7/8/2012 4:32 PM, Romain Manni-Bucau wrote:
>>>>>>
>>>>>>    i don't think so,
>>>>>>
>>>>>>> can you try moving your code in a unit test to see if it still happen?
>>>>>>>
>>>>>>> - Romain
>>>>>>>
>>>>>>>
>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>
>>>>>>>     Could it be the Tomcat JDBCRealm I have enforcing container managed
>>>>>>>
>>>>>>>   security from user data in the same table?
>>>>>>>>
>>>>>>>> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>>>>>>>>
>>>>>>>>     i can't say no but i'm pretty sure it is something in the
>>>>>>>> container
>>>>>>>>
>>>>>>>>   rather
>>>>>>>>> in the DB.
>>>>>>>>>
>>>>>>>>> - Romain
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>
>>>>>>>>>      Maybe the DB settings could have something to do with it? I'm
>>>>>>>>> using
>>>>>>>>> MySQL
>>>>>>>>>
>>>>>>>>>    with it's default setup which uses InnoDB.  I notice in the
>>>>>>>>>
>>>>>>>>>> documentation
>>>>>>>>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes
>>>>>>>>>> the
>>>>>>>>>> transaction log after each transaction, greatly improving
>>>>>>>>>> reliability."
>>>>>>>>>>
>>>>>>>>>> Could some DB setting like this be causing the issue?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>>>>>>>>
>>>>>>>>>>      can you share a small sample to reproduce it, will be easier to
>>>>>>>>>> help
>>>>>>>>>>
>>>>>>>>>>    you?
>>>>>>>>>>
>>>>>>>>>>> - Romain
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>>
>>>>>>>>>>>       Not that I've configured.. Unless one of the annotations
>>>>>>>>>>> creates
>>>>>>>>>>> one:
>>>>>>>>>>>
>>>>>>>>>>>     @Entity
>>>>>>>>>>>
>>>>>>>>>>>   @Table(name = "user")
>>>>>>>>>>>> @XmlRootElement
>>>>>>>>>>>> @NamedQueries({
>>>>>>>>>>>>           @NamedQuery(name = "User.findAll", query = "SELECT u
>>>>>>>>>>>> FROM
>>>>>>>>>>>> User
>>>>>>>>>>>> u"),
>>>>>>>>>>>>           @NamedQuery(name = "User.findByUserId", query = "SELECT
>>>>>>>>>>>> u
>>>>>>>>>>>> FROM
>>>>>>>>>>>> User
>>>>>>>>>>>> u
>>>>>>>>>>>> WHERE u.userId = :userId"),
>>>>>>>>>>>>           @NamedQuery(name = "User.findByUserName", query =
>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>> FROM
>>>>>>>>>>>> User
>>>>>>>>>>>> u WHERE u.userName = :userName"),
>>>>>>>>>>>>           @NamedQuery(name = "User.findByPassword", query =
>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>> FROM
>>>>>>>>>>>> User
>>>>>>>>>>>> u WHERE u.password = :password"),
>>>>>>>>>>>>           @NamedQuery(name = "User.findByEmail", query = "SELECT u
>>>>>>>>>>>> FROM
>>>>>>>>>>>> User u
>>>>>>>>>>>> WHERE u.email = :email"),
>>>>>>>>>>>>           @NamedQuery(name = "User.findByFirstName", query =
>>>>>>>>>>>> "SELECT
>>>>>>>>>>>> u
>>>>>>>>>>>> FROM
>>>>>>>>>>>> User
>>>>>>>>>>>> u WHERE u.firstName = :firstName"),
>>>>>>>>>>>>           @NamedQuery(name = "User.findByLastName", query =
>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>> FROM
>>>>>>>>>>>> User
>>>>>>>>>>>> u WHERE u.lastName = :lastName"),
>>>>>>>>>>>>           @NamedQuery(name = "User.findByLoginFailures", query =
>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>> FROM
>>>>>>>>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>>>>>>>>           @NamedQuery(name = "User.findByLastLoginFailure", query
>>>>>>>>>>>> =
>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>>>>>>>>> public class User implements Serializable {
>>>>>>>>>>>>           private static final long serialVersionUID = 1L;
>>>>>>>>>>>>           @Id
>>>>>>>>>>>>           @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>>>>>>>>           @Basic(optional = false)
>>>>>>>>>>>>           @Column(name = "user_id")
>>>>>>>>>>>>           private Integer userId;
>>>>>>>>>>>>           @Basic(optional = false)
>>>>>>>>>>>>           @Column(name = "user_name")
>>>>>>>>>>>>           private String userName;
>>>>>>>>>>>>           @Basic(optional = false)
>>>>>>>>>>>>           @Column(name = "password")
>>>>>>>>>>>>           private String password;
>>>>>>>>>>>>           @Column(name = "email")
>>>>>>>>>>>>           private String email;
>>>>>>>>>>>>           @Column(name = "first_name")
>>>>>>>>>>>>           private String firstName;
>>>>>>>>>>>>           @Column(name = "last_name")
>>>>>>>>>>>>           private String lastName;
>>>>>>>>>>>>           @Column(name = "login_failures")
>>>>>>>>>>>>           private Integer loginFailures;
>>>>>>>>>>>>           @Column(name = "last_login_failure")
>>>>>>>>>>>>           @Temporal(TemporalType.************TIMESTAMP)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>           private Date lastLoginFailure;
>>>>>>>>>>>>           @JoinColumn(name = "associated_customer",
>>>>>>>>>>>> referencedColumnName =
>>>>>>>>>>>> "customer_id")
>>>>>>>>>>>>           @ManyToOne
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>       Hi,
>>>>>>>>>>>>
>>>>>>>>>>>>     any entity listener playing with id or special field on User
>>>>>>>>>>>> entity?
>>>>>>>>>>>>
>>>>>>>>>>>>   - Romain
>>>>>>>>>>>>>
>>>>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>>>>
>>>>>>>>>>>>>        I'm attempting the code:
>>>>>>>>>>>>>
>>>>>>>>>>>>>      Properties properties = new Properties();
>>>>>>>>>>>>>
>>>>>>>>>>>>>    properties.setProperty(*********
>>>>>>>>>>>>> *****Context.INITIAL_CONTEXT_*******
>>>>>>>>>>>>>
>>>>>>>>>>>>>> ****
>>>>>>>>>>>>>> ***
>>>>>>>>>>>>>> FACTORY,
>>>>>>>>>>>>>> "org.apache.openejb.client.****************
>>>>>>>>>>>>>> LocalInitialContextFactory"**)******;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> InitialContext initialContext = new InitialContext(properties);
>>>>>>>>>>>>>> Object object = initialContext.lookup("*************
>>>>>>>>>>>>>> *UserFacadeLocal");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>>>>>>>>> User newuser = new User();
>>>>>>>>>>>>>> newuser.setEmail("[hidden email]"**************);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> newuser.setUserName("steve");
>>>>>>>>>>>>>> newuser.setPassword("cows");
>>>>>>>>>>>>>> userFacade.create(newuser);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> but keep getting "org.apache.openjpa.**************
>>>>>>>>>>>>>> persistence.****
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> InvalidStateException:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>>>>>>>>> callback
>>>>>>>>>>>>>> methods or event listeners do not invoke any operations that
>>>>>>>>>>>>>> require
>>>>>>>>>>>>>> the
>>>>>>>>>>>>>> in-progress flush to complete."
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to
>>>>>>>>>>>>>> see
>>>>>>>>>>>>>> if
>>>>>>>>>>>>>> I
>>>>>>>>>>>>>> can
>>>>>>>>>>>>>> get the error to go away, but it makes no difference.  I can't
>>>>>>>>>>>>>> find a
>>>>>>>>>>>>>> flush() call in my project and according to the table in the
>>>>>>>>>>>>>> docs,
>>>>>>>>>>>>>> flush
>>>>>>>>>>>>>> is
>>>>>>>>>>>>>> not called if this parameter is set.  What am I not doing
>>>>>>>>>>>>>> correctly
>>>>>>>>>>>>>> here?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thank you,
>>>>>>>>>>>>>> David
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Detected Reentrant Flush - Trouble with merge / update

Romain Manni-Bucau
UserFacace {
   Entitymanager em;
  edit(User u) {
     em.find(User.class, u.getId());
     // do you update here, not before
  }
}
- Romain


2012/7/10 David Nordahl <[hidden email]>

> I got it running on the snap shot version, and that did away with those
> four startup exceptions.  I still get the error below though.. Is this
> added line to get the email address what you mean by doing a find on the
> ejb?
>
> String currentEmail = result.getEmail();
> result.setEmail("[hidden email]**");
> userFacade.edit(result);
>
>
>
>
> On 7/9/2012 12:15 PM, Romain Manni-Bucau wrote:
>
>> maybe try a find in your ejb before the merge to let you rentity be
>> managed
>> and to be allowed to merge.
>>
>> FYI the snapshot is not the beta-3 but the 1.1.0-SNAPSHOT.
>>
>> - Romain
>>
>>
>> 2012/7/9 David Nordahl<[hidden email]>
>>
>>  I looked at it again today, and it looks like it is not deploying on the
>>> beta3 version for some reason, but I don't see any errors or attempts in
>>> the log.  I will look at it more later, but for now I would like to try
>>> to
>>> work around any issues with the last production release if possible.
>>>
>>> I can now get queries and inserts to work, but am having trouble with the
>>> updates.  It looks like it is also related to auto-increment/generated
>>> key
>>> stuff.  Perhaps the way I'm going about it is incorrect:
>>>
>>> Properties properties = new Properties();
>>> properties.setProperty(****Context.INITIAL_CONTEXT_****FACTORY,
>>> "org.apache.openejb.client.****LocalInitialContextFactory");
>>>
>>> InitialContext initialContext = new InitialContext(properties);
>>> Object object = initialContext.lookup("****UserFacadeLocal");
>>>
>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>> EntityManager em = userFacade.getEntityManager();
>>> Query query = em.createNamedQuery("User.****findByUserName");
>>>
>>> query.setParameter("userName", "admin");
>>> User result;
>>> try {
>>>      result = (User) query.getSingleResult();
>>> } catch (NoResultException e) {
>>>      result = null;
>>> }
>>> result.setEmail("[hidden email]****");
>>>
>>> userFacade.edit(result);
>>>
>>> I get the error:
>>>
>>> "Primary key field com.iball.server.entities.****User.userId of
>>> com.iball.server.entities.****User@64def7 has non-default value. The
>>>
>>> instance life cycle is in PNewState state and hence an existing
>>> non-default
>>> value for the identity field is not permitted. You either need to remove
>>> the @GeneratedValue annotation or modify the code to remove the
>>> initializer
>>> processing."
>>>
>>> The generated value annotation present is:
>>>
>>> @Id
>>> @GeneratedValue(strategy = GenerationType.IDENTITY)
>>> @Basic
>>> @Column(name = "user_id")
>>> private Integer userId;
>>>
>>> I also tried GenerationType.AUTO and removing the auto increment setting
>>> on the DB but it didn't help
>>>
>>> The userFacade.edit(result) method is calling getEntityManager().merge(**
>>>
>>> entity);
>>>
>>>
>>>
>>> On 7/9/2012 12:11 AM, Romain Manni-Bucau wrote:
>>>
>>>  You should at least share your logs or (better) a sample otherwise
>>>> helping
>>>> you is hard. Generally it is faster than 'trying' things.
>>>>
>>>> - Romun
>>>> Le 9 juil. 2012 03:20, "David Nordahl"<[hidden email]>   a écrit
>>>> :
>>>>
>>>>   Tried the snap shot.. I get an error in Netbeans saying that it can't
>>>>
>>>>> deploy the app and to check the server log, yet the server log has no
>>>>> errors and shows the app deploying successfully yet I cannot open the
>>>>> web
>>>>> host in the browser.  I give up... I could have written all the middle
>>>>> ware
>>>>> needed for this project myself by now.  Thanks for your efforts.
>>>>>
>>>>> On 7/8/2012 4:56 PM, Romain Manni-Bucau wrote:
>>>>>
>>>>>   hmm
>>>>>
>>>>>> you use tomee 1.0.0
>>>>>>
>>>>>> can you give it a try to the snapshot please? we worked a bit on
>>>>>> netbeans
>>>>>> integration.
>>>>>>
>>>>>> - Romain
>>>>>>
>>>>>>
>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>
>>>>>>    Btw.. Is it normal to have these exceptions on startup?  I saw
>>>>>> another
>>>>>>
>>>>>>  post saying they were, but I thought I might double check.  I seem to
>>>>>>> be
>>>>>>> able to query through open EJB, but not update and add.  I'm also
>>>>>>> wondering
>>>>>>> if there is anyway that the reentrant flush error is covering up
>>>>>>> another
>>>>>>> error.  I guess I can start working on a test case.. I wish I could
>>>>>>> just
>>>>>>> find a netbeans JSP2.0/EJB/TomEE sample project where everything was
>>>>>>> already setup correctly.
>>>>>>>
>>>>>>> SEVERE: Error in safeBind method
>>>>>>> javax.naming.********NameNotFoundException: Name [openejb] is not
>>>>>>> bound
>>>>>>>
>>>>>>> in
>>>>>>> this
>>>>>>> Context. Unable to find [openejb].
>>>>>>>        at org.apache.naming.********NamingContext.lookup(****
>>>>>>> NamingContext.java:820)
>>>>>>>        at org.apache.naming.********NamingContext.lookup(****
>>>>>>> NamingContext.java:168)
>>>>>>>        at org.apache.tomee.catalina.********
>>>>>>> TomcatWebAppBuilder.safeBind(********
>>>>>>> TomcatWebAppBuilder.java:1196)
>>>>>>>        at org.apache.tomee.catalina.********TomcatWebAppBuilder.****
>>>>>>> afterStart(**
>>>>>>> TomcatWebAppBuilder.java:776)
>>>>>>>        at org.apache.tomee.catalina.******
>>>>>>> **GlobalListenerSupport.****
>>>>>>> lifecycleEvent(
>>>>>>> **GlobalListenerSupport.java:********103)
>>>>>>>        at org.apache.catalina.util.********LifecycleSupport.****
>>>>>>> fireLifecycleEvent(**
>>>>>>> LifecycleSupport.java:119)
>>>>>>>        at org.apache.catalina.util.********LifecycleBase.****
>>>>>>> fireLifecycleEvent(**
>>>>>>> LifecycleBase.java:90)
>>>>>>>        at org.apache.catalina.util.********LifecycleBase.****
>>>>>>> setStateInternal(**
>>>>>>> LifecycleBase.java:401)
>>>>>>>        at org.apache.catalina.util.********LifecycleBase.start(**
>>>>>>> LifecycleBase.java:168)
>>>>>>>        at org.apache.catalina.core.********ContainerBase.****
>>>>>>> addChildInternal(**
>>>>>>> ContainerBase.java:895)
>>>>>>>        at org.apache.catalina.core.********ContainerBase.addChild(**
>>>>>>> ContainerBase.java:871)
>>>>>>>        at org.apache.catalina.core.********StandardHost.addChild(**
>>>>>>> StandardHost.java:615)
>>>>>>>        at org.apache.catalina.startup.******
>>>>>>> **HostConfig.deployDescriptor(******
>>>>>>> HostConfig.java:649)
>>>>>>>        at org.apache.catalina.startup.****
>>>>>>> ****HostConfig.deployApps(**
>>>>>>> HostConfig.java:530)
>>>>>>>        at org.apache.catalina.startup.******
>>>>>>> **HostConfig.check(HostConfig.******
>>>>>>> java:1471)
>>>>>>>        at sun.reflect.********NativeMethodAccessorImpl.********
>>>>>>> invoke0(Native
>>>>>>> Method)
>>>>>>>        at sun.reflect.********NativeMethodAccessorImpl.*******
>>>>>>> *invoke(**
>>>>>>> NativeMethodAccessorImpl.java:********57)
>>>>>>>        at sun.reflect.********DelegatingMethodAccessorImpl.*****
>>>>>>> ***invoke(**
>>>>>>> DelegatingMethodAccessorImpl.********java:43)
>>>>>>>        at java.lang.reflect.Method.********invoke(Method.java:601)
>>>>>>>        at org.apache.tomcat.util.********
>>>>>>> modeler.BaseModelMBean.invoke(****
>>>>>>> ****
>>>>>>> BaseModelMBean.java:301)
>>>>>>>        at com.sun.jmx.interceptor.********
>>>>>>> DefaultMBeanServerInterceptor.***
>>>>>>> ***
>>>>>>> **invoke(**
>>>>>>> DefaultMBeanServerInterceptor.********java:819)
>>>>>>>        at com.sun.jmx.mbeanserver.********JmxMBeanServer.invoke(**
>>>>>>> JmxMBeanServer.java:791)
>>>>>>>        at org.apache.catalina.manager.****
>>>>>>> ****ManagerServlet.check(**
>>>>>>> ManagerServlet.java:1436)
>>>>>>>        at org.apache.catalina.manager.****
>>>>>>> ****ManagerServlet.deploy(**
>>>>>>> ManagerServlet.java:856)
>>>>>>>        at org.apache.catalina.manager.****
>>>>>>> ****ManagerServlet.doGet(**
>>>>>>> ManagerServlet.java:353)
>>>>>>>        at javax.servlet.http.********HttpServlet.service(****
>>>>>>> HttpServlet.java:621)
>>>>>>>        at javax.servlet.http.********HttpServlet.service(****
>>>>>>> HttpServlet.java:722)
>>>>>>>        at org.apache.catalina.core.********ApplicationFilterChain.**
>>>>>>> internalDoFilter(********ApplicationFilterChain.java:********305)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *ApplicationFilterChain.****
>>>>>>> doFilter(**
>>>>>>> ApplicationFilterChain.java:********210)
>>>>>>>        at org.apache.catalina.filters.******
>>>>>>> **SetCharacterEncodingFilter.******
>>>>>>> doFilter(********SetCharacterEncodingFilter.********java:108)
>>>>>>>        at org.apache.catalina.core.********ApplicationFilterChain.**
>>>>>>> internalDoFilter(********ApplicationFilterChain.java:********243)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *ApplicationFilterChain.****
>>>>>>> doFilter(**
>>>>>>> ApplicationFilterChain.java:********210)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardWrapperValve.invoke(****
>>>>>>> StandardWrapperValve.java:225)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardContextValve.invoke(****
>>>>>>> StandardContextValve.java:169)
>>>>>>>        at org.apache.tomee.catalina.********OpenEJBValve.invoke(**
>>>>>>> OpenEJBValve.java:44)
>>>>>>>        at org.apache.catalina.********authenticator.****
>>>>>>> AuthenticatorBase.invoke(**
>>>>>>> AuthenticatorBase.java:581)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardHostValve.invoke(**
>>>>>>> StandardHostValve.java:168)
>>>>>>>        at org.apache.catalina.valves.*****
>>>>>>> ***ErrorReportValve.invoke(**
>>>>>>> ErrorReportValve.java:98)
>>>>>>>        at org.apache.catalina.valves.*****
>>>>>>> ***AccessLogValve.invoke(**
>>>>>>> AccessLogValve.java:927)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardEngineValve.invoke(**
>>>>>>> StandardEngineValve.java:118)
>>>>>>>        at org.apache.catalina.connector.**
>>>>>>> ******CoyoteAdapter.service(**
>>>>>>> CoyoteAdapter.java:407)
>>>>>>>        at org.apache.coyote.http11.*******
>>>>>>> *AbstractHttp11Processor.****
>>>>>>> process(**
>>>>>>> AbstractHttp11Processor.java:********999)
>>>>>>>        at org.apache.coyote.********AbstractProtocol$****
>>>>>>> AbstractConnectionHandler.**
>>>>>>> process(AbstractProtocol.java:********565)
>>>>>>>        at org.apache.tomcat.util.net.*******
>>>>>>> *JIoEndpoint$SocketProcessor.******
>>>>>>> run(JIoEndpoint.java:309)
>>>>>>>        at java.util.concurrent.********
>>>>>>> ThreadPoolExecutor.runWorker(*****
>>>>>>> ***
>>>>>>> ThreadPoolExecutor.java:1110)
>>>>>>>        at java.util.concurrent.********
>>>>>>> ThreadPoolExecutor$Worker.run(****
>>>>>>> ****
>>>>>>> ThreadPoolExecutor.java:603)
>>>>>>>        at java.lang.Thread.run(Thread.********java:722)
>>>>>>>
>>>>>>>
>>>>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>>>>> TomcatWebAppBuilder
>>>>>>> safeBind
>>>>>>> INFO: TransactionManager already bound, ignoring
>>>>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>>>>> TomcatWebAppBuilder
>>>>>>> safeBind
>>>>>>> INFO: TransactionSynchronizationRegi********stry already bound,
>>>>>>> ignoring
>>>>>>>
>>>>>>> Jul 08, 2012 4:40:06 PM org.apache.tomee.catalina.****
>>>>>>> TomcatWebAppBuilder
>>>>>>> safeBind
>>>>>>> SEVERE: Error in safeBind method
>>>>>>> javax.naming.********NameNotFoundException: No ORB registered with
>>>>>>> the
>>>>>>> OpenEJB
>>>>>>> system
>>>>>>>        at org.apache.openejb.core.ivm.********naming.****
>>>>>>> SystemComponentReference.**
>>>>>>> getObject(********SystemComponentReference.java:********38)
>>>>>>>        at org.apache.openejb.core.ivm.******
>>>>>>> **naming.Reference.getContent(******
>>>>>>> Reference.java:40)
>>>>>>>        at org.apache.xbean.naming.********
>>>>>>> reference.SimpleReference$**
>>>>>>> SimpleObjectFactory.********getObjectInstance(******
>>>>>>> SimpleReference.java:137)
>>>>>>>        at javax.naming.spi.********NamingManager.******
>>>>>>> getObjectInstance(**
>>>>>>> NamingManager.java:321)
>>>>>>>        at org.apache.naming.********NamingContext.lookup(****
>>>>>>> NamingContext.java:843)
>>>>>>>        at org.apache.naming.********NamingContext.lookup(****
>>>>>>> NamingContext.java:168)
>>>>>>>        at org.apache.tomee.catalina.********
>>>>>>> TomcatWebAppBuilder.safeBind(********
>>>>>>> TomcatWebAppBuilder.java:1196)
>>>>>>>        at org.apache.tomee.catalina.********TomcatWebAppBuilder.****
>>>>>>> afterStart(**
>>>>>>> TomcatWebAppBuilder.java:806)
>>>>>>>        at org.apache.tomee.catalina.******
>>>>>>> **GlobalListenerSupport.****
>>>>>>> lifecycleEvent(
>>>>>>> **GlobalListenerSupport.java:********103)
>>>>>>>        at org.apache.catalina.util.********LifecycleSupport.****
>>>>>>> fireLifecycleEvent(**
>>>>>>> LifecycleSupport.java:119)
>>>>>>>        at org.apache.catalina.util.********LifecycleBase.****
>>>>>>> fireLifecycleEvent(**
>>>>>>> LifecycleBase.java:90)
>>>>>>>        at org.apache.catalina.util.********LifecycleBase.****
>>>>>>> setStateInternal(**
>>>>>>> LifecycleBase.java:401)
>>>>>>>        at org.apache.catalina.util.********LifecycleBase.start(**
>>>>>>> LifecycleBase.java:168)
>>>>>>>        at org.apache.catalina.core.********ContainerBase.****
>>>>>>> addChildInternal(**
>>>>>>> ContainerBase.java:895)
>>>>>>>        at org.apache.catalina.core.********ContainerBase.addChild(**
>>>>>>> ContainerBase.java:871)
>>>>>>>        at org.apache.catalina.core.********StandardHost.addChild(**
>>>>>>> StandardHost.java:615)
>>>>>>>        at org.apache.catalina.startup.******
>>>>>>> **HostConfig.deployDescriptor(******
>>>>>>> HostConfig.java:649)
>>>>>>>        at org.apache.catalina.startup.****
>>>>>>> ****HostConfig.deployApps(**
>>>>>>> HostConfig.java:530)
>>>>>>>        at org.apache.catalina.startup.******
>>>>>>> **HostConfig.check(HostConfig.******
>>>>>>> java:1471)
>>>>>>>        at sun.reflect.********NativeMethodAccessorImpl.********
>>>>>>> invoke0(Native
>>>>>>> Method)
>>>>>>>        at sun.reflect.********NativeMethodAccessorImpl.*******
>>>>>>> *invoke(**
>>>>>>> NativeMethodAccessorImpl.java:********57)
>>>>>>>        at sun.reflect.********DelegatingMethodAccessorImpl.*****
>>>>>>> ***invoke(**
>>>>>>> DelegatingMethodAccessorImpl.********java:43)
>>>>>>>        at java.lang.reflect.Method.********invoke(Method.java:601)
>>>>>>>        at org.apache.tomcat.util.********
>>>>>>> modeler.BaseModelMBean.invoke(****
>>>>>>> ****
>>>>>>> BaseModelMBean.java:301)
>>>>>>>        at com.sun.jmx.interceptor.********
>>>>>>> DefaultMBeanServerInterceptor.***
>>>>>>> ***
>>>>>>> **invoke(**
>>>>>>> DefaultMBeanServerInterceptor.********java:819)
>>>>>>>        at com.sun.jmx.mbeanserver.********JmxMBeanServer.invoke(**
>>>>>>> JmxMBeanServer.java:791)
>>>>>>>        at org.apache.catalina.manager.****
>>>>>>> ****ManagerServlet.check(**
>>>>>>> ManagerServlet.java:1436)
>>>>>>>        at org.apache.catalina.manager.****
>>>>>>> ****ManagerServlet.deploy(**
>>>>>>> ManagerServlet.java:856)
>>>>>>>        at org.apache.catalina.manager.****
>>>>>>> ****ManagerServlet.doGet(**
>>>>>>> ManagerServlet.java:353)
>>>>>>>        at javax.servlet.http.********HttpServlet.service(****
>>>>>>> HttpServlet.java:621)
>>>>>>>        at javax.servlet.http.********HttpServlet.service(****
>>>>>>> HttpServlet.java:722)
>>>>>>>        at org.apache.catalina.core.********ApplicationFilterChain.**
>>>>>>> internalDoFilter(********ApplicationFilterChain.java:********305)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *ApplicationFilterChain.****
>>>>>>> doFilter(**
>>>>>>> ApplicationFilterChain.java:********210)
>>>>>>>        at org.apache.catalina.filters.******
>>>>>>> **SetCharacterEncodingFilter.******
>>>>>>> doFilter(********SetCharacterEncodingFilter.********java:108)
>>>>>>>        at org.apache.catalina.core.********ApplicationFilterChain.**
>>>>>>> internalDoFilter(********ApplicationFilterChain.java:********243)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *ApplicationFilterChain.****
>>>>>>> doFilter(**
>>>>>>> ApplicationFilterChain.java:********210)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardWrapperValve.invoke(****
>>>>>>> StandardWrapperValve.java:225)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardContextValve.invoke(****
>>>>>>> StandardContextValve.java:169)
>>>>>>>        at org.apache.tomee.catalina.********OpenEJBValve.invoke(**
>>>>>>> OpenEJBValve.java:44)
>>>>>>>        at org.apache.catalina.********authenticator.****
>>>>>>> AuthenticatorBase.invoke(**
>>>>>>> AuthenticatorBase.java:581)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardHostValve.invoke(**
>>>>>>> StandardHostValve.java:168)
>>>>>>>        at org.apache.catalina.valves.*****
>>>>>>> ***ErrorReportValve.invoke(**
>>>>>>> ErrorReportValve.java:98)
>>>>>>>        at org.apache.catalina.valves.*****
>>>>>>> ***AccessLogValve.invoke(**
>>>>>>> AccessLogValve.java:927)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardEngineValve.invoke(**
>>>>>>> StandardEngineValve.java:118)
>>>>>>>        at org.apache.catalina.connector.**
>>>>>>> ******CoyoteAdapter.service(**
>>>>>>> CoyoteAdapter.java:407)
>>>>>>>        at org.apache.coyote.http11.*******
>>>>>>> *AbstractHttp11Processor.****
>>>>>>> process(**
>>>>>>> AbstractHttp11Processor.java:********999)
>>>>>>>        at org.apache.coyote.********AbstractProtocol$****
>>>>>>> AbstractConnectionHandler.**
>>>>>>> process(AbstractProtocol.java:********565)
>>>>>>>        at org.apache.tomcat.util.net.*******
>>>>>>> *JIoEndpoint$SocketProcessor.******
>>>>>>> run(JIoEndpoint.java:309)
>>>>>>>        at java.util.concurrent.********
>>>>>>> ThreadPoolExecutor.runWorker(*****
>>>>>>> ***
>>>>>>> ThreadPoolExecutor.java:1110)
>>>>>>>        at java.util.concurrent.********
>>>>>>> ThreadPoolExecutor$Worker.run(****
>>>>>>> ****
>>>>>>> ThreadPoolExecutor.java:603)
>>>>>>>        at java.lang.Thread.run(Thread.********java:722)
>>>>>>>
>>>>>>>
>>>>>>> Jul 08, 2012 4:40:43 PM org.apache.tomee.catalina.****
>>>>>>> TomcatWebAppBuilder
>>>>>>> safeBind
>>>>>>> SEVERE: Error in safeBind method
>>>>>>> javax.naming.********NameNotFoundException: No HandleDelegate
>>>>>>> registered
>>>>>>> with
>>>>>>> the OpenEJB system
>>>>>>>        at org.apache.openejb.core.ivm.********naming.****
>>>>>>> SystemComponentReference.**
>>>>>>> getObject(********SystemComponentReference.java:********38)
>>>>>>>        at org.apache.openejb.core.ivm.******
>>>>>>> **naming.Reference.getContent(******
>>>>>>> Reference.java:40)
>>>>>>>        at org.apache.xbean.naming.********
>>>>>>> reference.SimpleReference$**
>>>>>>> SimpleObjectFactory.********getObjectInstance(******
>>>>>>> SimpleReference.java:137)
>>>>>>>        at javax.naming.spi.********NamingManager.******
>>>>>>> getObjectInstance(**
>>>>>>> NamingManager.java:321)
>>>>>>>        at org.apache.naming.********NamingContext.lookup(****
>>>>>>> NamingContext.java:843)
>>>>>>>        at org.apache.naming.********NamingContext.lookup(****
>>>>>>> NamingContext.java:168)
>>>>>>>        at org.apache.tomee.catalina.********
>>>>>>> TomcatWebAppBuilder.safeBind(********
>>>>>>> TomcatWebAppBuilder.java:1196)
>>>>>>>        at org.apache.tomee.catalina.********TomcatWebAppBuilder.****
>>>>>>> afterStart(**
>>>>>>> TomcatWebAppBuilder.java:807)
>>>>>>>        at org.apache.tomee.catalina.******
>>>>>>> **GlobalListenerSupport.****
>>>>>>> lifecycleEvent(
>>>>>>> **GlobalListenerSupport.java:********103)
>>>>>>>        at org.apache.catalina.util.********LifecycleSupport.****
>>>>>>> fireLifecycleEvent(**
>>>>>>> LifecycleSupport.java:119)
>>>>>>>        at org.apache.catalina.util.********LifecycleBase.****
>>>>>>> fireLifecycleEvent(**
>>>>>>> LifecycleBase.java:90)
>>>>>>>        at org.apache.catalina.util.********LifecycleBase.****
>>>>>>> setStateInternal(**
>>>>>>> LifecycleBase.java:401)
>>>>>>>        at org.apache.catalina.util.********LifecycleBase.start(**
>>>>>>> LifecycleBase.java:168)
>>>>>>>        at org.apache.catalina.core.********ContainerBase.****
>>>>>>> addChildInternal(**
>>>>>>> ContainerBase.java:895)
>>>>>>>        at org.apache.catalina.core.********ContainerBase.addChild(**
>>>>>>> ContainerBase.java:871)
>>>>>>>        at org.apache.catalina.core.********StandardHost.addChild(**
>>>>>>> StandardHost.java:615)
>>>>>>>        at org.apache.catalina.startup.******
>>>>>>> **HostConfig.deployDescriptor(******
>>>>>>> HostConfig.java:649)
>>>>>>>        at org.apache.catalina.startup.****
>>>>>>> ****HostConfig.deployApps(**
>>>>>>> HostConfig.java:530)
>>>>>>>        at org.apache.catalina.startup.******
>>>>>>> **HostConfig.check(HostConfig.******
>>>>>>> java:1471)
>>>>>>>        at sun.reflect.********NativeMethodAccessorImpl.********
>>>>>>> invoke0(Native
>>>>>>> Method)
>>>>>>>        at sun.reflect.********NativeMethodAccessorImpl.*******
>>>>>>> *invoke(**
>>>>>>> NativeMethodAccessorImpl.java:********57)
>>>>>>>        at sun.reflect.********DelegatingMethodAccessorImpl.*****
>>>>>>> ***invoke(**
>>>>>>> DelegatingMethodAccessorImpl.********java:43)
>>>>>>>        at java.lang.reflect.Method.********invoke(Method.java:601)
>>>>>>>        at org.apache.tomcat.util.********
>>>>>>> modeler.BaseModelMBean.invoke(****
>>>>>>> ****
>>>>>>> BaseModelMBean.java:301)
>>>>>>>        at com.sun.jmx.interceptor.********
>>>>>>> DefaultMBeanServerInterceptor.***
>>>>>>> ***
>>>>>>> **invoke(**
>>>>>>> DefaultMBeanServerInterceptor.********java:819)
>>>>>>>        at com.sun.jmx.mbeanserver.********JmxMBeanServer.invoke(**
>>>>>>> JmxMBeanServer.java:791)
>>>>>>>        at org.apache.catalina.manager.****
>>>>>>> ****ManagerServlet.check(**
>>>>>>> ManagerServlet.java:1436)
>>>>>>>        at org.apache.catalina.manager.****
>>>>>>> ****ManagerServlet.deploy(**
>>>>>>> ManagerServlet.java:856)
>>>>>>>        at org.apache.catalina.manager.****
>>>>>>> ****ManagerServlet.doGet(**
>>>>>>> ManagerServlet.java:353)
>>>>>>>        at javax.servlet.http.********HttpServlet.service(****
>>>>>>> HttpServlet.java:621)
>>>>>>>        at javax.servlet.http.********HttpServlet.service(****
>>>>>>> HttpServlet.java:722)
>>>>>>>        at org.apache.catalina.core.********ApplicationFilterChain.**
>>>>>>> internalDoFilter(********ApplicationFilterChain.java:********305)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *ApplicationFilterChain.****
>>>>>>> doFilter(**
>>>>>>> ApplicationFilterChain.java:********210)
>>>>>>>        at org.apache.catalina.filters.******
>>>>>>> **SetCharacterEncodingFilter.******
>>>>>>> doFilter(********SetCharacterEncodingFilter.********java:108)
>>>>>>>        at org.apache.catalina.core.********ApplicationFilterChain.**
>>>>>>> internalDoFilter(********ApplicationFilterChain.java:********243)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *ApplicationFilterChain.****
>>>>>>> doFilter(**
>>>>>>> ApplicationFilterChain.java:********210)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardWrapperValve.invoke(****
>>>>>>> StandardWrapperValve.java:225)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardContextValve.invoke(****
>>>>>>> StandardContextValve.java:169)
>>>>>>>        at org.apache.tomee.catalina.********OpenEJBValve.invoke(**
>>>>>>> OpenEJBValve.java:44)
>>>>>>>        at org.apache.catalina.********authenticator.****
>>>>>>> AuthenticatorBase.invoke(**
>>>>>>> AuthenticatorBase.java:581)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardHostValve.invoke(**
>>>>>>> StandardHostValve.java:168)
>>>>>>>        at org.apache.catalina.valves.*****
>>>>>>> ***ErrorReportValve.invoke(**
>>>>>>> ErrorReportValve.java:98)
>>>>>>>        at org.apache.catalina.valves.*****
>>>>>>> ***AccessLogValve.invoke(**
>>>>>>> AccessLogValve.java:927)
>>>>>>>        at org.apache.catalina.core.*******
>>>>>>> *StandardEngineValve.invoke(**
>>>>>>> StandardEngineValve.java:118)
>>>>>>>        at org.apache.catalina.connector.**
>>>>>>> ******CoyoteAdapter.service(**
>>>>>>> CoyoteAdapter.java:407)
>>>>>>>        at org.apache.coyote.http11.*******
>>>>>>> *AbstractHttp11Processor.****
>>>>>>> process(**
>>>>>>> AbstractHttp11Processor.java:********999)
>>>>>>>        at org.apache.coyote.********AbstractProtocol$****
>>>>>>> AbstractConnectionHandler.**
>>>>>>> process(AbstractProtocol.java:********565)
>>>>>>>        at org.apache.tomcat.util.net.*******
>>>>>>> *JIoEndpoint$SocketProcessor.******
>>>>>>> run(JIoEndpoint.java:309)
>>>>>>>        at java.util.concurrent.********
>>>>>>> ThreadPoolExecutor.runWorker(*****
>>>>>>> ***
>>>>>>> ThreadPoolExecutor.java:1110)
>>>>>>>        at java.util.concurrent.********
>>>>>>> ThreadPoolExecutor$Worker.run(****
>>>>>>> ****
>>>>>>> ThreadPoolExecutor.java:603)
>>>>>>>        at java.lang.Thread.run(Thread.********java:722)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 7/8/2012 4:32 PM, Romain Manni-Bucau wrote:
>>>>>>>
>>>>>>>    i don't think so,
>>>>>>>
>>>>>>>  can you try moving your code in a unit test to see if it still
>>>>>>>> happen?
>>>>>>>>
>>>>>>>> - Romain
>>>>>>>>
>>>>>>>>
>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>
>>>>>>>>     Could it be the Tomcat JDBCRealm I have enforcing container
>>>>>>>> managed
>>>>>>>>
>>>>>>>>   security from user data in the same table?
>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 7/8/2012 4:14 PM, Romain Manni-Bucau wrote:
>>>>>>>>>
>>>>>>>>>     i can't say no but i'm pretty sure it is something in the
>>>>>>>>> container
>>>>>>>>>
>>>>>>>>>   rather
>>>>>>>>>
>>>>>>>>>> in the DB.
>>>>>>>>>>
>>>>>>>>>> - Romain
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>
>>>>>>>>>>      Maybe the DB settings could have something to do with it? I'm
>>>>>>>>>> using
>>>>>>>>>> MySQL
>>>>>>>>>>
>>>>>>>>>>    with it's default setup which uses InnoDB.  I notice in the
>>>>>>>>>>
>>>>>>>>>>  documentation
>>>>>>>>>>> that "InnoDB, with innodb_flush_log_at_trx_commit set to 1,
>>>>>>>>>>> flushes
>>>>>>>>>>> the
>>>>>>>>>>> transaction log after each transaction, greatly improving
>>>>>>>>>>> reliability."
>>>>>>>>>>>
>>>>>>>>>>> Could some DB setting like this be causing the issue?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 7/8/2012 3:39 PM, Romain Manni-Bucau wrote:
>>>>>>>>>>>
>>>>>>>>>>>      can you share a small sample to reproduce it, will be
>>>>>>>>>>> easier to
>>>>>>>>>>> help
>>>>>>>>>>>
>>>>>>>>>>>    you?
>>>>>>>>>>>
>>>>>>>>>>>  - Romain
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>>>
>>>>>>>>>>>>       Not that I've configured.. Unless one of the annotations
>>>>>>>>>>>> creates
>>>>>>>>>>>> one:
>>>>>>>>>>>>
>>>>>>>>>>>>     @Entity
>>>>>>>>>>>>
>>>>>>>>>>>>   @Table(name = "user")
>>>>>>>>>>>>
>>>>>>>>>>>>> @XmlRootElement
>>>>>>>>>>>>> @NamedQueries({
>>>>>>>>>>>>>           @NamedQuery(name = "User.findAll", query = "SELECT u
>>>>>>>>>>>>> FROM
>>>>>>>>>>>>> User
>>>>>>>>>>>>> u"),
>>>>>>>>>>>>>           @NamedQuery(name = "User.findByUserId", query =
>>>>>>>>>>>>> "SELECT
>>>>>>>>>>>>> u
>>>>>>>>>>>>> FROM
>>>>>>>>>>>>> User
>>>>>>>>>>>>> u
>>>>>>>>>>>>> WHERE u.userId = :userId"),
>>>>>>>>>>>>>           @NamedQuery(name = "User.findByUserName", query =
>>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>>> FROM
>>>>>>>>>>>>> User
>>>>>>>>>>>>> u WHERE u.userName = :userName"),
>>>>>>>>>>>>>           @NamedQuery(name = "User.findByPassword", query =
>>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>>> FROM
>>>>>>>>>>>>> User
>>>>>>>>>>>>> u WHERE u.password = :password"),
>>>>>>>>>>>>>           @NamedQuery(name = "User.findByEmail", query =
>>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>>> FROM
>>>>>>>>>>>>> User u
>>>>>>>>>>>>> WHERE u.email = :email"),
>>>>>>>>>>>>>           @NamedQuery(name = "User.findByFirstName", query =
>>>>>>>>>>>>> "SELECT
>>>>>>>>>>>>> u
>>>>>>>>>>>>> FROM
>>>>>>>>>>>>> User
>>>>>>>>>>>>> u WHERE u.firstName = :firstName"),
>>>>>>>>>>>>>           @NamedQuery(name = "User.findByLastName", query =
>>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>>> FROM
>>>>>>>>>>>>> User
>>>>>>>>>>>>> u WHERE u.lastName = :lastName"),
>>>>>>>>>>>>>           @NamedQuery(name = "User.findByLoginFailures", query
>>>>>>>>>>>>> =
>>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>>> FROM
>>>>>>>>>>>>> User u WHERE u.loginFailures = :loginFailures"),
>>>>>>>>>>>>>           @NamedQuery(name = "User.findByLastLoginFailure",
>>>>>>>>>>>>> query
>>>>>>>>>>>>> =
>>>>>>>>>>>>> "SELECT u
>>>>>>>>>>>>> FROM User u WHERE u.lastLoginFailure = :lastLoginFailure")})
>>>>>>>>>>>>> public class User implements Serializable {
>>>>>>>>>>>>>           private static final long serialVersionUID = 1L;
>>>>>>>>>>>>>           @Id
>>>>>>>>>>>>>           @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>>>>>>>>>>>           @Basic(optional = false)
>>>>>>>>>>>>>           @Column(name = "user_id")
>>>>>>>>>>>>>           private Integer userId;
>>>>>>>>>>>>>           @Basic(optional = false)
>>>>>>>>>>>>>           @Column(name = "user_name")
>>>>>>>>>>>>>           private String userName;
>>>>>>>>>>>>>           @Basic(optional = false)
>>>>>>>>>>>>>           @Column(name = "password")
>>>>>>>>>>>>>           private String password;
>>>>>>>>>>>>>           @Column(name = "email")
>>>>>>>>>>>>>           private String email;
>>>>>>>>>>>>>           @Column(name = "first_name")
>>>>>>>>>>>>>           private String firstName;
>>>>>>>>>>>>>           @Column(name = "last_name")
>>>>>>>>>>>>>           private String lastName;
>>>>>>>>>>>>>           @Column(name = "login_failures")
>>>>>>>>>>>>>           private Integer loginFailures;
>>>>>>>>>>>>>           @Column(name = "last_login_failure")
>>>>>>>>>>>>>           @Temporal(TemporalType.**************TIMESTAMP)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>           private Date lastLoginFailure;
>>>>>>>>>>>>>           @JoinColumn(name = "associated_customer",
>>>>>>>>>>>>> referencedColumnName =
>>>>>>>>>>>>> "customer_id")
>>>>>>>>>>>>>           @ManyToOne
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 7/8/2012 3:25 PM, Romain Manni-Bucau wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>       Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>>     any entity listener playing with id or special field on
>>>>>>>>>>>>> User
>>>>>>>>>>>>> entity?
>>>>>>>>>>>>>
>>>>>>>>>>>>>   - Romain
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 2012/7/8 David Nordahl<[hidden email]>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>        I'm attempting the code:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>      Properties properties = new Properties();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>    properties.setProperty(***********
>>>>>>>>>>>>>> *****Context.INITIAL_CONTEXT_*********
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  ****
>>>>>>>>>>>>>>> ***
>>>>>>>>>>>>>>> FACTORY,
>>>>>>>>>>>>>>> "org.apache.openejb.client.******************
>>>>>>>>>>>>>>> LocalInitialContextFactory"**)********;
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> InitialContext initialContext = new
>>>>>>>>>>>>>>> InitialContext(properties);
>>>>>>>>>>>>>>> Object object = initialContext.lookup("***************
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> *UserFacadeLocal");
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> UserFacadeLocal userFacade = (UserFacadeLocal) object;
>>>>>>>>>>>>>>> User newuser = new User();
>>>>>>>>>>>>>>> newuser.setEmail("[hidden email]"****************);
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> newuser.setUserName("steve");
>>>>>>>>>>>>>>> newuser.setPassword("cows");
>>>>>>>>>>>>>>> userFacade.create(newuser);
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> but keep getting "org.apache.openjpa.****************
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> persistence.****
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> InvalidStateException:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Detected reentrant flush.  Make sure your flush-time instance
>>>>>>>>>>>>>>> callback
>>>>>>>>>>>>>>> methods or event listeners do not invoke any operations that
>>>>>>>>>>>>>>> require
>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>> in-progress flush to complete."
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I tried setting "openjpa.FlushBeforeQueries" to false just to
>>>>>>>>>>>>>>> see
>>>>>>>>>>>>>>> if
>>>>>>>>>>>>>>> I
>>>>>>>>>>>>>>> can
>>>>>>>>>>>>>>> get the error to go away, but it makes no difference.  I
>>>>>>>>>>>>>>> can't
>>>>>>>>>>>>>>> find a
>>>>>>>>>>>>>>> flush() call in my project and according to the table in the
>>>>>>>>>>>>>>> docs,
>>>>>>>>>>>>>>> flush
>>>>>>>>>>>>>>> is
>>>>>>>>>>>>>>> not called if this parameter is set.  What am I not doing
>>>>>>>>>>>>>>> correctly
>>>>>>>>>>>>>>> here?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thank you,
>>>>>>>>>>>>>>> David
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Exceptions in my deployed environment

slimsalmon
In reply to this post by Romain Manni-Bucau
I'm having trouble making TomEE happy on my deployed server and I'm not
sure what is different from my dev environment.  Basically I have my EJB
class files included in a jar in the lib folder of TomEE as well as in
my deployed WAR web app.

When EJBs are invoked, I get exceptions like:

ClassCastException: cannot convert class A to class A.

I also get exceptions about duplicate NamedQuery's.

So I assume duplicate instances of class files present and TomEE is not
able to sort this out for some reason.  So if I remove the EJB classes
contained in the /lib folder jar of my class files, I get:

WARNING: Meta class "com.company.entities.Customer_" for entity class
com.company.entities.Customer can not be registered with following
exception "java.security.PrivilegedActionException:
java.lang.ClassNotFoundException: com.company.entities.Customer_"
Aug 17, 2012 12:39:26 PM null

Any advice regarding what I might be doing wrong ?  2-1 seems to equal 0
here :-)




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Exceptions in my deployed environment

Romain Manni-Bucau
Did you generate jpa meta classes?
Le 17 août 2012 22:14, "David Nordahl" <[hidden email]> a écrit :

> I'm having trouble making TomEE happy on my deployed server and I'm not
> sure what is different from my dev environment.  Basically I have my EJB
> class files included in a jar in the lib folder of TomEE as well as in my
> deployed WAR web app.
>
> When EJBs are invoked, I get exceptions like:
>
> ClassCastException: cannot convert class A to class A.
>
> I also get exceptions about duplicate NamedQuery's.
>
> So I assume duplicate instances of class files present and TomEE is not
> able to sort this out for some reason.  So if I remove the EJB classes
> contained in the /lib folder jar of my class files, I get:
>
> WARNING: Meta class "com.company.entities.**Customer_" for entity class
> com.company.entities.Customer can not be registered with following
> exception "java.security.**PrivilegedActionException: java.lang.**ClassNotFoundException:
> com.company.entities.Customer_**"
> Aug 17, 2012 12:39:26 PM null
>
> Any advice regarding what I might be doing wrong ?  2-1 seems to equal 0
> here :-)
>
>
>
>
>
12
Loading...