BUG: Business Components using Datasources on Websphere - statement closed
Hi,
This is an unusual combinatation, we are deploying business components projects on websphere with a SQL Server database. This was originally deployed all to Oracle. We have managed to convert the project sucessfully (JDeveloper 10.1.3) and on Websphere, however when we moved our application module configurations (bc4j.xcfg) to use JNDI data sources which works in Jdeveloper, we are encountering problems using websphere with business components and datasources.
The statement closed error occurs when trying to calling executequery() method on the view object, not the first time the JSP page is accessed, but the second time. Refresh page all is good. Access page again error occurs. Very consistent.
Our code will often do applicationmodule.findViewObject("name"), if not found then create it, otherwise use the vo and kapow bombs out on the executequery method if reusing the view object.
ERROR
DSRA9110E: Statement is closed.oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
Statement: SELECT Groups.GROU_ID FROM GROUPS Groups WHERE (GROU_ID=1)
at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java(Compiled Code))
at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java(Compiled Code))
at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java(Compiled Code))
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java(Compiled Code))
at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java(Inlined Compiled Code))
at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java(Inlined Compiled Code))
at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java(Compiled Code))The datasource uses the connection pooling driver class com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource.
Ampooling is on. It appears the jdbc prepared statement is being closed but bc4j is expecting to still be open?
Any ideas on diagnosing the issue or app module config changes greatly appreciated.
Mark
Hi Steve,
This is not a composition association. Actually, this is an association from a table to an intersection (many-to-many) table. The code in my service is based on the SRDemo, see SRServiceImpl#updateSkillsForCurrentStaff(List) and is called on a save button from a shuttle page.
The current master is the master I want it to belong to. The link to the master gets correctly saved in the database (just as in the SRDemo). We can also navigate from the master view row to the find the detail view row using the generated RowIterator. However, this does not work from the master entity row to the detail entity row. The problem is really at the entity level.
Thanx
Olivier
Similar Messages
-
Possible Bug: Business Components and packaging preferences
I'm using JDev 11g TP2
When I set up package preferences for business components, it is completely ignoring the package I setup for the Entity object.
Example:
From the menu Tools>Preferences
Under the section Business Components>Packages.
I set the following:
Business Component: left blank - it uses the default [prefix].model
Entity: entity
Association: entity.association
View Object: view
View Link: view.links
the rest have been left at default settings.
Then I create a new diagram so I can add existing database tables to the application. I drag and drop the selected tables from the application resources to the diagram. It creates the entity objects in the [prefix].model package, not the [prefix].model.entity package like I was expecting. However the associations get created correctly in the [prefix].model.entity.association package.
Is this possibly a bug, or just a training issue for me?
ThanksNo worries Ric. Unfortunately I don't have access to your latest builds but I'll still raise the issues in case they are relevant.
Regards,
CM. -
We are using websphere WAS and informix data base and while using DataSource for connection pooling we are getting a Forwarding exception and Illegal state exception apparently thrown by WAS and we tried getting over that by switching to Driver Manager instead of data source but that started giving a corba.rollback exception ! our whole implementation is running on WCS 5.1 using WAS and informix database. Any suggestions on why we are getting forwarding exceptions on using data source with WAS? we have registered the look up in the administrative console and there seems to be no problems with that. please let me know if there are any opinions regarding this. Thanks for your time.
we are getting the error using the data source in a jsp/ejb . the error is actually printed out to a log file and this happens only when multiple users hit the server at the sam time and not when the server is interacting with a single user. we are somewhat stumped by this right now. i am pasting the actual error message in the log file below this. pls pardon me if that is too verbose ! you may see a writer stream not obtained message in it, but that does not seem to be the root cause , that comes since we had not set the printwriter object in the datasource and hence it is redirecting the actual message to screen rather than log file. Thanks for your time.
An error has occurred: Error Code Message Target Servlet Name
500 ERROR: Cannot forward. Writer or Stream already obtained. null
Stack Trace:
java.lang.IllegalStateException: ERROR: Cannot forward. Writer or Stream already obtained. at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleOutputStreamPrinterWriterObtained(WebAppRequestDispatcher.java:595) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:112) at com.ibm.commerce.command.HttpForwardViewCommandImpl.forwardDocument(HttpForwardViewCommandImpl.java) at com.ibm.commerce.command.HttpForwardViewCommandImpl.performExecute(HttpForwardViewCommandImpl.java(Compiled Code)) at com.ibm.commerce.command.ECCommandImpl.execute(ECCommandImpl.java) at com.ibm.commerce.webcontroller.ErrorCmdExecUnit.execute(ErrorCmdExecUnit.java) at com.ibm.commerce.webcontroller.WebController.executeTransaction(WebController.java(Compiled Code)) at com.ibm.commerce.webcontroller.WebController.processRequest(WebController.java) at com.ibm.commerce.adapter.HttpAdapterImpl.processRequest(HttpAdapterImpl.java) at com.ibm.commerce.server.RequestServlet.service(RequestServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:626) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:160) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:287) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:105) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:360) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:775) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:701) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:478) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:234) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:138) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:77) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:155) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300) at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerImp.java:230) at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.java:104) at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.java:212) at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyService(SQWrapperEventSource.java:353) at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQWrapperEventSource.java:220) at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(OutOfProcThread.java(Compiled Code)) at java.lang.Thread.run(Thread.java:481)
Root Cause: java.lang.IllegalStateException: ERROR: Cannot forward. Writer or Stream already obtained.
************************************************************** -
Intermittent bug: Business Components from Tables wizard exception
Hi JDev team
Just to flag an exception I periodically get in JDev 11g TP with the Business Components from Tables wizard, once I've pressed Finish in the wizard:
java.lang.NullPointerException
at oracle.jbo.dt.ui.pkg.PKEntityThread.createRelatedViewLinks(PKEntityThread.java:1085)
at oracle.jbo.dt.ui.pkg.PKEntityThread.createTableViews(PKEntityThread.java:966)
at oracle.jbo.dt.ui.pkg.PKEntityThread.createObjects(PKEntityThread.java:424)
at oracle.jbo.dt.jdevx.ui.pkg.XPKComponentWizardEntityThread.createObjects(XPKComponentWizard.java:454)
at oracle.jbo.dt.ui.pkg.PKEntityThread.run(PKEntityThread.java:396)It is raised when the dialog displays showing the work JDev is doing after completing the wizard to create my business components.
I'm not able to consistently reproduce this issue, though I've encountered it several times. Don't quote me, but it appears to happen the first time I use the wizard in a new JDev session, but is not reproducible again in the same session. However it doesn't always happen when I restart JDev and I'm sorry I can't be more precise.
Hopefully the exception trace will give you enough information to track this issue down.
Regards,
CM.Hi Ric
Unfortunately not really, it's a basic schema we use to test new software. One unusual thing is a hierarchical fk on the same table. But as I said the exception doesn't always occur, but annoyingly does seem to occur when I'm demoing the 11g TP version to clients. I was just hoping the stack trace would help out.
I'll keep an eye on it and if I can work out why it's occurring I'll update this post.
Thanks for following this up.
Cheers,
CM. -
[BUG] Business Components refactoring fails (TP4)
Hi,
I tried to do some refactoring of Business Components without much success. Here's what I noted:
- After renaming entities/view objects, names in the Application Navigator are not updated;
- Moving associations/links to another package fails (the moved xml files are empty);
Is refactoring supposed to work in TP4?
OlivierHi Steve
Are you saying that the wizard allowed you to create an entity with the same EO name in the same package as one that already existed with that same name?
Yes but i'm not sure that i didn't do some mismatch with packages because i have one for entities, one for views and one for application module. I have to check this before I confirm.
I stay however with the idea that it would be nice that the list of available tables show that an entity already exists for that table and selecting it again will be a volountary action to create an another entity based on same table. -
Business Components: Use ? style parameters
Hi,
I am trying to use a ViewObject that needs to have a parameter passed to it for its selection criteria. I created the view object and checked Expert Mode to create my own query. Now here is the problem... inside my where clause I set up one condition as follow
where VgrApp.APP_ID = VgrUserApp.APP_ID
AND VgrUserApp.USR_ID = ?
It says the query is valid, but when I try to test the ViewObject from the Module, it says varibles not bound...likewise when I try to access the ViewObject from a JSP usebean. If anyone has any information on this matter I would appreciate it.
Thanks in advance,
JoeThere is no direct way to bind the Form Fields to the query.
You need to do the following:
Use the pageContext.getParameter("param_name") to get the value for the form field.
Use the am.invokeMethod to bind the variable as below in your view method:
setWhereClauseParams(null); // Always reset
setWhereClause(null);
setWhereClauseParam(0,qotHdrId);
executeQuery();
This should work. Hope this helps. -
I tried to modify a query for a View Object. The modification is just adding a property in the SELECT. I tried to modify the query manually or by using the Query Builder. I have an exception that I don't understand:
Business Components: Java type java.sql.Clob referenced by TopDescrEn is currently not supported.
and the associated SDO schema file is now empty.
I checked in the database and the data type is Clob.
JDev 11.1.1.6The Standard Entity Beans are a component (JavaBean) that can be a small piece of the ultimate application needs.
Oracle Business Component for Java is a complete framework that has numerous features that make developing COMPLETE applications easy.
Please download the white paper on Business Components, try your hand at creating an application with Business Components (using the wizards) and you will see that Business Components for Java is much more than a simple (/complex) reusable component, it is a complete framework which maked developing N-tier applications almost trivial by allowing you to focus on writing your business logic while the framework takes care of all the application infrastructure and the necessary plumbing.
Sincerely,
John@Oracle JDeveloper Team http://technet.oracle.com
null -
Hello:
I am just starting to look at JDeveloper3. Does the Business Components Project Wizard allow for the selection of a non-Oracle database like MySQL through the Sun JDBC-ODBC Bridge Driver? The connection dialog appears to allow me to specify another DB, driver, and even test the connection, but will not let me select it in the Business Connection Wizard. In fact, it doesn't even include it in the list of connections.
ThanksLenny,
The Business Component for Java framework released with JDeveloper 3.0 supports only the Oracle database(7.3 and up). A future release will support the ability to generate Business Components using a plain vanilla JDBC driver.
Regards,
Arun -
Business Components in JHeadstart
Hi
can any one tell me how to add business components in JHeadstart.Sohel,
The JHeadstart Designer Generator can only be used if you previously have generated (or reverse engineered) Oracle Forms applications using Oracle Designer. The JDG transfers the Oracle Designer metadata to the XML format that is used by the JHeadstart Application Generator. If you have never used Oracle Designer before, you cannot use the JDG. Instead you should create the ADF Business Components using the wizards in JDeveloper as explained in Steve Muench' JHeadstart tutorial.
Steven Davelaar,
JHeadstart Team. -
Business Components for Java entity beans of J2EE
What is the future of Business Components for Java with the new standard entity beans of the sun Java 2 Entreprise Edition?
Thanks.
nullThe Standard Entity Beans are a component (JavaBean) that can be a small piece of the ultimate application needs.
Oracle Business Component for Java is a complete framework that has numerous features that make developing COMPLETE applications easy.
Please download the white paper on Business Components, try your hand at creating an application with Business Components (using the wizards) and you will see that Business Components for Java is much more than a simple (/complex) reusable component, it is a complete framework which maked developing N-tier applications almost trivial by allowing you to focus on writing your business logic while the framework takes care of all the application infrastructure and the necessary plumbing.
Sincerely,
John@Oracle JDeveloper Team http://technet.oracle.com
null -
Help required building ADF-Swing/ADF-Faces using ADF Business Components
My question is in regards to how you can go about building a light swing application to an ADF model?
In particular if I were to say that we were developing a 3-tier project whereby we had a database tier, a series of EJB-ADF façade session beans to the database (middle-tier), and a swing client communicating with the session beans (view-controller tier), how would you go about developing these screens?
In particular can we develop these screens using ADF-Faces and also ADF-Swing?
The EJB session façade beans of course are ADF app modules with customised methods. The methods would return back customised DTO objects. These DTO objects are wrappers to row objects ADF would create. This would be mainly due to making these facade beans web service enabled (Oracle state that these methods cannot return oracle.jbo objects if they are to be web service enabled).
This would be typically deployed to an app server, like Oracle App Server 10G.
Could you please have a look at this, as I am doing a lot of research into this.
eg. Taking example from oracle magazine sept/oct 2006
with slight enhancements
package oramag.frameworks.example.common;
import oracle.jbo.ApplicationModule;
import oramag.frameworks.customdto.EmployeeDTO;
public interface HRService extends ApplicationModule {
void deleteCurrentEmpAndCommit();
EmployeeDTO findEmployee(int employeeId); // new method
import oramag.frameworks.customdto.EmployeeDTO;
public class HRServiceImpl extends ApplicationModuleImpl {
public void deleteCurrentEmpAndCommit() {
Row empRow = getEmpView().getCurrentRow();
if (empRow != null) {
empRow.remove();
getDBTransaction().commit();
public EmployeeDTO findEmployee(int employeeId)() {
EmployeeDTO employeeDTO = null;
EmployeesImpl employees = getEmployees();
employees.setNamedWhereClauseParam("EmployeeId", employeeId);
employees.executeQuery();
if(employees.hasNext()) {
EmployeesRowImpl employee = (EmployeesRowImpl)employees.next();
employeeDTO = new EmployeeDTO(employee);
return employeeDTO;
public EmployeesImpl getEmployees() {
return (EmployeesImpl)findViewObject("Employees");
Now given the above code snippet, how could you turn this into an ADF-Swing/ADF Faces application so that if a user using the swing application enters an employee id, then the application will execute the query on the app server, the app server in turn returns the results to the client, and the client finally display the results. Typical MVC example.
Cheers
RodneyThe tutorial is for ADF BC used with JavaServer Faces.
While the tutorial doesn't cover it, we also support drag and drop development for Swing and visual WYSIWYG layout for Swing panels and windows, too. For a very simple example, watch screencast #4 on my blog here:
http://radio.weblogs.com/0118231/stories/2005/06/24/jdeveloperAdfScreencasts.html
One thing I have noticed is that when using ADF business components, when the app module returns a custom DTO object like the above example, it returns the data in a element structure according to the data control palette.
You don't generally ever need to create your own custom DTO's when working with ADF for use by client UI's. The only situation where can be necessary -- until we simplify this in the JDeveloper/ADF 11g release -- is when you desire to expose custom methods that can return sets/arrays of typed row structures through a web service. However, web services are not involved/required in building 3-tier Swing applications.
When dropping onto a page it does so like a string and doesnt give option to display the data in a read only form etc. Is there anything we need to do, to get the functionality.
It's more of what you don't need to do :-)
Just leverage the active data model that the ADF application module provides. You can read more about it in section 4.5 "Understanding the Active Data Model" of the ADF Developer's Guide for Forms/4GL Developers on the ADF Learning Center at http://www.oracle.com/technology/products/adf/learnadf.html). Your UI's bind to view object instances in the data model, and your UI's are automatically kept up to date without needing to write methods that return data. I short article I wrote that preceeded my writing the ADF Developer Guide content on this topis is here:
http://radio.weblogs.com/0118231/stories/2006/01/26/theAdfBusinessComponentsActiveDataModel.html
I know that when dropping a view object you get this functionality. Also was wondering if we were to pass an object of thios type back to the model it might not give us the rich functionality like input forms, like what Oracle provides if we were to drop a enitity view object.
Just use the active data model and everything becomes totally easy, with no changes required to switch between local or three-tier deployment configurations.
Trying to do everything with hand-coded DTO beans is really going the hard way.
Could you help us regarding this? -
BUG? Default Project Properties, Business Components: Base Classes
Is it just me, or is there a bug in the Default Project Properties Dialog when attemptiong to specify custom classes for the Business Component Base Classes.
I have extended EntityCache and can successfully specify it as a base class via the Project Properties dialog, but in Default Project Properties, I get an error stating: "The selected class is not a valid superclass. Either is does not implement the interface oracle.jbo.server.EntityCache or it has an invalid modifier".
FYI: My custom library has been added to the Default Project Properties->Libraries.
Any help?Does it work if you use the:
Tools | Preferences... | Business Components > Base Classes panel instead? -
Business components from multiple datasources
Hi All,
I want to create business components from multiple datasource. Please tell me if it is possible in ADF framework and Jdeveloper 11.1.1.4
I opened the Model.jpx and tried adding the two datasource but it is showing as a dropdown list from which I can choose only one.
My requirement is to have components from one datasource and read data from a second database to create a LOV
Please suggest how to go about it
ThanksHi,
There are many ways to achieve this.
If your requirement is just to read data from different database (and not to update it), then using a database link would be a better approach.
You could create a database link in the primary database (target database being the one you would like to query). Base your sql query for the vo using the db link.
-Arun -
BUG 10.1.3 EA -- BME-99003 in Business Components Diagram with imported EOs
Following a hands-on exercise in the Oracle JDeveloper 10g Handbook (pages 343 - 345):
-- Create new application workspace, say HRApp, using default Web Application Template.
-- Edit Model project properties to create new library with classpath that points to business domain objects in a project folder from a different workspace.
-- Import the Business Components from the other project's folder, say "businessdomain.xml".
-- Create a BC Diagram in the Model project of the HRApp application.
-- Create a new View Object in the BC Diagram by dragging from Component Palette, rename to "JobsView".
-- Drag entity object representation from new library, say "Jobs.xml" onto View Object.
-- See error message below.
Johnny Lee
Message
BME-99003: An error occurred, so processing could not continue.
Cause
The application has tried to de-reference an invalid pointer. This exception should have been dealt with programmatically. The current activity may fail and the system may have been left in an unstable state. The following is a stack trace.
java.lang.NullPointerException
at oracle.jbo.dt.modeler.diagram.dropHandler.BC4JXMLDropHandler.processObjects(BC4JXMLDropHandler.java:82)
at oracle.bm.addinUtil.IDEAppContext$4.performAction(Unknown Source)
at oracle.bm.diagrammer.LockMonitor.performLockedAction(Unknown Source)
at oracle.bm.diagrammer.BaseDiagram.performDiagramLockedAction(Unknown Source)
at oracle.bm.addinUtil.IDEAppContext.dropNavigatorNodeLater(Unknown Source)
at oracle.bm.addinUtil.IDEAppContext$5.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Action
If further errors occur, you should restart the application.
Also, report the problem on the JDeveloper forum on otn.oracle.com, or contact Oracle support, giving the information from this message.
________________________________________________________________________________We have not been able to reproduce the exact same error, there would be a problem if we were trying to write to the library file, as those objects are read only, of course. Can you tell me, the entity object that you are referencing, has it ever appeared on a diagram? An easy way to tell, if you don't know is by looking at its XML file and see if it has an ID=some long string entry.
-
The major difference between Oracle BC4J with WebSphere Business Components
Hi BC4J/ADF experties:
who could help to explian the difference betweenn IBM WebSphere Business Components(San Francisco) with Oracle BC4J(ADF) ? , the both product to emphasize Component-based developemnt but WebSphere Business Components have been define some enterprise base component that can provide extend and customize. how do you look up on this product strategy for developer ?I guess one difference is who can use it, for IBM components:
Available for ISVs and Technology Partners only, and requires that the ISVs and Technology Partners have either a SanFrancisco Technology License Agreement, SanFrancisco Version 2 Development License or a SanFrancisco Version 2.1 OEM agreement and an appropriate transaction document executed under the respective base agreement.
BC4J is for use by anybody who uses JDeveloper.
IBM's solution seems to lock you into using Webssphere, with BC4J you can use whichever application server you want.
I guess the problem is to find someone "who could help to explian IBM WebSphere Business Components" - I can't seem to find a good expenation of what it does, but it seems to be a set of functional components that do specific tasks.
This is not what BC4J is about.
IBM's solution forces you to use EJB. BC4J gives you a choice of deployment options.
To understand what BC4J give you read:
http://otn.oracle.com/products/jdev/collateral/tutorials/903/j2ee_bc4j/prnt/j2ee_bc4j.html
Maybe you are looking for
-
Hi, I can't open email attachments that have an arrow on them. Attachments with a W (windows) open just fine. I have an ipad 3. Thanks for any ideas.
-
27" iMac startup hangs freezes
I have a 27" iMac and am having trouble starting up. I get the startup chime but the startup hangs or freezes and the iMac tries to restart again after a little while. So I tried starting up from a Techtools CD in the external drive (there is no inte
-
Getting JBO-27008 error on setAttribute
I'm using bc4j objects. I'm trying to update an attribute in a row using the row.setAttribute method. I get the error number above which says I'm attempting to update a read only field. I have looked at my entity object and the field is always updata
-
Multiple PO delivery date change
Hi All, Some problem with the multiple PO delivery date change. Always shows successfully udpated the delivery date. When i check the PO,the delivery date is still the original date, remain no change. How to resolve? Thanks
-
Character Counter for a Rich Text Editor
Version 4.1.1.00.23 Hello, I'm hoping that someone has a solution for a character counter/validation to use on the Rich Text Editor. Thanks, Joe