PDA

View Full Version : Documentation for testing



sat_1729
01-02-2006, 07:11 AM
hi

I have done some reports using pentaho
On those examples i called pentaho from my application through URL
but i know we can call it directly from java object

The problem is i have not find any documents for using the pentaho as a jar file and how to se the pentah-solution path and everything ...

I tried to call as we have it in ReportingTest.java

but i got the following error


20:32:07,997 ERROR [Logger] misc-org.pentaho.system.PentahoSystem: Error while trying to execute startup sequence for {0}org.pentaho.scheduler.QuartzSystemListener
20:32:09,047 ERROR [HibernateUtil] HIBUTIL.ERROR_0006 - Building SessionFactory failed.
java.lang.NullPointerException
at org.pentaho.repository.HibernateUtil.initialize(HibernateUtil.java:90)
at org.pentaho.repository.HibernateUtil.(HibernateUtil.java:57)
at org.pentaho.repository.runtime.RuntimeRepository.setSession(RuntimeRepository.java:67)
at org.pentaho.repository.runtime.RuntimeRepository.getInstance(RuntimeRepository.java:59)
at org.pentaho.solution.SolutionEngine.execute(SolutionEngine.java:110)
at org.pentaho.test.BaseTest.run(BaseTest.java:196)
at org.pentaho.test.BaseTest.run(BaseTest.java:176)
at org.pentaho.test.BaseTest.run(BaseTest.java:158)
at org.pentaho.test.BaseTest.run(BaseTest.java:138)
at org.pentaho.test.RuntimeTest.testComponent(RuntimeTest.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
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)


can i get any assistance in this regard , as a document ...


regards,
siva

gmoran
01-02-2006, 05:14 PM
Hi Siva,

You are on the right track - the startup of the platform can be found in the JUnit tests in the org.pentaho.test directory, which runs the platform engine as a standalone application instead of as a J2EE app.

The platform will by default look for the Quartz database on startup to initialize it. The Quartz database is necessary for the scheduling functionality within the platform. So you must make sure that the Quartz database is up and running and can be found by the platform. This means that the appropriate JDBC driver needs to be on your classpath (if you are using the sample databases, this would be the hsqldb.jar that ships with the sample databases), and the database should be up and running when you try to initialize the platform.

If you don't need the scheduler, you can disable the initialization by commenting out the following line in your pentaho.xml file, in the solutions/system directory:


<quartz>org.pentaho.scheduler.QuartzSystemListener</quartz>

You will need to set the solutionPath on the constructor to the StandaloneApplicationContext (see the setUp() method in the BaseTest class, the class that ReportingTest descends from).


StandaloneApplicationContext applicationContext = new StandaloneApplicationContext(YOUR_SOLUTION_PATH, "" );

Let me know if this helps - or if you need further clarification.
best regards,
Gretchen

snyderpa
07-25-2006, 07:37 AM
In case my experience will help someone, I began with this same error message on a Redhat Enterprise Linux 4 system with the Pre-Configured Installation. How I resolved my problem (this one, anyway:)

1. cd to <pentaho-demo>/data
2. execute ./start-hypersonic.sh
3. verified that the four datasources all failed to open -- the error was
org.hsqldb.HsqlException General Error java.lang.Error not implemented
4. execute
which java
5. verified that the system's java command was not pointed to my jdk installation, but was going to a symbolic link in /usr/bin to a jre
6. modified the system's symbolic links to point to my jdk (I'm not sure whether this will cause problems in other applications)
7. re-execute ./start-hypersonic.sh
8. now for me, all is well, I hope for you too!