0

I'm developing a web application. WildFly 8.1, SQL Server 2012 I have a problem in my local environment, even though the code and the state of the database is identical to preproduction, where everything works fine.

1) I just restored my database from preproduction database, so the database is identical.

2) I checked out on the same changeset that is used in preproduction. So the code is identical.

There's a feature where I'm making a native SQL query to the database.

select IIF(number.accountnumber is not null,number.accountnumber,def.accountnumber)
from salesaccountnumber def 
left join salesaccountnumber number on 
  number.fk_service = def.fk_service 
and number.pricetitle= 'STARTINGPRICE'
where def.pricetitle = 'STARTINGPRICE' 
and def.fk_service = 2

The query mentioned above works just fine when I execute it in SQL Management Studio.

On every other developer's environment and in preproduction it works as intended, but on my development environment where the code and the state of the database are IDENTICAL to their preproduction equivalents, I get the following Exception when getting single result from that query:

12:16:44,934 ERROR [my.project.BillingAction] (default task-59) [SESSION=Gvo7TGbOw4nIPo6p_WphSUrn]Could not build/send INVOICE out of bill : javax.persistence.PersistenceException: org.hibernate.HibernateException: Provider is closed!
12:16:44,935 ERROR [stderr] (default task-59) javax.persistence.PersistenceException: org.hibernate.HibernateException: Provider is closed!

I have no other problems in my local environment compared to the preproduction.

None of us has ever seen this Exception before, so, any ideas where to even start to look for the explanation?

Steve Waters
  • 3,348
  • 9
  • 54
  • 94
  • 1
    from the exception it looks like hibernate is not able to obtain a connection to the db. – robot_alien May 29 '17 at 09:54
  • @coolgirl, that would be strange since the db connection has no problems anywhere else in the application, though. – Steve Waters May 29 '17 at 10:10
  • 1
    If you are using EJB, do you have this in your `persistence.xml` file? It should be altogether on a single line `org.hibernate.ejb.HibernatePersistence` – robot_alien May 29 '17 at 10:38
  • I'll try that. I don't have that line in persistence.xml but that file is in the repository and other developers don't have this problem. – Steve Waters May 29 '17 at 11:03

1 Answers1

0

I had to update the JRebel IntelliJ IDEA plugin to the latest 7.0.9 version and that fixed the problem. So it was a bug in JRebel after all.

Steve Waters
  • 3,348
  • 9
  • 54
  • 94
  • 1
    sometimes JRebel doesn't pick up the new changes as well as the jars. So a build is required mostly when you so a git pull/ checkout code from the svn. Also if possible you can try restarting your server, may be a timeout in connection is also a cause for the above error. Also keep posting your findings so that I know what had happened. Thanks! :) – robot_alien May 30 '17 at 12:51
  • 1
    @coolgirl, hey I contacted the authors of JRebel and they asked me to update the plugin, which I did AND NOW IT WORKS! – Steve Waters May 30 '17 at 15:02
  • 1
    great to hear that! :-) – robot_alien May 30 '17 at 17:34