2 Replies Latest reply on Jan 10, 2006 4:41 PM by forjbpm

    Null Exception when identity.db.xml is not null????

    forjbpm

      When I try to run my test program I get error at following line


      IdentityXmlParser.parseEntitiesResource("JBPM_HOME/jbpm/src/resources/hsqldb/identity.db.xml");


      as
      java.lang.RuntimeException: couldn't parse identities from stream 'null'
      at org.jbpm.identity.xml.IdentityXmlParser.parse(IdentityXmlParser.java:43)
      at org.jbpm.identity.xml.IdentityXmlParser.parse(IdentityXmlParser.java:35)
      at org.jbpm.identity.xml.IdentityXmlParser.parseEntitiesResource(IdentityXmlParser.java:27)
      at com.GenMonDec.GenMonDecTest.setUp(GenMonDecTest.java:38)
      at junit.framework.TestCase.runBare(TestCase.java:125)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)



      when my identity.db.xml file is not null It has usual content as
      <identity>
       <user name="cookie monster" email="cookie.monster@sesamestreet.tv" password="crunchcrunch" />
       <user name="ernie" email="ernie@sesamestreet.tv" password="canthereyoubert,theresabananainmyear" />
       <user name="bert" email="bert@sesamestreet.tv" password="ernie,theresabananainyourear" />
       <user name="grover" email="grover@sesamestreet.tv" password="mayday mayday" />
      </identity>
      

      Can anyone tell me the reason???

      Thanks!


        • 1. Re: Null Exception when identity.db.xml is not null????
          aguizar

          I guess the JBPM_HOME substring stands for an absolute path in your file system, right? In that case the form of parseEntitiesResource() that takes a String is not the right one to use, because the string identifies a resource in your classpath. Try this instead

          InputStream entitiesStream = new BufferedInputStream(new FileInputStream("JBPM_HOME/jbpm/src/resources/hsqldb/identity.db.xml"));
          Entity[] entities = IdentityXmlParser.parseEntitiesResource(entitiesStream);
          entitiesStream.close();


          • 2. Re: Null Exception when identity.db.xml is not null????
            forjbpm

            This worked!

            But Just FYI Even If I provide full path like
            "/home/jbpm-starters-kit-3.0.2/..." I get same error in previous case but solution you have provided works perfect in either case.

            Thanks Again!