Database control hangs in Workshop Tutorial !!!
Hi,
I am using WLS 7.0.1.0/SP1 ( latest version ) with Workshop included, on Windows
XP Prof. In Workshop Tutorial, Step 3, the test hangs at the execution of
Applicant dbApplicant = bankruptciesDB.checkForBankruptcies(taxID);
I am asking if it is a known problem? There may be several reasons for this and
it is too expensive to investigate all of them:
1. Tutorial text misses a fragment describing special configuration for the Database
control
2. Tutorial is correct but default ( installation ) configuration of Database
control has bug(s)
3. A helper class, implementing BankruptciesDatabaseControl interface, is missed.
4. Implementation of Database control is buggy. What the magic happens when I
“SELECT TAXID, FIRSTNAME, LASTNAME, CURRENTLYBANKRUPT FROM BANKRUPTCIES WHERE
TAXID={taxID}”, i.e. only a sub-set of “Applicant” attributes in the query, and
how Database control ( using my interface method public Investigate.Applicant
checkForBankruptcies(String taxID) ) knows which database table field to map to
which Applicant” attribute ? [I suppose, creation of “Applicant” class is independent
from the database schema, isn’t it ?]
Thank you,
- Michael
Sure, I will send you the dump. Please, provide me with your e-mail.
As of column names, don’t you find it error-prone approach where a developer has
to “find” the names and type them into the code ? Since you are already deal with
a db adapter/controller, I suggest, the adapter has to read a db schema, gets
the column names and data types. In other words, I would expect in this case the
same functionality as provided by, e.g., TogetherSoft’s Control Center. It creates
Entity Beans out of the db schema and only then allows you to manipulate them.
Thank you and wait for your e-mail.
- Michael
"Anurag Pareek" <[email protected]> wrote:
Michael,
The names of the elements in the 'Applicant' class should match one-on-one
with the database column names in the corresponding table.
I guess you are using the default Pointbase database. Can you check whether
you were able to create successful connections to the Pointbase database
during server startup?
If the server is hanging at the statement you have mentioned, can you
take a
thread dump by using Ctrl->Break and email it to me.
Thanks,
Anurag
"Michael Poulin" <[email protected]> wrote in message
news:[email protected]...
Hi,
I am using WLS 7.0.1.0/SP1 ( latest version ) with Workshop included,on
Windows
XP Prof. In Workshop Tutorial, Step 3, the test hangs at the executionof
Applicant dbApplicant = bankruptciesDB.checkForBankruptcies(taxID);
I am asking if it is a known problem? There may be several reasonsfor
this and
it is too expensive to investigate all of them:
1. Tutorial text misses a fragment describing special configurationfor
the Database
control
2. Tutorial is correct but default ( installation ) configuration ofDatabase
control has bug(s)
3. A helper class, implementing BankruptciesDatabaseControl interface,is
missed.
4. Implementation of Database control is buggy. What the magic happenswhen I
"SELECT TAXID, FIRSTNAME, LASTNAME, CURRENTLYBANKRUPT FROM BANKRUPTCIESWHERE
TAXID={taxID}", i.e. only a sub-set of "Applicant" attributes in thequery, and
how Database control ( using my interface method publicInvestigate.Applicant
checkForBankruptcies(String taxID) ) knows which database table fieldto
map to
which Applicant" attribute ? [I suppose, creation of "Applicant" class
is>independent>> from the database schema, isn't it ?
Thank you,
- Michael
Similar Messages
-
Hi,
I'm using Weblogic Workshop 7.0.1.0.0829.0, developing a small service to retrive data from SQL server 2000. I created SQL connection pool to SQL server and TxDataSource using this pool. I could able to see the datasources from database control wizard in workshop. I'm using conversation for the webservices. whenever I execute the webservice, I get the following error :
weblogic.jws.control.ControlException: Unable to obtain connection to database[Connection has already been created in this tx context for pool named cgPool. Illegal attempt to create connection from another pool: sqlPool] at weblogic.knex.control.DatabaseControlImpl.acquireResources(DatabaseControlImpl.java:261) at weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext.java:220) at weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260) at WebServCntrlControl.LoadUser(WebServCntrlControl.ctrl) at Login.Verify(Login.jws:48)
How to resolve it?Muthu,
The exception that you are seeing is due of the fact that you are using two
different TX datasources within the same transaction context.
Workshop needs the following
1. an XA connection pool and data source for the conversational state
2. another XA connection pool and data source for the DB control which is
used in the conversational method,
3. a non-XA connection pool to which the JMSJDBCStore connects.
Reconfiguring your application and the workshop runtime to use a single non
transactional datasource-cgDataSource, removes the need for TX Data Sources
and XA Drivers.
The other option is to
Upgrade to Service Pack 2 and reconfigure the connection pools to use the XA
driver.
Hope this helps.
Thanks
Raj Alagumalai
WebLogic Workshop Support
"Muthu" <[email protected]> wrote in message
news:3efbc1d1$[email protected]..
Hi,
I'm using Weblogic Workshop 7.0.1.0.0829.0, developing a small serviceto retrive data from SQL server 2000. I created SQL connection pool to SQL
server and TxDataSource using this pool. I could able to see the datasources
from database control wizard in workshop. I'm using conversation for the
webservices. whenever I execute the webservice, I get the following error :
>
weblogic.jws.control.ControlException: Unable to obtain connection todatabase[Connection has already been created in this tx context for pool
named cgPool. Illegal attempt to create connection from another pool:
sqlPool] at
weblogic.knex.control.DatabaseControlImpl.acquireResources(DatabaseControlIm
pl.java:261) at
weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext
.java:220) at
weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260) at
WebServCntrlControl.LoadUser(WebServCntrlControl.ctrl) at
Login.Verify(Login.jws:48)
>
How to resolve it? -
Workshop 8.1 beta - problem with creating Database control
I am using Workshop 8.1 beta to create a webservice, which uses a database control
to query the Db, as simpel as it comes. However, I get the following exception
when I try to create the new DBControl:
java.lang.AssertionError
at workshop.pageflow.ui.dialogs.wizards.jbcx.db.util.DbControlWizardUtil.getTables(DbControlWizardUtil.java:268)
at workshop.pageflow.ui.dialogs.wizards.jbcx.db.util.DbControlWizardUtil.getTablesAndViews(DbControlWizardUtil.java:223)
at workshop.pageflow.ui.dialogs.wizards.jbcx.db.step.PickMethodsStep$4.run(PickMethodsStep.java:299)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
at java.awt.Dialog.show(Dialog.java:538)
at com.bea.ide.ui.wizard.WizardDialog.show(WizardDialog.java:117)
at workshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizard.runWizard(DbControlWizard.java:96)
at workshop.pageflow.ui.dialogs.wizards.jbcx.db.FileNewDbControlWizardAction.doAction(FileNewDbControlWizardAction.java:58)
at workshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizardDocHandler.launchWizard(DbControlWizardDocHandler.java:87)
at workshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizardDocHandler.createNewFile(DbControlWizardDocHandler.java:72)
at workshop.shell.wizards.NewFileWizard.getDisplayURI(NewFileWizard.java:232)
at workshop.shell.actions.file.FileNewAction$1.run(FileNewAction.java:111)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
What's interesting is that it works well for the default dbcontrols of cgDataSource
and cgSampleDataSource. The connection pool and the datasources were created successfully
in the server. Its the workshop that seems to be complaining.
Anyone face this problem?Sanjeev,
This newsgroup is for Workshop 7.0 issues, till WebLogic Platform 8.1 goes
GA.
Meanwhile, please post Workshop 8.1 beta issues on
weblogic.developer.interest.81beta.workshop newsgroup.
Regards,
Anurag
"Sanjeev Saha" <[email protected]> wrote in message
news:[email protected]...
>
I am using Workshop 8.1 beta to create a webservice, which uses a databasecontrol
to query the Db, as simpel as it comes. However, I get the followingexception
when I try to create the new DBControl:
java.lang.AssertionError
atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.util.DbControlWizardUtil.getTab
les(DbControlWizardUtil.java:268)
atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.util.DbControlWizardUtil.getTab
lesAndViews(DbControlWizardUtil.java:223)
atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.step.PickMethodsStep$4.run(Pick
MethodsStep.java:299)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
atjava.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:197)
atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:150)
atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:140)
at java.awt.Dialog.show(Dialog.java:538)
at com.bea.ide.ui.wizard.WizardDialog.show(WizardDialog.java:117)
atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizard.runWizard(DbCon
trolWizard.java:96)
atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.FileNewDbControlWizardAction.do
Action(FileNewDbControlWizardAction.java:58)
atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizardDocHandler.launc
hWizard(DbControlWizardDocHandler.java:87)
atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizardDocHandler.creat
eNewFile(DbControlWizardDocHandler.java:72)
atworkshop.shell.wizards.NewFileWizard.getDisplayURI(NewFileWizard.java:232)
at workshop.shell.actions.file.FileNewAction$1.run(FileNewAction.java:111)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
atjava.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:197)
atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
What's interesting is that it works well for the default dbcontrols ofcgDataSource
and cgSampleDataSource. The connection pool and the datasources werecreated successfully
in the server. Its the workshop that seems to be complaining.
Anyone face this problem? -
Confusing Service Control in Workshop Tutorial
When you are adding a Service Control, Workshop Tutorial recommends to drug-and-drop
the control descriptor – the .ctrl file from another project – onto your Service
Component in the Design View. This operation confuses me because it contradicts
the Web Services principles. If the author of this tutorial intended to demonstrate
an ability of the tool to accept pre-built 3-rd party control descriptors, I think,
it would be better to demonstrate this for an Application View Control.
For Web Services, an application/user, who wants to establish communication with
a Web Service, is assumed to obtain ( find in UDDI or on a Web Site or in a Repository
) related WSDL and, then, create/build appropriate helpers to support this communication.
So, for the tutorial purposes, I suggest, the right scenario has to
1) find the WSDL
2) create local ( for the current project ) control descriptor, not a control
descriptor packaged into another project as it appears in existing Tutorial implementation
3) automatically generate helper components for SOAP marshalling/unmarshalling
I have tested this scenario by copying the WSDL - CreditCardReportContract.wsdl
- into my “financialservices” project, performed WSDL-to-CTRL conversion and successfully
run it in the debugger.
I do invite your opinions on this subject!
- Michael PoulinSince Workshop is recommended by BEA as a Web Services development tool, I think,
this topic may be shared between Web Services and Workshop newsgroups.
Point in my comment is not about ability or disability of Workshop of copying
CTRL files into your project. I tried to explain that this feature is inadequate
to Web Services in general if it substitutes WSDL.
I would certainly agree with and appreciate a feature that allows me, as a developer,
to reuse already existing Control Descriptor available in MY environment. However,
the Tutorial does not teach “to copy the control's CTRL file to a common folder”.
Instead, it follows the statement: “If the control will be used only by a single
web service in your project, you may choose to copy the CTRL file to the same
folder as your web service”. I doubt that the statement represents Best Practices
– it couples projects by a derivative, not by the resource. That is, if WSDL has
been changed, the 3-rd project can re-build CTRL file for itself, you project
gets into troubles ( it is obvious, right ? ).
Using Workshop, I am trying to understand how BEA recommends working with Web
Services. I recognize the power of Connector architecture and common approach
to resources accessibility represented by CTRL files. At the same time, I see
that a repository of CTRL files for Web Services can shield developers from Web
Services in WebLogic environment. If this is an accidental consequence, it has
to be clearly explained, if not fixed; if it is an intention, I would like to
hear the BEA comments on how this relates to known WSDL repositories, other standards,
and reliability of Web Services in the enterprise environment, at least.
Thank you,
- Michael
"Anurag Pareek" <[email protected]> wrote:
Michael,
For questions regarding Workshop, I will suggest you to post to the
'weblogic.developer.interest.workshop' newsgroup.
Regarding this query, the docs do state explicitly the following, which
I
guess addresses your concern:
If the CTRL file for the control you wish to use is not in your project,
you
must copy it to your project. The destination to which you copy the control
depends on your expected usage. If the control will be used only by a
single
web service in your project, you may choose to copy the CTRL file to
the
same folder as your web service. If multiple web services in different
folders in your project may use the control, you may wish to copy the
control's CTRL file to a common folder. Remember that the CTRL file must
be
in your WebLogic Workshop project.
Wherever you decide to place the control's CTRL file, it must be in your
WebLogic Workshop project.
Do let me know if you have further inputs.
Regards,
Anurag
"Michael Poulin" <[email protected]> wrote in message
news:[email protected]...
When you are adding a Service Control, Workshop Tutorial recommendsto
drug-and-drop
the control descriptor - the .ctrl file from another project - ontoyour
Service
Component in the Design View. This operation confuses me because itcontradicts
the Web Services principles. If the author of this tutorial intendedto
demonstrate
an ability of the tool to accept pre-built 3-rd party control descriptors,I think,
it would be better to demonstrate this for an Application View Control.
For Web Services, an application/user, who wants to establishcommunication with
a Web Service, is assumed to obtain ( find in UDDI or on a Web Siteor in
a Repository
) related WSDL and, then, create/build appropriate helpers to supportthis
communication.
So, for the tutorial purposes, I suggest, the right scenario has to
1) find the WSDL
2) create local ( for the current project ) control descriptor, nota
control
descriptor packaged into another project as it appears in existingTutorial implementation
3) automatically generate helper components for SOAPmarshalling/unmarshalling
I have tested this scenario by copying the WSDL -CreditCardReportContract.wsdl
- into my "financialservices" project, performed WSDL-to-CTRL conversionand successfully
run it in the debugger.
I do invite your opinions on this subject!
- Michael Poulin -
We are using workshop as our development tool for a new project. Are there any guidelines concerning when to use a Database Control vs an EJB for database updates? How do Database Controls differ from entity EJB's in terms of transaction management?
Henrik--
In general, the Workshop Database Control executes the SQL that you
see in each method's annotations. So, you can do a batch update in the
context of a single transaction if you wrap a database control in a
custom control which calls database control methods many times.
Relative to your JPF, this would look like a batch update.
If you pass RowSet objects to Database Control methods, the RowSet
will generate update / insert / delete SQL statements to push changes
made in the RowSet into the database.
Hope that helps...
Eddie
Henrik Fredholm wrote:
I want to insert many rows into a database. Does the Workshop Database Control
or RowSet Control support batch update? How is it done? -
Workshop 81 Database Controls & Informix
Hi !
Does anybody have a solution for the following problem ?
Problem: Using Workshop 81 and Informix JDBC driver from IBM (version 2.21), I'm
trying to build a database control to insert/retrieve large TEXT data into Informix
DB.
Q: Of which java data type should be the input/return value from my method in
the Workshop database control (I think it should be java.sql.Clob) Is this correct?
Q: If so, does IBM's Informix JDBC driver support operations like (rs.getClob,
etx on TEXT fileds) ?
Q: If not, can I build this kind of database control with IBM's JDBC driver at
all ?
Please forward possible solutions to my email ([email protected]).
Mux thnx,
MatevzSince no one answered yet, I'll answer myself (some). I found a neat article and the code to go with it on dev2dev that handles paging through many rows by wrapping the <netui:repeater> tag. See:
http://dev2dev.bea.com/pub/a/2005/02/netui_repeater.html
Very cool. Thanks to the author, Gerald Nunn. I'd much rather find code already written than have to write it myself. ;-) -
Using "in" clause in the query in Database control
Hi,
I have a database control and need to fire an update query to update a set of rows based on a list of values as input
Like below
update tablename
set column1="value1"
where column2 in (.......)
I need to pass a list of values for this query where column2 is a NUMBER field in Oracle DB.
can anyone help me how to go about passing this list of values?
Help is appreciated.
ThanksYou may build the comma-separated list in Java and use " {sql: ...} " in your query: http://e-docs.bea.com/workshop/docs81/doc/en/workshop/java-class/com/bea/control/DatabaseControl.html (sorry, I can't find the documentation for WLI 9.2).
-
How to read sql from properties file in database control
Hey Guys,
I want to know that how a properties file can be used in bea built-in database control to read SQL.
Any help would be greatly appreciated.
Thanks,
Deepak Kumar
Qwest, Indiahi
ok i tried it like its written in the tutorial...i do it like this:
ClassLoader cl = ResourceAnchor.class.getClassLoader();
props.load( cl.getResourceAsStream(pathname));
-> tha pathname is dvd.properties
and there always appears a NullPointerException: error reading properties file: java.lang.NullPointerException
-angela -
Database control support for "IN" clause
Does anyone know if the database control supports an 'IN' clause construct, e.g.,
SELECT name FROM mytable WHERE id IN ( {values} )
where values would be passed in as a variable length array of Strings or Integers?
Thanks,
DCI forgot to paste in the link to the documenation. Here it is
http://edocs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conParameterSubstitutionInJwsSqlStatements.html
"John Rohrlich" <[email protected]> wrote in message
news:[email protected]..
Dave,
I think you will need to build the sql and pass it to the control method.
For example
String matchMe = "('Bill Walton', 'Fred Williams')";
Customer[] customers = weblogicCustomer.getCustomersIn(matchMe);
* @jc:sql statement= "SELECT name from weblogic.customer where namein
{sql: matchMe}"
public Customer[] getCustomersIn(String matchMe);
Here is a link to a doc explaining parameter substitution for jc:sql
statements
- john
"Dave Chappelle" <[email protected]> wrote in message
news:[email protected]..
Does anyone know if the database control supports an 'IN' clauseconstruct, e.g.,
SELECT name FROM mytable WHERE id IN ( {values} )
where values would be passed in as a variable length array of Strings orIntegers?
Thanks,
DC -
How to use database control to execute sql queries which change at run time
Hi all,
I need to execute sql queries using database controls , where the sql changes
at run time
based on some condition. For eg. based on the condition , I can add some where
condition.
Eg. sql = select id,name from emp where id = ?.
based on some condition , I can add the following condition .
and location = ?.
Have anybody had this kind of situation.
thanks,
sathishFrom the perspective of the database control, you've got two options:
1) use the sql: keyword to do parameter substitution. Your observation
about {foo} style sbustitution is correct -- this is like using a
PreparedStatement. To do substitution into the rest of the SQL
statement, you can use the {sql: foo} substitution syntax which was
undocumented in GA but is documented in SP2. Then, you can build up
the filter clause String yourself in a JPF / JWS / etc and pass it into
the DB control.
For example:
* @jc:sql statement="select * from product {sql: filter}"
public Product[] getProducts(String filter) throws SQLException;
This will substitute the String filter directly into the statement that
is executed. The filter string could be null, "", "WHERE ID=12345", etc.
2) you can use the DatabaseFilter object to build up a set of custom
sorts and filters and pass that object into the DB control method.
There have been other posts here about doing this, look for the subject
"DatabaseFilter example".
Hope that helps...
Eddie
Dan Hayes wrote:
"Sathish Venkatesan" <[email protected]> wrote:
Hi Maruthi,
The parameter substituion , I guess is used like setting the values for
prepared
statements.
What I'm trying to do , is change the sql at run time based on some condition.
For example ,
consider the following query :
select col1,col2 from table t where t.col3 > 1
At run time , based on some condition , I need to add one more and condition.
i.e. select col1,col2 from table t where t.col3 > 1 and t.col4 < 10.
This MAY not address your issue but if you are trying to add "optional" parameters
you may try including ALL the possible parameters in the SQL but send in null
for those params that you don't want to filter on in any particular case. Then,
if you word your query
as follows:
select col1, col2 from table t where t.col3 > 1 and (t.col4 = {col4param} or
{col4param} is null) and (t.col5 = {col5param} or {col5param} is null) ...
you will get "dynamic" filters. In other words, col4 and col5 will only be
filtered if you send in non-null parameters for those arguments.
I have not tried this in a WL Workshop database control but I've used
this strategy dozens of times in stored procedures or jdbc prepared statements.
Good luck,
Dan -
Woes wiring up an ejb to use a database control
first my question & then background:
how do i wire up an ejb to use a database control jcx object so that the dbcontrol is instantiated at runtime?
here's the scene:
i created a java page flow from a database control & this works correctly, but i also need to be able to expose some of the functionality to another deployed application. this application, incidentally is not a workshop application; but rather is a hand-coded war.
the first application (a workshop app) renders forms that use a database control to persist the data. it only uses one table & therefore, there is only one pojo. as i mentioned, this resides in web project & works correctly. i abstracted my dbcontrol & my pojo to a separate java controls project & built this as a library. the jpf still has no problems seeing the dbcontrol.
there is a second application (a non workshop app) that needs to be able to use a method provided by the dbcontrol. i created an ejb in a third project in the first application that makes the call to dbcontrol in the exact same way that the jpf did. but i am finding, however, that the dbcontrol is null whenever the ejb makes the call to it's method.
here's the more detailed design:
i started with a database control. i mapped to my datasource, wrote out the sql for the methods i wanted & generated the pageflow from this. i rewrote the pageflow/jsps to suit my needs & everything just works. i did notice at the time that i generated the page flow that the dbcontrol was never instantiated. here is a snippet of the jpf:
<pre>
public class SiteAlertMessageManagementController extends PageFlowController {
* This is the control used to generate this pageflow
* @common:control
private SiteAlertMessageDBControl dbControl;
public Forward getCurrentMessage() {
SiteAlertMessage currentMessage = dbControl.getCurrentMessage();
</pre>
because SiteAlertMessageDBControl is an interface, i assumed that the '@common:control' annotation told weblogic what it needed to know in order to instantiate a runtime class of time SiteAlertMessageDBControl. because it just worked, i never questioned this.
with the form read/write functionality complete, i assumed i could quickly wrap an ejb around the dbcontrol method & be done with it. i soon realized that i could not create an ejb inside a web project & that an ejb project would not have classpath visibility to my dbcontrol & pojo, so i put the dbcontrol & the pojo into a java control project & made a library out of this. i double checked that the web project could see the classes in the library & they could.
so i created a separate ejb project that also could now see the classes in the library. i thought i was in the home stretch. i now have these projects in my first application:
administrationControls, administrationWeb, & administrationEjb. i moved the administrationControls.jar & the administrationEjb.jar over to the WEB-INF/lib directory of my (remember: non-workshop) war & wired up the code to pull the bean off jndi tree to make the rmi call. but it didn't work. so i backtracked & created a new jsp back in my workshop project that would make the same rmi call so that i could use the debugger. with this as the background, here is my specific problem.
what i noticed is that the ejb code itself works correctly. i guess i should show it as well.
<pre>
public class SiteAlertMessagesAPI extends GenericSessionBean implements SessionBean {
* This is the control used to generate this pageflow
* @common:control
private SiteAlertMessageDBControl dbControl;
public void ejbCreate() {
// Your code here
* @ejbgen:remote-method
public SiteAlertMessage getCurrentMessage() throws Exception {
SiteAlertMessage message = null;
try {
// dbControl is null here
message = dbControl.getCurrentMessage();
catch (Exception e) {
e.printStackTrace();
return message;
</pre>
the problem is that my dbControl object is null. what i did was cut & paste the code from the jpf over to my bean. like i stated earlier, i assumed that the annotation would tell weblogic to instantiate an instance. this was obviously not the case. incidentally, i rewrote my ejbCreate() method like this:
<pre>
public void ejbCreate() {
// Your code here
dbControl = new SiteAlertMessageDBControl();
</pre>
but workshop gives me a "error: this type is abstract and thus cannot be instantiated" warning.
my question is: how do i wire up an ejb to use a database control jcx object so that the dbcontrol is instantiated at runtime?
any light you could shed on this would be most appreciated. thanks,
dougHi,
unfortunatly, it's not possible to use a control outside a control or a
web service...
Emmanuel
douglas thomas a ?crit :
first my question & then background:
how do i wire up an ejb to use a database control jcx object so that the dbcontrol is instantiated at runtime?
here's the scene:
i created a java page flow from a database control & this works correctly, but i also need to be able to expose some of the functionality to another deployed application. this application, incidentally is not a workshop application; but rather is a hand-coded war.
the first application (a workshop app) renders forms that use a database control to persist the data. it only uses one table & therefore, there is only one pojo. as i mentioned, this resides in web project & works correctly. i abstracted my dbcontrol & my pojo to a separate java controls project & built this as a library. the jpf still has no problems seeing the dbcontrol.
there is a second application (a non workshop app) that needs to be able to use a method provided by the dbcontrol. i created an ejb in a third project in the first application that makes the call to dbcontrol in the exact same way that the jpf did. but i am finding, however, that the dbcontrol is null whenever the ejb makes the call to it's method.
here's the more detailed design:
i started with a database control. i mapped to my datasource, wrote out the sql for the methods i wanted & generated the pageflow from this. i rewrote the pageflow/jsps to suit my needs & everything just works. i did notice at the time that i generated the page flow that the dbcontrol was never instantiated. here is a snippet of the jpf:
<pre>
public class SiteAlertMessageManagementController extends PageFlowController {
* This is the control used to generate this pageflow
* @common:control
private SiteAlertMessageDBControl dbControl;
public Forward getCurrentMessage() {
SiteAlertMessage currentMessage = dbControl.getCurrentMessage();
</pre>
because SiteAlertMessageDBControl is an interface, i assumed that the '@common:control' annotation told weblogic what it needed to know in order to instantiate a runtime class of time SiteAlertMessageDBControl. because it just worked, i never questioned this.
with the form read/write functionality complete, i assumed i could quickly wrap an ejb around the dbcontrol method & be done with it. i soon realized that i could not create an ejb inside a web project & that an ejb project would not have classpath visibility to my dbcontrol & pojo, so i put the dbcontrol & the pojo into a java control project & made a library out of this. i double checked that the web project could see the classes in the library & they could.
so i created a separate ejb project that also could now see the classes in the library. i thought i was in the home stretch. i now have these projects in my first application:
administrationControls, administrationWeb, & administrationEjb. i moved the administrationControls.jar & the administrationEjb.jar over to the WEB-INF/lib directory of my (remember: non-workshop) war & wired up the code to pull the bean off jndi tree to make the rmi call. but it didn't work. so i backtracked & created a new jsp back in my workshop project that would make the same rmi call so that i could use the debugger. with this as the background, here is my specific problem.
what i noticed is that the ejb code itself works correctly. i guess i should show it as well.
<pre>
public class SiteAlertMessagesAPI extends GenericSessionBean implements SessionBean {
* This is the control used to generate this pageflow
* @common:control
private SiteAlertMessageDBControl dbControl;
public void ejbCreate() {
// Your code here
* @ejbgen:remote-method
public SiteAlertMessage getCurrentMessage() throws Exception {
SiteAlertMessage message = null;
try {
// dbControl is null here
message = dbControl.getCurrentMessage();
catch (Exception e) {
e.printStackTrace();
return message;
</pre>
the problem is that my dbControl object is null. what i did was cut & paste the code from the jpf over to my bean. like i stated earlier, i assumed that the annotation would tell weblogic to instantiate an instance. this was obviously not the case. incidentally, i rewrote my ejbCreate() method like this:
<pre>
public void ejbCreate() {
// Your code here
dbControl = new SiteAlertMessageDBControl();
</pre>
but workshop gives me a "error: this type is abstract and thus cannot be instantiated" warning.
my question is: how do i wire up an ejb to use a database control jcx object so that the dbcontrol is instantiated at runtime?
any light you could shed on this would be most appreciated. thanks,
doug -
IS java database control (jcx) sinchronized?
Hi,
I use workshop for create a web application.
I have make a java control database and I have import this control in my page flow.
So the database control result in controller class as a class intance variable .This class variable is used for all client request, there are synchronization problem?
In servlet analog case certainly , a class variable would have to be syncrhonized, and here ?
Thanks !Workshop Database control makes synchronous call to shuffle data to and from data source. Is this the question? Or, do you mean thread-safety?
-
EM Database Control 11.1.0.6.0 을 구성하는 도중에 발생하는 repository create error에 관한
원인 및 해결 방법을 제시합니다.
Problem Description
다음은 emca를 구성하여 repository를 구성하려다가 실패하여 다시
drop하고 create 시에 이와 같은 ORA-20001 이라고 하는 SYSMAN user가 이미 존재한다고
하는 에러에 대한 해결방법입니다.
emca -deconfig dbcontrol db -repos drop 수행 중에 다음과 같이 failed가 발생하고,
구 43: WHERE username = upper('&EM_REPOS_USER') ;
신 43: WHERE username = upper('SYSMAN') ;
[09-03-2008 11:42:20] Drop Repos User. Return code = 58.
[09-03-2008 11:42:20] Failed. <===
[09-03-2008 11:42:20] Dropping Roles/Synonymns/Tablespaces ...
[09-03-2008 11:42:23] Return code = 66.
[09-03-2008 11:42:23] Failed.
[09-03-2008 11:42:23] Unquiescing DB ...
[09-03-2008 11:42:24] Return code = 66.
[09-03-2008 11:42:24] Failed. <===
[09-03-2008 11:42:24] Dropped Repository Successfully.
위와 같이 drop fail 이후에 emca -config dbcontrol db -repos create 수행 시
ORA-20001: SYSMAN already exists..
ORA-06512: 줄 17에서
이와 같은 에러를 만나서 다시 create가 제대로 되지 않는 경우를 볼 수 있다.
Environment :
아래의 이름과 환경변수는 사용자의 환경에 따라 달라질 수 있습니다.
OS : Microsoft Windows XP Professional 32bit windows
컴퓨터이름 : jeher
Database version : 11.1.0.6.0
ORACLE_SID : orcl
ORACLE_HOME : D:\app\jeher\product\11.1.0\db_1
em 에 사용되는 HOSTNAME_SID : jeher_orcl
에러 증상
아래의 log는 실제 emca 수행 시 자세한 log를 확인할 수 있는
D:\app\jeher\cfgtoollogs\emca\orcl\emca_repos_create_2008_03_09_14_39_55.log 의 내용입니다.
Check if repos user already exists.
구 6: WHERE username=UPPER('&EM_REPOS_USER');
신 6: WHERE username=UPPER('SYSMAN');
구 8: IF ( '&EM_CHECK_TYPE' = 'EXISTS') THEN
신 8: IF ( 'NOT_EXISTS' = 'EXISTS') THEN
구 11: raise_application_error(-20000, '&EM_REPOS_USER does not exists..');
신 11: raise_application_error(-20000, 'SYSMAN does not exists..');
구 14: ELSIF ( '&EM_CHECK_TYPE' = 'NOT_EXISTS' ) THEN
신 14: ELSIF ( 'NOT_EXISTS' = 'NOT_EXISTS' ) THEN
구 17: raise_application_error(-20001, '&EM_REPOS_USER already exists..');
신 17: raise_application_error(-20001, 'SYSMAN already exists..');
구 21: raise_application_error(-20002, 'Invalid Check type &EM_CHECK_TYPE');
신 21: raise_application_error(-20002, 'Invalid Check type NOT_EXISTS');
DECLARE
1행에 오류:
ORA-20001: SYSMAN already exists..
ORA-06512: 줄 17에서
Explanation
이러한 에러는 주로 emca command 중에서 emca -deconfig dbcontrol db -repos drop
을 수행하다가 Service만 정리가 되고, repository가 깨끗하게 정리가 되지 않고
오류가 발생하거나 hang 이 발생하는 경우에 나중에 다시 create 시에 나타나는 에러입니다.
11g emca 수행 시 에러 log는 $ORACLE_BASE\\cfgtoollogs\emca\orcl\ 아래에 생성된 log를 확인합니다.
Solution Description
다음과 같은 명령으로 EM Configuration file들과 repository를 정리할 수 있습니다.
<Note:278100.1> How To Drop, Create And Recreate DB Control In A 10g Database?
A. Delete DB Control Objects 의 상세 설명은 Manual하게 DB Control을 DELETE하는 절차입니다.
이 부분을 보시면 아주 자세히 설명되어 있습니다.
The procedure is the same for 10g R1, R2 and 11g 11.1.0.6.0.
절차1) Configuration file 정리 작업
A) To delete the configurartion files:
- remove the following directories from your filesystem:
<ORACLE_HOME>/<hostname_sid>
예를 들어 D:\app\jeher\product\11.1.0\db_1\JEHER_ORCL 이라는 디렉토리를 제거합니다.
<ORACLE_HOME>/oc4j/j2ee/OC4J_DBConsole_<hostname>_<sid>
예를 들어 D:\app\jeher\product\11.1.0\oc4j\j2ee\OC4J_DBConsoleJEHER_ORCL 이라는
디렉토리를 제거합니다.
B) 레지스트리에서 SERVICE 제거 작업.
Note: On Windows you aslo need to delete the DB Console service:
- run regedit
- navigate to HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services
- locate the OracleDBConsole<sid> entry and delete it
OracleDBConsoleORCL 이라는 서비스 엔트리를 클릭하고 제거합니다.
Alternatively on Windows XP and Windows Server 2003 you can run the following from the command line:
'sc delete <service_name>' where <service_name> is the DB Control service name (typically: OracleDBConsole<sid>)
절차2) EM repository 를 manual 하게 drop하기.
To delete the repository
Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account
and mangement objects:
sqlplus "/as sysdba"
SHUTDOWN IMMEDIATE;
STARTUP RESTRICT;
EXEC sysman.emd_maintenance.remove_em_dbms_jobs;
EXEC sysman.setEMUserContext('',5);
REVOKE dba FROM sysman;
DECLARE
CURSOR c1 IS
SELECT owner, synonym_name name
FROM dba_synonyms
WHERE table_owner = 'SYSMAN'
BEGIN
FOR r1 IN c1 LOOP
IF r1.owner = 'PUBLIC' THEN
EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;
ELSE
EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;
END IF;
END LOOP;
END;
DROP USER mgmt_view CASCADE;
DROP ROLE mgmt_user;
DROP USER sysman CASCADE;
ALTER SYSTEM DISABLE RESTRICTED SESSION;
[참고 사항]
1) DROP USER mgmt_view CASCADE; 를 수행 시 이미 mgmt_view가 emca -deconfig 명령에 의해
drop이 되었다면 ORA-1918 ERROR가 발생하는데, 이는 무시합니다.
"ORA-01918: 사용자 'MGMT_VIEW'(이)가 존재하지 않습니다."
2) 참고 명령어
Note: The above(절차2) will completely delete the DB Control repository from the database;
under certain circumstances (e.g. you want to recreate the repository later on)
the following statemnts may be sufficient to remove the repository:
sqlplus "/as sysdba"
a. drop user sysman cascade;
b. drop role MGMT_USER;
c. drop user MGMT_VIEW cascade;
d. drop public synonym MGMT_TARGET_BLACKOUTS;
e. drop public synonym SETEMVIEWUSERCONTEXT;
===================================
절차3) EM console HTTP port와 Agent port 설정 해제 작업
Remove the entries for the old dbconsole information from the
$ORACLE_HOME/install/portlist.ini file
제거 작업 단계 중 마지막으로 D:\app\jeher\product\11.1.0\db_1\install\portlist.ini file
내에서 old dbconsole 정보를 제거합니다.
[ Example ]
Ultra Search HTTP 포트 번호 =5620
Enterprise Manager 콘솔 HTTP 포트(orcl) = 1158
Enterprise Manager 에이전트 포트(orcl) = 3938
위와 같이 Enterprise Manager 콘솔 HTTP 포트와 Enterprise Manager 에이전트 포트(orcl)
가 보이는데, 이 line들을 지웁니다.
아래의 절차4) 부터 절차8) 까지는 다시 create해주는 과정과 환경 셋업 작업입니다.
절차4) C:\WINDOWS\system32\drivers\etc\hosts file에서 다음을 추가해 줍니다.
127.0.0.1 localhost
10.10.10.10 jeher
10.10.10.10 은 내 네트워크 환경 -> 로컬연결영역3(Microsoft Loopback Adapter)
-> 속성(인터넷 프로토콜 TCP/IP)
-> 속성(다음 ip 주소 사용의 IP 주소가 10.10.10.10)
위와 같이 확인하여 얻어질 수 있습니다.
절차5) 다시 emca -config dbcontrol db -repos create 를 수행합니다.
절차6) 레지스트리에 문자열값 oracle_hostname 이 jeher로 되어 있는 지 확인.
절차5 가 성공적으로 수행이 되면 관리도구 -> 서비스에 OracleDBConsoleORCL 이라는
서비스가 다시 생성됩니다.
- run regedit
- navigate to HKEY_LOCAL_MACHINE/Software/Oracle/Sysman/OracleDBConsoleORCL
- 문자열값 oracle_hostname : jeher 로 되어 있는지 확인합니다.
절차7) emd.properties 에서 timezone 수정
D:\app\jeher\product\11.1.0\db_1\jeher_orcl\sysman\config 아래에 있는
emd.properties file에서 agent timezone를 Asia/Seoul 로 대소문자를 구분하여 입력합니다.
For example)
omsRecvDir=D:/app/jeher/product/11.1.0/db_1/jeher_orcl/sysman/recv
agentTZRegion=Asia/Seoul
이와 같이 저장하고 나옵니다.
절차8) EM 11g LOGIN 접속 방법.
https://jeher.kr.oracle.com:1158/em 로 접속하면 됩니다.
username : sys
password : oracle
connect as SYSDBA
OC4J 에 설치 시 보안 설정이 되어 있으므로, http 가 아닌 https 로 접속해야 합니다.
11g의 경우, password file이 자동으로 $ORACLE_HOME/dbs (windows 의 경우, $ORACLE_HOME/database) 아래에
생성되므로, 따로 생성이 불필요합니다.
remote_login_passwordfile='EXCLUSIVE'로 자동 setting 되어 있습니다.
References
<Note:278100.1> How To Drop, Create And Recreate DB Control In A 10g Database?I ma using correct sid, have a look at /etc/oratab
[oracle@rac1 bin]$ echo $ORACLE_SID
orcl
[oracle@rac1 bin]$ cat /etc/oratab
#Backup file is /raczone/11.2.0/product/11.2.0/dbhome_1/srvm/admin/oratab.bak.rac1 line added by Agent
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
# Multiple entries with the same $ORACLE_SID are not allowed.
#+ASM1:/raczone/grid_home:N # line added by Agent
#dev:/raczone/db_home1:N # line added by Agent
#*:/raczone/oem/OracleHomes/db10g:N
#*:/raczone/oem/OracleHomes/oms10g:N
#oemrep:/raczone/oem/OracleHomes/db10g:N
#*:/raczone/oem/db10g:N
#*:/raczone/oem/oms10g:N
#oemrep:/raczone/oem/db10g:N
+ASM1:/raczone/grid_home:N # line added by Agent
# *:/home/oracle/OracleHomes/db10g:N
# *:/home/oracle/OracleHomes/oms10g:N
emrep:/home/oracle/OracleHomes/db10g:N
*:/home/oracle/OracleHomes/db10g:N
*:/home/oracle/OracleHomes/oms10g:N
oemrep:/home/oracle/OracleHomes/db10g:N
dev:/raczone/db_home1:N # line added by Agent
orcl:/raczone/11.2.0/product/11.2.0/dbhome_1:N # line added by Agent
*:/home/oracle/Oracle/Middleware/oms11g:N
*:/home/oracle/Oracle/Middleware/agent11g:N
[oracle@rac1 bin]$ -
Problem with database control returning multiple rows as Array using Oracle
Has anybody using Oracle gotten a Database control that
returns multiple rows to work returning an array?
The only way I can seem to return multiple rows is by returning
a RowSet. Returning an array gives me a NullPointerException
(when called within a pageFlow). When calling a database control
that returns an array from a web service I get a
"java.sql.SQLException: ResultSet has no more data." error.
The samples using the pointbase database seem to work, but when I
converted the CustomerDBClient web service to use Oracle, it starts
failing on calling the database control that returns an array
with: "java.sql.SQLException: ResultSet has no more data."
Has anybody gotten this to work using Oracle?
I'm also having some problem returning an Iterator. It seems
to work when called from a web service, but returns nothing
if called from a page flow.
I'm using Oracle 8.1.7 and WebLogic 8.1.
EricDo you need a particular service pack installed to return an array of custom object?
I am getting a ResultSet contained no data error when trying.
Thanks,
-Thomas
"Robin Karlin" <[email protected]> wrote:
>
Eddie O'Neil <[email protected]> wrote:
All--
Unfortunately, returning an Iterator to a JPF (or JSP) from a
database control is broken in WLW 8.1, though it will work inside of
a
JWS or JCS.
There shouldn't be a problem with returning an array of objects out
of Oracle to the JPF, and if you need an Iterator specifically, youcan
wrap the array in an Iterator implementation.
Sorry for the inconvenience.
Eddie
Lenny wrote:
I have gotten it to work on Oracle using Array:)
However, I haven't gotten it to work on Oracle using Iterator:( Itis so
simple, but doesn't work:(
"Eric Dokken" <[email protected]> wrote in message
news:[email protected]...
Has anybody using Oracle gotten a Database control that
returns multiple rows to work returning an array?
The only way I can seem to return multiple rows is by returning
a RowSet. Returning an array gives me a NullPointerException
(when called within a pageFlow). When calling a database control
that returns an array from a web service I get a
"java.sql.SQLException: ResultSet has no more data." error.
The samples using the pointbase database seem to work, but when I
converted the CustomerDBClient web service to use Oracle, it starts
failing on calling the database control that returns an array
with: "java.sql.SQLException: ResultSet has no more data."
Has anybody gotten this to work using Oracle?
I'm also having some problem returning an Iterator. It seems
to work when called from a web service, but returns nothing
if called from a page flow.
I'm using Oracle 8.1.7 and WebLogic 8.1.
Eric
I get the same error that Eric reported when trying to return an Array
of objects.
It is really frustrating because I can't use much of the built-in control
logic
that WLW provides. All I did was create a data pool for Oracle and a
datasource.
I modified the sample app in C:\bea81\weblogic81\samples\workshop\SamplesApp\WebApp\callJavaControl
to point to that datasource and I get the error that Eric reports above.
Can
anyone help me out????
Thanks,
Robin -
Database Connection Hangs - getConnection()
Dear Friends,
i have a serious problem with a database connectivity,
now the issue is,i have written the code to connect to the databaseserver which is in some remote place,it loads the driver,that's the oracle driver,but when it comes to DriverManager.getConnection,that's the connectivity with the database it hangs.Now first i thought their might be a network problem but then it should give a networkexception,and also i put some dummy userid,password and also the IPAddresse,port number ,and it gave me a SQLException,so i assume that their is no network problem.then my question is why does it get hangs when the control comes to the getConnection method,
what might be the problem?
Is there any problem with the database server? Plz Help Me!Jeba,
Fill in the blank: Assumption is the mother of all .... ups. :P
I'm not an Oracle expert or even Oracle novice, but some simple principles should apply.
First up, can you reach the database server with simple stuff like ping.
If you can, can you then see shared folders etc from your browser?
If the answer to these is yes, you should not have a network problem.
As a suggestion, try to ensure that you have a user name / password combination with the highest access rights possible - On at least one other database there are issues to do with rights associated with different usernames.
Finally, do you have something like dbVisualiser?
Google it and download it. You already have the jdbc drivers which it needs, so just configure it as needed and see if it can connect. If it can, you may have a problem with your connection string.
Maybe you are looking for
-
Issue with setting mm_username
Folks, I'm new to DreamWeaver, and to web design in general, so I'm fairly sure I'm doing something obvious wrong. I have an SQL database with registered users in, I have a php login page, and I have a php "welcome" page, on which, I want to display
-
Can't open numbers on my iPhone 5S and iPad mini (1st Gen.) after updating to the new version 2.0.1. Please help!
-
I'm trying to update my parent's iMac G5 with OS X Snow Leopard and unable to do so because it doesn't have an Intel processor. Are all new upgrades going to be unavailable? What is the last available upgrade? Is it possible to get an Intel processor
-
How do you now reach the Java settings for your machine for things like memory allocation? Also, what about 32- and 64-bit architecture? How do I control which is active?
-
Trying to change my NAT type from Open to Strict or Moderate.
My NAT type is open but I can't get any games. I told my friend and he said try and change my NAT type from Open to Strict, and that it might help in joining games. I can join CoD4 games, but not MW2 or MW3 games. Can anyone help me? I am playing on