File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes MySql, JBoss error: NPE @ .beginloadtask Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "MySql, JBoss error: NPE @ .beginloadtask" Watch "MySql, JBoss error: NPE @ .beginloadtask" New topic

MySql, JBoss error: NPE @ .beginloadtask

Andrew Lohans

Joined: May 16, 2005
Posts: 4
Hey gang,

Here's my error - I'm running MySQL ver 4.0, with struts 1.2.4, hibernate 2 & jboss version 4.0.1. I use Windows XP, and the MySQL server was started with the net start MySQL command. Sadly, I don't have internet access at home (just moved in) so I'm going to be a bit loose with the details - I'll put in the full error message tomorrow if need be.

Essentially, when I do a search on the database from the webapp that I've deployed, I get a:
at 153)
... (some more errors here)
at java.util.timerThread.mainloop ( 432)
at ( 382)
... (and some more here too)

This error, as far as I can tell, is related to MySQL - but seeing as it's a jboss error spat out, I've snuck it in here. The reason I suspect MySQL is that if I run a net stop MySQL command on the cmd prompt, then net start MySQL again, I can pull from the database.

I threw in c3p0 into the mix, and foud that after about 2 hours c3p0 lost connection with MySQL - effectively throwing the above error with [INFO] statements.

I'm not too familiar with MySQL here - I thought it disconnected after 8hrs generally - could this be the case? If so, isn't the datapool meant to handle this? I'd appreciate any help in the matter!

Daniel Webster

Joined: Dec 04, 2003
Posts: 1
I get the exact same exception and same line number problem when redeploying Cryptix PGP in jboss:

This only happens when I reload my web app from hot-deploy. That is,
  • I can deploy the web application before I start the server, start the server, and it starts fine.
  • I can start the server without the webapp, then deploy the webapp, and the program starts fine
  • If I have the webapp running, then deploy the new webapp over it, it bombs.

  • This is the exact line of code that gives the error. I have a minimal test case that loads this line in a server upon startup:

    I am running jboss 4.0.1 with cryptix (recent version, cannot find version number). I was wondering if this points to some more general problem in the jboss classloader instead of a cryptix or MySql problem?
    [ May 23, 2005: Message edited by: Daniel Webster ]
    Rick Merc

    Joined: Jun 10, 2005
    Posts: 1
    I am getting exact same error:

    2005-06-10 22:32:15,848 ERROR [org.jboss.web.localhost.Engine] ApplicationDispatcher[/hrub] Servlet.service() for servlet jsp threw exception
    at java.lang.ClassLoader.loadClass(
    at java.lang.ClassLoader.loadClassInternal(
    at java.lang.Class.forName0(Native Method)

    Again this happens during hot redeployment only. I am using jboss 4.0.1.sp1 with mysql. I tried net stop mysql but to no avail.
    micke berg

    Joined: Jun 15, 2005
    Posts: 1
    I have also have the same problem. No errormessages at deploy/startup of the server.
    Using jboss-4.0.1RC2, j2sdk1.4.2_06, mysql-4.1.12-win32 running it all in winXP. Building an application with Hibernate2 and springframework.

    Oystein Pettersen

    Joined: Jun 15, 2005
    Posts: 2
    Yup get the same error. Using jboss 4.0.1, mysql, hibernate and spring.

    This is also only when I hot deploy over a current running version of my app.

    I also think that this is a jboss classloading thing. My theory is that if I move my dep jars from my "war lib" location to jboss/server/default/lib then the classloader will not get so confused.

    The reason why I have not tested this before is that I want my app to be self contained. This means that everything that the app needs should be in the war.

    I'll try this now and repost.

    [ June 15, 2005: Message edited by: Oystein Pettersen ]
    Oystein Pettersen

    Joined: Jun 15, 2005
    Posts: 2
    This page shows that this is a problem in the JBossMX. The issue is still open.

    I got rid of the NPE by adding the mysql-connector.jar to the jboss/server/default/lib directory.

    I do not like this bug workaround but I helps me avoiding to stop and start the jboss all the time.

    [ June 15, 2005: Message edited by: Oystein Pettersen ]
    I agree. Here's the link:
    subject: MySql, JBoss error: NPE @ .beginloadtask
    It's not a secret anymore!