I was creating a DB2 SQL stored procedure and wanted to have it be able to test itself. So I had it accept a parameter "instr" - if this parameter was "TEST" then it would call itself with some different values checking to make sure the values were correct and then rollback everything before returning "PASS" or "FAIL". However I kept getting an error:
Create stored procedure returns SQLCODE: -440, SQLSTATE: 42884."
DB2ADMIN.PRG_NAME: 42: No authorized routine named "PROG_NAME" of type "PROCEDURE" having compatible arguments was found.
This one had me for awhile and I tried various ways to get around it...finally it struck me. The stored procedure is being dropped when I deploy. Then while compiling it checks to see if the procedure being called (itself) exists. But of course it doesn't and it's not smart enough to check if it itself is the needed procedure so it fails. So far I haven't found a way around this so I just made a new procedure with my tests in it...which is probably cleaner anyway.
Thursday, April 3, 2008
Wednesday, January 23, 2008
Creating a New Weblogic Service Cheatsheet
This is fairly implementation specific and needs more work but it gives a general idea of the steps needed to create a new webservice.
1. Create WSDL/Schema
2. Run scomp to generate XMLBeans jar and copy to project path
3. Copy types.xml from other service and edit (or generate using autotypes)
4. Run ant targets:
wsdl2service
clientgen
For info see:
http://e-docs.bea.com/wls/docs81/webserv/anttasks.html
5. Edit build.xml and run local build
6. Create test page HTML and JSP
7. Update properties file for WSDL URL (idMgmt.properties)
8. Build XML
1. Add jar to compile
2. Add war target
3. Add war to ear build
9. Add to application.xml
10. Add to config.xml
Debugging:
11. From wsdl: “Message” node attribute “type” must correspond to “types.xml”//”type-mapping”//”type-mapping entry” attribute “Type”.
12. XMLNS:xx in type-mapping-entry must correspond to wsdl->scheme::Target Namespace.
1. Create WSDL/Schema
2. Run scomp to generate XMLBeans jar and copy to project path
3. Copy types.xml from other service and edit (or generate using autotypes)
4. Run ant targets:
wsdl2service
clientgen
For info see:
http://e-docs.bea.com/wls/docs81/webserv/anttasks.html
5. Edit build.xml and run local build
6. Create test page HTML and JSP
7. Update properties file for WSDL URL (idMgmt.properties)
8. Build XML
1. Add jar to compile
2. Add war target
3. Add war to ear build
9. Add to application.xml
10. Add to config.xml
Debugging:
11. From wsdl: “Message” node attribute “type” must correspond to “types.xml”//”type-mapping”//”type-mapping entry” attribute “Type”.
12. XMLNS:xx in type-mapping-entry must correspond to wsdl->scheme::Target Namespace.
Monday, January 14, 2008
Customizing JUnit Logging
//create a console logger
Logger consLogger = Logger.getLogger(UpdateGPBenefitEligCommand.class);
Appender myAppender = new ConsoleAppender(new SimpleLayout());
consLogger.addAppender(myAppender);
//now you can pass this logger into a class
MyClass myClass = new MyClass();
myClass.setLogger(consLogger);
Obviously the class must have a setLogger method and the logger definition in the class cannot be "final". Now you could be using debugging and breakpoints instead but sometimes logging is easier and it's already there you just need to make it more accessible for testing.
Logger consLogger = Logger.getLogger(UpdateGPBenefitEligCommand.class);
Appender myAppender = new ConsoleAppender(new SimpleLayout());
consLogger.addAppender(myAppender);
//now you can pass this logger into a class
MyClass myClass = new MyClass();
myClass.setLogger(consLogger);
Obviously the class must have a setLogger method and the logger definition in the class cannot be "final". Now you could be using debugging and breakpoints instead but sometimes logging is easier and it's already there you just need to make it more accessible for testing.
Subscribe to:
Posts (Atom)