Skip to main content

developerWorks >  Information Management  >  Forums  >  IBM Data Studio  >  developerWorks

Deploying Java Stored Procedure    Point your RSS reader here for a feed of the latest messages in this thread


Tags for this thread: 

     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is answered.

Permlink Replies: 2 - Pages: 1 - Last Post: Nov 9, 2009 9:50 AM Last Post By: stargazer2590
stargazer2590

Posts: 4
Registered: Nov 03, 2009 09:19:10 AM
Deploying Java Stored Procedure
Posted: Nov 03, 2009 09:29:17 AM
 
Click to report abuse...   Click to reply to this thread Reply
I'm having trouble deploying a Java Stored Procedure. I'm running Data Studio V2.2, using IBM DB2.

It deploys just fine to my local DB from within Data Studio, and seems to Export just fine. It creates what appears to be a complete set of directories and jar files, but when I run:

> ant -buildfile MyStoredProc.xml

I get this result:

builddeploySps:
createsp Debug options:
createsp file:/MyExportArea/Deployment/.options loaded

BUILD FAILED
D:\MyExportArea\Deployment\MyStoredProc.xml:97: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.e
clipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http:///com/ibm/db/models/db2/routine/extensions.ecore' not found. (file:/D:/MyExportArea/Deployment/MyStoredProc.spxmi, 391, 26)

I've looked around to try to find out where the missing extensions.ecore package might be, and I found: com.ibm.db.models.db2.routine.extensions.jar, which contains this:

> jar tf jar\com.ibm.db.models.db2.routine.extensions.jar
META-INF/
META-INF/MANIFEST.MF
com/
com/ibm/
com/ibm/db/
com/ibm/db/models/
com/ibm/db/models/db2/
com/ibm/db/models/db2/routine/
com/ibm/db/models/db2/routine/extensions/
com/ibm/db/models/db2/routine/extensions/impl/
com/ibm/db/models/db2/routine/extensions/util/
model/
com/ibm/db/models/db2/routine/extensions/DB2RoutineDeployRecord.class
com/ibm/db/models/db2/routine/extensions/DB2RoutineExecution.class
com/ibm/db/models/db2/routine/extensions/DB2RoutineExtensionsFactory.class
com/ibm/db/models/db2/routine/extensions/DB2RoutineExtensionsPackage$Literals.class
com/ibm/db/models/db2/routine/extensions/DB2RoutineExtensionsPackage.class
com/ibm/db/models/db2/routine/extensions/DB2RoutineParmValue.class
com/ibm/db/models/db2/routine/extensions/DB2RoutineRun.class
com/ibm/db/models/db2/routine/extensions/DB2zSeriesRoutineRun.class
com/ibm/db/models/db2/routine/extensions/ExtensionsPlugin.class
com/ibm/db/models/db2/routine/extensions/impl/DB2RoutineDeployRecordImpl.class
com/ibm/db/models/db2/routine/extensions/impl/DB2RoutineExecutionImpl.class
com/ibm/db/models/db2/routine/extensions/impl/DB2RoutineExtensionsFactoryImpl.class
com/ibm/db/models/db2/routine/extensions/impl/DB2RoutineExtensionsPackageImpl.class
com/ibm/db/models/db2/routine/extensions/impl/DB2RoutineParmValueImpl.class
com/ibm/db/models/db2/routine/extensions/impl/DB2RoutineRunImpl.class
com/ibm/db/models/db2/routine/extensions/impl/DB2zSeriesRoutineRunImpl.class
com/ibm/db/models/db2/routine/extensions/util/DB2RoutineExtensionsAdapterFactory$1.class
com/ibm/db/models/db2/routine/extensions/util/DB2RoutineExtensionsAdapterFactory.class
com/ibm/db/models/db2/routine/extensions/util/DB2RoutineExtensionsSwitch.class
model/DB2RoutineExtensions.cat
=> model/DB2RoutineExtensions.ecore
model/DB2RoutineExtensions.genmodel
model/DB2RoutineExtensions.mdl
plugin.properties
plugin.xml

can anyone tell me how to resolve this problem?

Thanks....
IBM employee or contractor marichu

Posts: 142
Registered: Apr 18, 2006 02:15:48 PM
Re: Deploying Java Stored Procedure
Posted: Nov 03, 2009 06:38:44 PM   in response to: stargazer2590 in response to: stargazer2590's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi,
I am unable to reproduce your problem on my Data Studio v2.2. (free version)
C:\Export\DW>ant -buildfile DWJAVASP.xml
Buildfile: DWJAVASP.xml

init:

