Subject:Exception in generated java code Author:Vincent De Groote Date:07 Sep 2007 07:07 AM
I'm new with Stylus Studio and Java. I've build a pipeline which runs successfully when invoked from Stylus Studio. When I generate the java code, the compilation is successfull, but the program ends on a null pointer exception:
Exception in thread "main" com.stylusstudio.xmlpipeline.runtime.PipelineException: main: exception during init().
Caused by: java.lang.NullPointerException
... 3 more
You seem to have found a bug in my code.
The generated java file contains a line like this:
m_DDXQCollectionSet.add("sqlserver_null_localhost1433", "jdbc:xquery:sqlserver://localhost:1433", null, "", true, "full");
The collection url in your xquery seems to be missing a userid. It is a little bit of a mystery to us right now how that could happen.
Our first question is: Are you using Windows integrated security to access the database, or the builtin database security?
If you are using Windows integrated security, the jdbc: url should contain a field AuthenticationMethod=Type2
If you are not using Windows integrated security, then you must supply a userid when you first connect to the database using the Stylus Studio file explorer docking windows.
We would like to know exactly how you are connecting to the database in Stylus Studio.
Anyway, as a temporary workaround to fix the java program, you can replace the first null parameter with a valid userid like this:
Subject:Exception in generated java code Author:Vincent De Groote Date:12 Sep 2007 04:14 AM
I was using the Windows authentication mode. I didn't need to provide any userid/password when using Stylus Studio at the logon/password just push ENTER in the dialog box).
Now I switched to sql server authentication, providing a userid, and everything works without problems.