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,
doug

Hi,
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

Similar Messages

  • Remote access database using EM Database Control Console

    When I install the Oracle database 10g, it gives me two choices:
    1)Using Grid Control for Database Management and
    2)Using Database Control for Database Management.
    When I select the #2, according to the Guide, I'll be able to manage my database locally. (Assume the database server's IP address is: DB_IP_Address, then I can use: http://DB_IP_Address:5560/em). But wait a minute___
    a)What does this "locally" mean? If the Oracle DB is installed in a remote location, and there is no LAN connection to it, can I still access it via the Oracle Enterprise Manager (Database Control Console)? (i.e., via the HTTP protocol)
    b)The same question is asked for the iSQL*Plus in regarding to the remote access. I guess the answer to a) above will automatically answer the b) ? (Actually I doubt that I can access remote database using the iSQL*Plus via HTTP protocol).
    Thanks
    Scott

    Hi,
    and there is no LAN connection to itWell you'll need some network link in order to connect successfully.
    What is meant by locally is that you can only manage databases installed on the local computer.
    For example if you installed it on machine "CPTR1", and on another machine "CPTR2", then you can't use http://cptr1:5560/em to manage the databases on "CPTR2. And vice versa.
    About iSQL*Plus, in fact, as far as the tns alias is ok from "CPTR1", you can connect to the databases on "CPTR2", "CPTR3", ....
    HTH,
    Yoann.

  • Error using RMAN thru Database Control

    Hello guys..
    I installed Oracle 10gR2 on solaris 10, and created a sample DB called HEAT. This database is configured to run in Archivelog mode and also created Flash_recovery_area.
    Iam trying to take a simple backup thru RMAN using OEM ( Database Control). there is only 1 database on that server and i plan to use controlfile instead of recovery catalog.
    Now here are the steps when i execute, i get an ERROR.
    1. connected as 'sys' from Database Control.
    2. Went to Maintenence Tab, click in Backup settings.
    3. click on Device Tab, enter OS credentials and click on "Test disk backup"..
    4. I get an error that says "Disk Backup Test Failed!"
    When click on View Error Details :
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Recovery Manager: Release 10.2.0.1.0 - Production on Fri Feb 2 12:53:29 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    RMAN>
    connected to target database (not started)
    RMAN>
    echo set on
    RMAN> run {
    2> allocate channel oem_disk_backup device type disk;
    3> backup as BACKUPSET current controlfile tag '02022007125328';
    4> restore controlfile validate from tag '02022007125328';
    5> release channel oem_disk_backup;
    6> }
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of allocate command at 02/02/2007 12:53:30
    RMAN-06403: could not obtain a fully authorized session
    ORA-01034: ORACLE not available
    RMAN> allocate channel for maintenance type disk;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of allocate command at 02/02/2007 12:53:30
    RMAN-06403: could not obtain a fully authorized session
    ORA-01034: ORACLE not available
    RMAN> delete noprompt backuppiece tag '02022007125328';
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of delete command at 02/02/2007 12:53:30
    RMAN-12010: automatic channel allocation initialization failed
    RMAN-06403: could not obtain a fully authorized session
    ORA-01034: ORACLE not available
    RMAN> exit;
    Recovery Manager complete.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    I only have 1 database , and it is configured to backup using Control file and not Recovery catalog ( which is the default)...
    What additional steps do i have to do, to take a simple backup using database control ? I am not sure why it says Database not available...while DB is indeed available and open.
    any help is appreciated..
    thanks

    I, too, am receiving these same errors when I do my backups. The sysadmin took the systems down over the weekend and the backup has failed ever since. Database is up, ORACLE_SID looks fine, what could be wrong? This nightly backup worked before system went down. I can connect as sysdba using the ORACLE_SID as set.
    Thanks,
    Candy

  • Problem mapping to XMLBean using database control

    Hi
    I have to generate an XML document based on the values returned from the database. I have an industry standard XSD with me and Im trying to use the database control to automatically map the resultset data to the XMLBean. While doing so, it works fine for flat structures that doesnt contain any complex types and attributes. But, when the XSD contains attributes or nested complex types it creates XMLBean with a flat structure and generates an invalid XML document. All the attributes get mapped to elements and thus when i try to validate, it fails.
    I would appreciate if anyone can let me know if this is a limitation in weblogic 8.1 or do i need to configure something. This problem has been bugging me for a very long time and i have posted in all forums and i strongly feel that there is no point checking for everyfield value and setting into XMLBean manually. Also the number of fields in our XSD is 400. So any help would be greatly appreciated.
    Thanks
    Kishore

    Hi Kishore,
    This is vinod.I have same problem but not too complicated as yours.It is written u got simple values from database using flat structures.could u please post the code for me.
    We have this requirement:
    We have to retrieve the each row from the database and display in form of a tree.how do we get it.
    Thanx in advance.
    Vinodh

  • Recover Oracle DB 11.1.0.7 using target database controlfile RMAN Hot Backu

    Hi All,
    DB:11.1.0.7
    OS:RHEL Linux 4 64-bit
    Could anyone please share the "Steps to recover Oracle DB 11.1.0.7 using target database control file RMAN of previous Hot Backup"
    We are not using Recovery Catalog.
    Thanks for your time!
    Regards,

    If the current control file is still present on disk, you can merely issue a RESTORE DATABASE followed by a RECOVER DATABASE.
    If you are not attempting a Complete Recovery (i.e. upto the last transaction in the online redo logs) and/or the online redo logs are not available, you would also include a SET UNTIL (scn or log sequence or time) clause in you RESTORE and RECOVER.
    If the current control file is not available, you would STARTUP NOMOUNT, then restore the controlfile, then MOUNT the database before proceeding with the RESTORE and RECOVER.
    Oracle will automatically identify and restore and apply the necessary archivelogs when you issue the RECOVER DATABASE. You don't need to manually restore them in advance. However, you will need sufficient disk space to restore the archivelogs (e.g. if the backup is 3 days old, Oracle will attempt to restore 3 days of archivelogs).
    The standard documentation is at
    http://download.oracle.com/docs/cd/B28359_01/backup.111/b28270/rcmcomre.htm#i1009223
    I have numerous examples at
    http://hemantoracledba.blogspot.com
    and
    https://sites.google.com/site/hemantswebsite/oracle-diagnostics/MyOracleBlogBackup_and_RecoveryPosts.pdf
    Hemant K Chitale
    Edited by: Hemant K Chitale on May 16, 2011 9:45 AM

  • How to create an EJB Module using Eclipse

    Hi,
    How do I create a single EJB module and make a deployable EJB jar? I already have a existing source directory that contains the java files and the deployment descriptor. I am using Eclipse Ganymede 3.4 and Weblogic 9.2.
    Thanks.
    Edited by: user10387019 on Dec 9, 2008 1:39 PM

    Start out by creating an empty EJB project using the EJB Project wizard. Make sure to specify your WebLogic 9.2 installation as target runtime on the first page of the wizard. If your EJB source code is plain spec-compliant EJB, then your project is ready. If you are using WLS EjbGen technology, then you will also need to enable that feature on the project. You can do that at project creation by clicking the Modify button next to the Configuration combo on the first page of the wizard and then selecting WebLogic EJB Gen Support facet.
    Once the project is created, you are ready to import your source. You have several choices here. You can either copy your source into the src directory created for you or you can delete that source directory and link to a source directory elsewhere on the file system. To do the latter, right click on the project and select properties. Go to Java Build Path and select the Source tab. Remove the existing source directory. Then click on Link Source button and point to your existing source directory.
    That should be all that's necessary. Hope that helps.
    - Konstantin

  • Uploading EJB Jars using Enterprise Manager Console

    I realize most publish their EJBs as an "ear" and their web modules as "war
    But, what if I want to publish my ejb as a "jar" component? The Enterprise Manager Oc4J home has buttons for uploading WAR and EAR components only.
    Please suggest work arounds.

    Our forthcoming 10.1.3 release will support the additional deployment of standalone JAR files for EJB applications from Application Server Control (EM).
    In earlier releases you can either:
    1. Wrapper the JAR file witihn an EAR file and deploy that.
    2. Manually deploy your JAR file to the default application using the j2ee/home/application.xml file by adding an entry such as:
    <ejb-module id="jmsrouter_ejb" path="../../home/applications/jmsrouter-ejb.jar"/>
    Note that in an DCM managed environment, this form of manual deployment not a recommended option. Make sure you notify the DCM repository of this type of change using "dcmctl updateConfig".
    cheers
    -steve-

  • Firefox opens websites when hard wired to router, but when using wireless I get a server not found message.

    Firefox (3.6.10) opens websites when hard wired to router, but when using wireless I get message: SERVER NOT FOUND FIREFOX CAN'T FIND THE SERVER AT SEARCH.AVG.COM. My homepage is http://www.google.com/firefox?client=firefox-a&rls=org.mozilla:en-US:official. My anti-virus is AVG free 8.5.448. What can cause this?
    If Work Offline is checked in Firefox File, I can get to Google search site. When I un-check it I still get the Server Not Found message

    Did you check the connection settings?
    *Tools > Options > Advanced > Network : Connection > Settings
    *https://support.mozilla.org/kb/Options+window+-+Advanced+panel
    If you do not need to use a proxy to connect to internet then try to select "No Proxy" if "Use the system proxy settings" or one of the others do not work properly.
    See "Firefox connection settings":
    *https://support.mozilla.org/kb/Firefox+cannot+load+websites+but+other+programs+can

  • Using a JMS control from an EJB project

    I'm developing an EJB in Workshop and my EJB is expected to send messages to a JMS queue. How can I use a JMS control (JCX) from my EJB?

    If you're talking about making an executable jar file that will work with the bouncycastle jar:
    (1) Make a jar as usual with your classes in it
    (2) Include a manifest file that specifies the class containing your app's main() method
    (3) In that same manifest, make sure that the bouncycastle jar is included in the Class-Path
    Details are in Sun's Tutorial: [Packaging Programs in JAR Files|http://java.sun.com/docs/books/tutorial/deployment/jar/index.html] and specifically [http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html|http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html] for the business of having your app recognise the other jar file's classes at runtime.
    Doubtless this can all be done from the comfort of your IDE, but I don't know how. There will be documentation on NetBeans site I suppose.
    Edited by: pbrockway2 on Jul 23, 2008 8:59 PM

  • Expose ADF-BC as ejb and use it in UI from the datacontroller

    Hi Experts.
    Here i am looking forward some experts view and guidelines on this deployment architecture question. Currently i have deploped one ADF Web fusion application which has ADF-BC and web. In that web project datacontroller side i can be able to see the view object instances under each business service. Also the web has some UI bindings too. Now the application is working fine fine on one weblogic instance.
    question1) Can i deploy this above project into two weblogic instances one with ADF-BC model ( if yes how to deploy that alone) and the other web into the another instance. ( If yes can to configure the project)
    question 2) Now can i expose the ADF-BC as ejb and use it in the same way in the web (like drag and drop from the Data controller). ? I tried the option expose the ADF-BC as ejb In this case if the VO instance access methods are not exposed. So how can i access them in the UI? For example, assume if we have 2 view object EmployeeView and DepartmentView in the application module, then after immediately create the AM, the datacontrol shows the view object instances name like EmployeeView1, DepartmentView1 and also in the web we just drag and drop to create appropriate UI. This is fine. Now i create the ejb based on the AM. In the Remote interface i have the
    void removeEntity(Object entityDTO)
    method. If i look at the datacontrol section still the data controls remains same. I think this datacontrol still shows the ADF-BC direct connectivity. If i try to create the new ejb data control which points to the same AM ejb for web, then i couldn't see the above view instance name called EmployeeView1, DepartmentView1, where i can drag and drop in the UI.
    I can only see methods like EJBHome etc.....
    So this means i cannot use the Exposed EJB from the ADF-BC Application Module to drag and drop in UI like the ADF-BC direct unless we explicitly create the view access methods in the interface. Am i correct?
    Or still am i getting the wrong assumption.
    Much appreciated if u point some code to understand this.
    -t

    Thanks for the reply.
    Basically we have found the way to expose the ADFBC as ejb and use it for data binding in the UI. I will update this thread soon about our finding. But now i have an architecture question, can we deploy as 3-tier deployment for ADF-BC using the exposed ejb interface? Because i am worrying we might run into some ADF issue in furture if we move this path. Oracle gurus please share your ideas or thoughts.
    -t

  • I got a external Apple Wired Keyboard (w/ NumPad), caps lock mapped to control doesn't work with tab + caps lock + shift

    I got a external Apple Wired Keyboard (w/ NumPad) since I'm a developer. I have used control panel > keyboard > modifier keys to make the caps lock key the control key. I can't get it to work when I press caps lock (which maps to control) +shift + tab (which I use to change tabs backwards).
    Any ideas? It works when I use the regular control key, and it works on my built-in MBPro keyboard. Thx!

    Hi Steve, Welcome to apple discussions.
    Hmm, that is a strange problem. Well, you've already done what I would suggest which is to go to the keyboard settings and click the "Restore defaults" button in the modifier keys window and try again. If that doesn't work then you can restart the computer and check. If that doesn't work you can try to reset the pram. Hold the optioncommand+PR buttons after you hear the startup chime, it should chime again, I let it chime a third time just for good measure and see if things look better.
    If that fails then you can try making another account and seeing if the caps lock works in the new account. There might be some strange error on your account that would be corrected for in a new account. After that it gets more labor intensive. Do a system re-install, do an erase and install.
    You might consider a trip to the apple genius bar there in Honolulu if can. The should be able to run through all that for you. You're still under warrantee so take advantage and get some help.
    Oh, and just a disclaimer that I learned from Adam on the maccast podcast. Make a full, complete backup including a time machine and bootable (like superduper or carbon copy cloner) disk before you do any of the above or take the unit it for service.
    Hope this helps.
    John

  • How to use active X controls to read/write protect an excel or word document created by created by Save Report to File VI

    Hi all,
    I'm trying to creat a word and excel documents using Save Report to File VI. When wiring a password to this last VI, the document created are only protected against writing but not reading. How can I use active X controls to password protect these documents against reading?
    Thanks a bunch!
    O

    There is no predefined functionality available in LabVIEW. So you have to implement this on your own.
    It seems to me that you own the Office Report Generation Toolkit. You can use the Excel Get ActiveX References.vi from the Excel Specific >> Advanced palette to get access to the "generic" ActiveX Excel references. Starting from this point, you can use property and invoke nodes to get to the setting you are going to modify.
    Please refer to this link for information on Excel password protection. I have not searched for the object giving you access to those settings though....
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Form-based authentication in JBoss using a database and JAAS

    I am trying to set up simple authentication using a database. I am initially trying to secure all web resources, since my application accesses the EJBs via servlets (and is working fine without security). Later I will tighten things down so that the EJB's business methods will also have security in place.
    It seems that everything is in place but I am unable to authenticate a user when I use a valid login/password combination (I am being redirected to the login error page). No exceptions appear in the JBoss console, and the database tables are populated with proper values. I'm clueless as to why this isn't working -- hopefully someone reading this can give me a clue as to what is going wrong.
    Here is what I have done so far:
    1) I have two tables in my database, one for the username and password, and another for roles. The database tables look like this:
    table name: principals
    column: principal_id VARCHAR(64) primary key
    column: password VARCHAR(64)
    table name: roles
    column: principal_id VARCHAR(64)
    column: user_role VARCHAR(64)
    column: role_group VARCHAR(64)
    2) I have added an entry in $JBOSS/server/default/conf/login-config.xml to declare an application policy which uses a DatabaseServerLoginModule. In this entry I have specified the SQl to be used by the module for selecting the password and role, following the example in the JBoss Getting Started Guide (p. 57):
        <!-- added for HIM Server security -->
        <application-policy name="HIM-client-login">
            <authentication>
                <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
                              flag="required">
                    <module-option name="dsJndiName">java:/OracleDS</module-option>
                    <module-option name="principalsQuery">select password from principals where principal_id=?</module-option>
                    <module-option name="principalsQuery">select user_role, role_group from roles where principal_id=?</module-option>
                </login-module>
            </authentication>
        </application-policy>
         ...3) I have added a security domain entry in the jboss-web.xml file:
        <!-- All secure web resources will use this security domain -->
        <security-domain>java:/jaas/HIM-client-login</security-domain>
        ... 4) I have declared a security constraint in the web.xml file:
        <!-- security configuration -->
        <security-constraint>
            <display-name>Server Configuration Security Constraint</display-name>
            <!-- the collection of resources to which the sucurity constraint applies -->
            <web-resource-collection>
                <web-resource-name>Secure Resources</web-resource-name>
                <description>Security constraint for all resources</description>
                <!-- the pattern that this constraint applies to -->
                <url-pattern>/*</url-pattern>
                <!-- the HTTP methods that this constraint applies to -->
                <http-method>POST</http-method>
                <http-method>GET</http-method>
            </web-resource-collection>
            <!-- the user roles that should be permitted access to this resource collection -->
            <auth-constraint>
                <description>Only allow those users that are in the following role</description>
                <role-name>user</role-name>
            </auth-constraint>
            <!-- declare a transport guarantee, if any -->
            <user-data-constraint>
                <transport-guarantee>NONE</transport-guarantee>
            </user-data-constraint>
        </security-constraint>
        ... 5) I have a simple login form (LoginForm.jsp) which encodes j_security_check:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
        <head>
            <title>HIM Client Login</title>
        </head>
        <body>
            <form method="POST"
                  action='<%= response.encodeURL( "j_security_check" ) %>'>
                Username: <input type="text"
                                 name="j_username"><br/>
                Password: <input type="password"
                                 name="j_password"><br/>
                <br/>
                <input type="submit"
                       value="Login">
                <input type="reset"
                       value="Reset">
            </form>
        </body>
    </html>
        Can anyone see from the above that I have missed something, or that I have done something wrong ?
    Is there a way to get more information ? All I see in the access log file are logs of the requests for the servlet, j_security_check, and the login and error pages, and it might be helpful to have a little more information as to what is going on.
    Thanks in advance for any insight.
    -James

    Hi,
    I have exactly followed your configurations. However, I dont have the same database tables in my database. I used the following:
    <module-option name="principalsQuery">select password from s_users where username=?</module-option>
    <module-option name="rolesQuery">select role from s_users where username=?</module-option>However, when I try to logon I get the following error message from jboss:
    "ERROR [org.jboss.security.auth.spi.UsersRolesLoginModule] Failed to load users/passwords/role files
    java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found" although I do not want to use property files as I want to use the oracle database.
    Any help appreciated!

  • Using MySQL database in Jdeveloper

    I am using MySQl database in my applicaion.I have successfully created connection to the database and have created entity beans from the tables and a session bean as well to use the entity beans
    now when i am trying to call persistEntity(object obj) of session bean, basically to insert records into tables.
    i am getting following exception :
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"tdmce_approval_status" (APPROVALLEVEL, DOCREFNO, STATUS, COMMEError Code: 1064
    Call:INSERT INTO "tdmce_approval_status" (APPROVALLEVEL, DOCREFNO, STATUS, COMMENTS, DMCETYPE, ACTIONDATE) VALUES (?, ?, ?, ?, ?, ?)
         bind => [1, 12355, Approved, abcd, import, 12/03/2008]
    i believe this insert query is automatically generated by Jdeveloper. have tried executing the same query in sql sheet it has worked perfectly fine.
    Can any one please suggest on this ?

    Hi Frank,
    thanks for your response, there are only setters & getters method in my entity
    my entity look like this
    package buslogic;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import javax.persistence.IdClass;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    @Entity
    @NamedQuery(name = "TdmceApprovalStatus.findAll",
    query = "select o from TdmceApprovalStatus o")
    @Table(name = "\"tdmce_approval_status\"")
    @IdClass(TdmceApprovalStatusPK.class)
    public class TdmceApprovalStatus implements Serializable {
    @Column(nullable = false)
    private String actiondate;
    @Id
    @Column(nullable = false)
    private Integer approvallevel;
    private String comments;
    @Column(nullable = false)
    private String dmcetype;
    @Id
    @Column(nullable = false)
    private String docrefno;
    @Id
    @Column(nullable = false)
    private String status;
    public TdmceApprovalStatus() {
    public String getActiondate() {
    return actiondate;
    public void setActiondate(String actiondate) {
    this.actiondate = actiondate;
    public Integer getApprovallevel() {
    return approvallevel;
    public void setApprovallevel(Integer approvallevel) {
    this.approvallevel = approvallevel;
    public String getComments() {
    return comments;
    public void setComments(String comments) {
    this.comments = comments;
    public String getDmcetype() {
    return dmcetype;
    public void setDmcetype(String dmcetype) {
    this.dmcetype = dmcetype;
    public String getDocrefno() {
    return docrefno;
    public void setDocrefno(String docrefno) {
    this.docrefno = docrefno;
    public String getStatus() {
    return status;
    public void setStatus(String status) {
    this.status = status;
    & session bean class to call the same
    package buslogic;
    import buslogic.persistance.TdmceApprovalsFlow;
    import buslogic.persistance.TdmceApprovalsFlowPK;
    import buslogic.persistance.TdmceUserDetails;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(name = "FirstCheckFacade")
    public class FirstCheckFacadeBean implements FirstCheckFacade {
    @PersistenceContext(unitName = "SOAServices")
    private EntityManager em;
    public FirstCheckFacadeBean() {
    public Object mergeEntity(Object entity) {
    return em.merge(entity);
    public Object persistEntity(Object entity) {
    em.persist(entity);
    return entity;
    /** <code>select o from TdmceApprovalsFlow o</code> */
    public List<TdmceApprovalsFlow> queryTdmceApprovalsFlowFindAll() {
    return em.createNamedQuery("TdmceApprovalsFlow.findAll").getResultList();
    public void removeTdmceApprovalsFlow(TdmceApprovalsFlow tdmceApprovalsFlow) {
    tdmceApprovalsFlow =
    em.find(TdmceApprovalsFlow.class, new TdmceApprovalsFlowPK(tdmceApprovalsFlow.getApprovallevel(),
    tdmceApprovalsFlow.getDmcetype()));
    em.remove(tdmceApprovalsFlow);
    /** <code>select o from TdmceUserDetails o</code> */
    public List<TdmceUserDetails> queryTdmceUserDetailsFindAll() {
    return em.createNamedQuery("TdmceUserDetails.findAll").getResultList();
    public void removeTdmceUserDetails(TdmceUserDetails tdmceUserDetails) {
    tdmceUserDetails =
    em.find(TdmceUserDetails.class, tdmceUserDetails.getUserid());
    em.remove(tdmceUserDetails);
    Where else can i look for the query?or for mysql i have to configure some property.

  • Can i use "begin" and "end" in a database control

    hi there
    i just want to know if i can use begin and end with several sql update statments in between in a database control. u see, i need to run few update statements together. i don't want to put them in seperate method. i was wondering if i could put them together in on method and run it. is there any other way to do it if begin and end are not allowed. thanks

    I have a J2EE application, for which I have a module which is used by system administrators. this module is completly written in Java swing.
    and it does talk to my EJBs.
    If you don't have a firewall in your application, then you can directly make your applications in awt, swing and applets talk to EJBs. if you do have a firewall, then just write a web-service wrapper over your EJBs and other J2EE components and use them from desktop applications.
    It seems that you want to implement a kind of a applet based monitor application for your J2EE EJBs on the server. Applets cannot directly monitor your EJBs.
    Create a new module which has a service which acts as an event listener on the server. each j2ee component on the server notify it if there is a change to them. this service, can then write the data realted to the modification on a socket which is continiously being read by the applet. So you can implement a kind of a monitor for J2ee apps with applets.
    hope this helps.
    regards,
    Abhishek.
    PS:How did you manage to adore the AWT ;-) ? I found that it sucks (good performance.. very poor lnf) ... java swing sucks too (very poor performance ... avaerage lnf).

Maybe you are looking for