builddeploySps:
createsp Debug options:
createsp file:/C:/Export/DW/.options loaded
createsp DB2ADMIN.DWJAVASP - Deploy started.
createsp DB2ADMIN.DWJAVASP - Created temporary working directory C:\Export\DW
\bld1257290063625.
createsp C:\Program Files\IBM\SQLLIB\java\jdk\bin\javac -classpath ".;C:\Prog
ram Files\IBM\DS21Shared\plugins\com.ibm.datatools.db2_2.1.102.v20091024_0211\dr
iver\db2jcc.jar;C:\Program Files\IBM\DS21Shared\plugins\com.ibm.datatools.db2_2.
1.102.v20091024_0211\driver\db2jcc_license_cisuz.jar;C:\Program Files\IBM\DS21Sh
ared\plugins\com.ibm.datatools.db2_2.1.102.v20091024_0211\driver\db2jcc_license_
cu.jar" -source 1.5 -target 1.5 com\marichu\marichu\DWJAVASP.java
createsp DB2ADMIN.DWJAVASP - Javac completed.
createsp C:\Program Files\IBM\SQLLIB\java\jdk\bin\jar cf spjar.jar com\maric
hu\marichu\DWJAVASP.class
createsp DB2ADMIN.DWJAVASP - Jar file created.
createsp Call SQLJ.DB2_INSTALL_JAR (<<C:\Export\DW\bld1257290063625\spjar.jar
>>, 'DB2ADMIN.DS_20091103100036', 0)
createsp DB2ADMIN.DWJAVASP - SQLJ.DB2_INSTALL_JAR using Jar name DB2ADMIN.DS_
20091103100036 completed.
createsp Call sqlj.refresh_classes( )
createsp DB2ADMIN.DWJAVASP - sqlj.refresh_classes completed.
createsp Call SQLJ.DB2_UPDATEJARINFO ('DB2ADMIN.DS_20091103100036', 'com.mari
chu.marichu.DWJAVASP', <<C:\Export\DW\bld1257290063625\com\marichu\marichu\DWJAV
ASP.java>>)
createsp DB2ADMIN.DWJAVASP - Source saved to the server.
createsp Failed to load database definition document: com.ibm.datatools.dbdef
inition.db2.luw
createsp Failed to load database definition document: DB2 UDB_9.5.xmi
createsp CREATE PROCEDURE DWJAVASP ( )
createsp DYNAMIC RESULT SETS 1
createsp NOT DETERMINISTIC
createsp LANGUAGE Java
createsp EXTERNAL NAME 'DB2ADMIN.DS_20091103100036:com.marichu.marichu.DW
JAVASP.dWJAVASP'
createsp NOT FENCED
createsp PARAMETER STYLE JAVA
createsp
createsp DB2ADMIN.DWJAVASP - Create stored procedure completed.
createsp DB2ADMIN.DWJAVASP - Removed temporary working directory C:\Export\DW
\bld1257290063625.
createsp DB2ADMIN.DWJAVASP - Deploy committed.
createsp DB2ADMIN.DWJAVASP - Deploy successful.
createsp
createsp =====================================
createsp

BUILD SUCCESSFUL
Total time: 15 seconds

As a workaround, may I suggest you extract the missing jar and place a copy in the "jar" folder of the directory you specified when you exported your stored procedure.

One other thing. is your Java SP using dynamic (JDBC) or static (SQLJ) SQL?
Thanks.
stargazer2590

Posts: 4
Registered: Nov 03, 2009 09:19:10 AM
Re: Deploying Java Stored Procedure
Posted: Nov 09, 2009 09:50:43 AM   in response to: marichu in response to: marichu's post
 
Click to report abuse...   Click to reply to this thread Reply
Well, mostly....

One of my colleagues discovered that I could remove one of the definition statements at the beginning of the spxmi file (xmlns:DB2RoutineExtensions="http:///com/ibm/db/models/db2/routine/extensions.ecore"), and make a couple of other adjustments, and that fixed that particular problem.

I was then left with a "missing jar file" error for sqltools.parser.sql.

So, I indirectly took your advice and copied the missing jar file ("org.eclipse.datatools.sqltools.parser.sql.jar") to the jar directory, which fixed the immediate problem, though it leaves me wondering why it misses the file in the first place.

I also found that removing the ResultSet parameter from the CREATE PROCEDURE statement (since I am, indeed, not returning any results) resulted in the removal of the DB2RoutineExtensions definition statement from the spxmi file, so I no longer have to remove it manually.

All in all, not an easy experience, though I greatly appreciate your help.

Regards......
 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums