Kerberos SSO delegated credentials not persistent

We have a Kerberos SSO enabled http listener application that uses bindows (ajax) that runs on IBM i5 (aka OS/400 and AS/400) that runs fine with IE. I have found info on configuring Firefox (windows) for SSO (see notes further down) so I am testing with our app.
The initial connection authenticates just fine, but subsequent connections (according to our programmer reviewing our internal traces) are not sending a token with delegated credentials. So I guess the best way to describe this is lack of persistence within the session.
There doesn't seem to be an official site documenting SSO config, but this is what I found by googling ...
In url box type about:config, enter. A list of vars appears. Use filter to find network.*uris and set values to the domain name (ie mycorp.com). Additionally search for network.*-proxies and make sure values are set to "true". Additionally search for network.*sspi and make sure value is set to "true". To connect to site using SSO, specify the domain portion in the url (ie xxx.mycorp.com).
I also found bugzilla 520668 that was about how ugly the process was and claiming sspi should be false, but that causes an authentication failure on the initial connection.
Is there something I am doing wrong or missed in general set up and use ... or possibly some special token the application is supposed to pass back.

Thank you for your assistance, Tim.  We have now resolved all remote access issues.  It turned out that we had four different remote access scenarios.  For future reference, here is what we found:
1.  Users that remote via VPN couldn't log in:  Browser configuration issue - needed to add the domain to the Trusted Sites or Local Intranet (i.e. *.domain.com) because they weren't being authenticated when they turned on their personal machines that were off the network.
2.  Users logging in to domain but not getting authenticated via SSO:  Browser configuration issue - one particular group was not set to use Windows Integrated Authentication in IE by default.
3.  Users logging in to domain but not getting authentication via SSO:  Unknown browser configuration issue - although all browser settings seemed to be okay, one group had their browser settings reverted to default and everything started working.
4.  Users logging into another domain first couldn't get logged into our BOE:  Trust issue - although a trust had been established between our two domains, lag time to actually get logged into the system was over 10 minutes.  We will be investigating Active Directory Federation Service as a way to create a "shortcut" between the two domains.  In the meantime we have deployed BOE enterprise accounts for those users.

Similar Messages

  • Webservice credentials not persisting?

    CF 10; Have a webservice that requires basic auth. Set up just fine via the administrator (as ws1) with username and password. Can use ws1 not problem. However, a few days later, I start getting http 401 auth errors. For some reason, the credentials stop working in cfadmin. The account is just fine. If i hit update webservice, it refreshes the wsdl, and things work fine again for a few days. Is this a common problem? I can specify user/pass in my ws call, but I prefer not having that info sitting in code. Any help?

    I believe you are getting ORA-12638: credentials retrieval failed.
    If you search on metalink for this, you will get many threads which address this issue in different ways.
    Try it.

  • Hyper-V: Kerberos Constrained Delegation not working - unable to create VHD on SMB 3.0 share

    I have created a simple, three server Hyper-V environment with two Hyper-V servers and a file server.  The file server is providing shared storage over SMB.  I have configured Constrained Delegation as per the instructions found on a TechNet blog.
    However, I cannot create VMs from my Windows 8.1 workstation running the Windows 8.1 RSAT.  I get the following error:
    New-VM : Failed to create the virtual hard disk.
    The system failed to create '\\SERVER\VHDStore\Hyper-V\VH02\Virtual Hard Disks\Disk1.vhdx': General access denied error (0x80070005).
    You do not have permission to perform the operation. Contact your administrator if you believe you should have
    permission to perform this operation.
    + CategoryInfo : PermissionDenied: (Microsoft.Hyper...l.VMStorageTask:VMStorageTask) [New-VM], Virtualiza
    tionOperationFailedException
    + FullyQualifiedErrorId : AccessDenied,Microsoft.HyperV.PowerShell.Commands.NewVMCommand
    I have configured delegation on each of the Hyper-V servers to allow the service CIFS on the file server.  The permissions on the shared folder allow full control to both the Hyper-V servers and the end-user account.  I see not specific errors
    in the event logs on any of the servers involved.  
    Where else can I look too determine what is failing and why?
    Thanks.
    Ash

    Hi Ash,
    >> The permissions on the shared folder allow full control to both the Hyper-V servers and the end-user account.  I see not specific errors in the event logs on any of the servers involved.
    >> I cannot create VMs from my Windows 8.1 workstation running the Windows 8.1 RSAT.
    They are all joined domain right ?
    As you mentioned two hyper-v host computer name and the user which logging on to the Win8.1 have the full control on that shared folder , that user is still in hyper-v administrators/administrators group of hyper-v hosts.
    Please try to log on hyper-v host locally use that user account then try to create a file into the shared folder first .
    Also please refer to following link:
    http://blogs.technet.com/b/matthts/archive/2012/06/10/configuring-kerberos-constrained-delegation-for-hyper-v-management.aspx
    Any further information please feel free to let us know.
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Supplied credentials not accepted by the server and Could not validate SPNEGO token

    Hi,
    We have installed and configured SSO 2.0 SP02 on HP-UX system. We have exported the client policy files, root certificate from SLS and imported the same in the client PC. Then we have installed the SLC in client PC with logging enabled option. Now when we try to manually login using SLC we are getting the below error.
    In SLC - "Supplied credentials not accepted by the server"
    In Diatool - "Could not validate SPNEGO token"
    Attached the trace file from SLC and logs from diatool. Anyone suggest how to rectify this error.
    The trace file from SLC
    [2014.03.28 12:08:50.434][TRACE][sbus.exe            ][sbus.dll    ][  4856] CToken:: Secure Login token [toksw:mem://securelogin/Windows Authentication (SPNEGO) :: login
    [2014.03.28 12:08:50.452][TRACE][sbus.exe            ][sbusresloade][  4856] { GetLocale
    [2014.03.28 12:08:50.453][TRACE][sbus.exe            ][sbusresloade][  4856] }        0
    [2014.03.28 12:08:50.453][TRACE][sbus.exe            ][sbusslogin.d][  4856] { CSecureLogin_Protocol_2_0::Send_Init
    [2014.03.28 12:08:50.453][TRACE][sbus.exe            ][sbusslogin.d][  4856] { CSecureLogin::Send_Any
    [2014.03.28 12:08:50.515][ERROR][sbus.exe            ][BASE        ][  2800] ERROR(0xA0100017) in CRYPT->sec_crypt_cipher_get_cipher_len(): An attribute is missing
    [2014.03.28 12:08:50.563][TRACE][sbus.exe            ][sbusslogin.d][  4856] }        0
    [2014.03.28 12:08:50.563][TRACE][sbus.exe            ][sbusslogin.d][  4856] }        0
    [2014.03.28 12:08:50.566][TRACE][sbus.exe            ][sbusresloade][  4856] { CResourceManager::New
    [2014.03.28 12:08:50.566][TRACE][sbus.exe            ][sbusresloade][  4856] { GetLocale
    [2014.03.28 12:08:50.566][TRACE][sbus.exe            ][sbusresloade][  4856] }        0
    [2014.03.28 12:08:50.566][TRACE][sbus.exe            ][sbusresloade][  4856] { CResourceManager::Init
    [2014.03.28 12:08:50.568][TRACE][sbus.exe            ][sbusresloade][  4856] }        0
    [2014.03.28 12:08:50.568][TRACE][sbus.exe            ][sbusresloade][  4856] }        0
    [2014.03.28 12:09:00.979][ERROR][sbus.exe            ][sbus.dll    ][  4856] LogonUser failed with error 0x0000052e
    [2014.03.28 12:09:12.628][TRACE][sbus.exe            ][Kerberos    ][  4856] Got kerberos ticket for 'HTTP/ssodev' with server key type 23 and session key type 23
    [2014.03.28 12:09:12.628][TRACE][sbus.exe            ][BASE/RANDOM ][  4856] Get 8 bytes random data
    [2014.03.28 12:09:12.628][TRACE][sbus.exe            ][sbusslogin.d][  4856] { CSecureLogin_Protocol_2_0::Send_Auth_SPNEGO
    [2014.03.28 12:09:12.628][TRACE][sbus.exe            ][sbusslogin.d][  4856] { CSecureLogin::Send_Any
    [2014.03.28 12:09:12.727][TRACE][sbus.exe            ][sbusslogin.d][  4856] }        0
    [2014.03.28 12:09:12.727][TRACE][sbus.exe            ][sbusslogin.d][  4856] { CSecureLogin_Protocol_2_0::Handle_Auth_Response
    [2014.03.28 12:09:12.727][TRACE][sbus.exe            ][sbusslogin.d][  4856] }        0
    [2014.03.28 12:09:12.727][TRACE][sbus.exe            ][sbusslogin.d][  4856] } 80070005
    Regards,
    Yogesh Kumar D

    Hello Yogesh,
    With regards to the 2nd error "Could not validate SPNEGO Token"
    Login Module                                                               Flag        Initialize  Login      Commit     Abort      Details
    1. com.sap.security.core.server.jaas.SPNegoLoginModule                     SUFFICIENT  ok          exception             true       Could not validate SPNEGO token. Reason: No user with account attributes [[namespace=com.sap.security.core.authentication, name=principal, value=sap.helpdesk1, isCaseSensitive=false], [namespace=com.sap.security.core.authentication, name=realm, value=HZL01.VEDANTARESOURCE.LOCAL, isCaseSensitive=false]] found
    No logon policy was applied
    It means that the user "sap.helpdesk1" was decrypted from the kerberos
    token but there is no user with this name in the AS Java. The reason for that is a misconfiguration in the SPNEGO user mapping.
    Therefore, please open the SPNEGO wizard in the NWA and configure
    how AS Java should choose a user from the UME based on the received
    SPNEGO token. Here is some documentation about configuring the user
    mapping:
    http://help.sap.com/saphelp_nw73/helpdata/en/f4/1978c3a37a441b87a89d61c1a08689/frameset.htm
    Regards,
    David

  • "Accepting Credentials not available!" Error

    Hi all,
    I am trying to implement SSO on Windows and Unix systems, but I faced with the error below, even though I applied steps in help.sap.com;
    N  SncInit(): Initializing Secure Network Communication (SNC)
    N        PC with Windows NT (mt,ascii,SAP_UC/size_t/void* = 8/32/32)
    N  SncInit():   found snc/data_protection/max=3, using 3 (Privacy Level)
    N  SncInit():   found snc/data_protection/min=1, using 1 (Authentication Level)
    N  SncInit():   found snc/data_protection/use=9, using 3 (Privacy Level)
    N  SncInit(): found  snc/gssapi_lib=D:\usr\sap\BST\sys\exe\run\sapcrypto.dll
    N    File "D:\usr\sap\BST\sys\exe\run\sapcrypto.dll" dynamically loaded as GSS-API v2 library.
    N    The internal Adapter for the loaded GSS-API mechanism identifies as:
    N    Internal SNC-Adapter (Rev 1.0) to SECUDE 5/GSS-API v2
    N  SncInit():   found snc/identity/as=p:CN=BST, OU=I0020125960, OU=ASTRON, C=TR
    N  *** ERROR => SncPAcquireCred()==SNCERR_GSSAPI  [sncxxall.c 1432]
    N        GSS-API(maj): No credentials were supplied
    N        GSS-API(min): File is not existing
    N      Could't acquire ACCEPTING credentials for

    N      name="p:CN=BST, OU=I0020125960, OU=ASTRON, C=TR"
    N  SncInit(): Fatal -- Accepting Credentials not available!
    N  <<- SncInit()==SNCERR_GSSAPI
    N           sec_avail = "false"
    M  ***LOG R19=> ThSncInit, SncInitU ( SNC-000004) [thxxsnc.c    223]
    M  *** ERROR => ThSncInit: SncInitU (SNCERR_GSSAPI) [thxxsnc.c    225]
    M  in_ThErrHandle: 1
    M  *** ERROR => SncInitU (step 1, th_errno 44, action 3, level 1) [thxxhead.c   9564]
    It is important that the system is not attached into an active directory domain. I am also aware that the PSE DN must be as same as "snc/identity/as" profile parameter. Anyone has a suggestion about the issue?
    Thank you.

    Please let me know how you resolved this error.
    Thanks in advance..

  • SharePoint 2007 + Java InfoView (Kerberos SSO v/ Vintela)

    At one point I was able to get the Document List web part working with SharePoint 2007 + Java InfoView, but now I'm back to getting the dreaded error:
    Unable to access the BusinessObjects Enterprise infrastructure at RP-BOEXI31 for user: . Contact your reporting administrator for assistance.
    Kerberos SSO w\ Vintela works flawlessly with InfoView on its own, but I can't seem to pinpoint why I'm having this issue.  I can get it to work with .NET InfoView (NTLM) without a problem.
    I enabled tracing, but where does this information go to?
    <!-- Displaying problem tracking messages in web part pages -->
        <add key="BusinessObjects Enterprise Trace Enabled" value="True" />
    So I've looked at various logs on the SharePoint server in these locations without any luck.  Does anyone know of any other logs I should be looking at when tracing is enabled?
    The Admin Guide states:
    Tracing provides you with stack trace information and web page configuration
    options that can help you to understand any issues in greater detail. For
    example, if you see an unexpected error message, and tracing is enabled,
    the tracing information is listed at the bottom of the same web page where
    the error occurred. Scroll down to see the tracing information provided by
    SharePoint for the web part.
    However, I havn't been able to decipher in that information anything that sticks out.
    Log Locations Reviewed Already:
    - C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS
    - The various W3SVC* folders under C:\WINDOWS\system32\LogFiles\
    Also - I was able to get it to work temporarily when I enabled NTLM in the SharePoint Admin Console as I didn't see any reason to be running my SharePoint services using an SPN of any kind since it is on a seperate server than the BOE web tier and just passes the credentials to InfoView.
    Edited by: Jay Riddle on Apr 1, 2009 4:07 PM

    Somehow I don't think that is the issue because when I use the PIK in combination with .NET InfoView using NTLM SSO, the credentials pass fine and all the web parts work.  I've enabled prompting of authentication in the web.config and have tried the domain\user format as well as just the user format manually - but this doesn't work with Java InfoView using SSO regardless of the format the user credentials are entered in.  I'm continuing to test multiple different variables and may create a separate image with Java InfoView with a new SPN in order to ensure it isn't something with the BOE image.
    One odd thing is I had at least the Document List part working briefly when I changed the SharePoint Authentication zone to NTLM instead of Kerberos (which has IIS use NETWORK SERVICES run the services).  One day it just stopped working.

  • Publishing CRM 2011 on Web Applicaiton Proxy Using Kerberos Constrained Delegation

    Hello,
    Couldn't find a sub category that seemed suitable for this discussion so I just dropped it in Windows Server 2012 General.
    So to summarize...
    Web Application Proxy (WAP) on 2012r2, ADFS on 2012r2, and CRM 2011 RU11 is on 2008r2.
    WAP has a pass through rule setup for the ADFS site and a preauth rule setup for the CRM site.  All SPNs and delegation are setup in AD.
    Setup is 1 WAP, 1 NIC, 1 ADFS server and 1 CRM server.
    I have successfully publish my CRM 2011 site on Web application proxy and am successfully doing Kerberos Constrained Delegation.  I am also doing Client certificate authentication on the ADFS server which works fine.  I am doing this over 49443
    just fine.
    Try to access the CRM site, WAP redirects me to ADFS as expect, Client certificate auth happens at the ADFS server,  I am redirected back to my CRM site with my authToken so pre authentication can happen successfully.  KCD ensues after just fine
    and i am reverse proxied back to the CRM site.
    Here in lies the problem though...
    When i am reversed proxied back to the CRM site, i receive the standard "An error has occurred Try this action again.... yada yada yada" message with the Try Again or Close button.  If i click try again, i am able to access the site with no
    problem and the solution works great!  This obviously is not acceptable though.
    The error URL looks like the following (changed it for obvious reasons)
    https://crmsite.contoso.com/ORG1/_common/error/errorhandler.aspx?BackUri=https%3a%2f%2fadfs.contoso.com%2fadfs%2fls%3fversion%3d1.0%26action%3dsignin%26realm%3durn%253AAppProxy%253Acom%26appRealm%3d63ce68f1-3de4-e411-9412-005056a67a8d%26returnUrl%3dhttps%253A%252F%252Fcrmsite.contoso.com%252F%26client-request-id%3d4A1A0958-76F3-0000-5D91-1C4AF376D001&ErrorCode=&Parm0=%0d%0a%0d%0aError%20Details%3a%20An%20unhandled%20exception%20occurred%20during%20the%20execution%20of%20the%20current%20web%20request.%20Please%20review%20the%20stack%20trace%20for%20more%20information%20about%20the%20error%20and%20where%20it%20originated%20in%20the%20code.&RequestUri=%2fdefault.aspx
    The error that correlates to this in CRM is
    Event code: 3005
    Event message: An unhandled exception has occurred.
    Little bit further down
    Exception information:
        Exception type: InvalidOperationException
        Exception message: CRM Parameter Filter - Invalid parameter 'AuthMethod=CertificateAuthentication' in Request.Form on page /default.aspx
    If anybody has any insight or experience publishing CRM on WAP using KCD and has run into this issue, help would be greatly appreciated.
    Also to head of this question, we can not do an IFD setup.  There is a custom developed solution which resides on top of the CRM installation that is not claims friendly.
    Thanks!
    Jonathan

    Hi,
    Please check if anyone of the links below is helpful:
    http://blogs.msdn.com/b/javaller/archive/2014/01/13/publishing-crm-internet-facing-deployment-using-web-application-proxy-and.aspx
    http://blogs.technet.com/b/dynamicspts/archive/2014/10/03/using-web-application-proxy-to-publish-dynamics-crm-2013-to-the-internet.aspx
    Best Regards.
    Steven Lee Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • What is the current status for Kerberos Constrained delegation feature on the ASA platform?

    What is the current status for Kerberos Constrained delegation feature on the ASA platform?

    Hi Oscar,
    This is not available yet in the current software. Now, we cannot give any official information on this forum about software that has not been released yet, but if you really want to know I would suggest that you contact your local Cisco sales office to confirm with your account team which new features will be in the upcoming ASA 8.4 software release.
    hth
    Herbert

  • User profile images not persisting after log off on Server 2012 R2 RDS Session Hosts

    Hi,
    We have a 2012 R2 remote desktop deployment, with two session collections, a gateway server, and connection broker.
    We have set these session collections to use centralised user profile disks.
    What I am having an issue with, is that when a user sets their profile image through the server they have logged on to (I have the desktop experience pack installed so they are able to do this), they can see the user tile has been set with that image in
    settings and also on the start menu, but as soon as they log off the server and back on, their profile image has been reset to the default blank image.
    I have checked all of my group policy options, and cannot find any settings that could be impacting this.
    Does anyone have any ideas why these images are not persisting for users or admins?
    Thanks, Eds

    Please check that the user is not getting a temporary profile each time he logs in. Also, make sure that the RDP client is properly configured to display the Wallpaper: http://www.webapper.com/blog/index.php/2007/10/18/enabling-desktop-wallpaper-on-remote-desktop-terminal-services/
    This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
    Get Active Directory User Last Logon
    Create an Active Directory test domain similar to the production one
    Management of test accounts in an Active Directory production domain - Part I
    Management of test accounts in an Active Directory production domain - Part II
    Management of test accounts in an Active Directory production domain - Part III
    Reset Active Directory user password

  • EJB 3.0 - JSF APPLICATION: DATA DOES NOT PERSIST TO THE DATABASE

    Hi,
    I am developing a JSF - EJB application and the data that I send from JSP Page through JSF Managed Bean --> Session Bean --> Java Persistence does not persist in database.
    Here is my scenario ( Iam using JDeveloper IDE to create this application) -
    SCENARIO START
    The scenario consists of two web pages, one enlisting all the users stored in the database, the other contains a form for adding a user
    1.) INDEX.JSP
    2.) ADDUSER.JSP
    Step 1: Create the USERS Table in database
    CREATE TABLE users
    user_id serial,
    username varchar(255) NOT NULL,
    first_name varchar(255),
    last_name varchar(255),
    password char(64) NOT NULL,
    CONSTRAINT pk_users PRIMARY KEY (user_id)
    Step 2: Add Database Connection To JDeveloper
    Go to Database Connection Navigator and create a New Database Connection using the Wizard
    Step 3: Create a New Application in JDeveloper and select JSF, EJB from Application Template
    Step 4: ENTITY BEAN - In the EJB Node Right Click and Select EJB à New Entites from Table (JPA/EJB3.0)
    Use The Wizard and create Entity Bean from Users Table which creates an Entity Bea POJO file as follows –
    User.java -
    package lux.domain;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQuery;
    import javax.persistence.SequenceGenerator;
    import javax.persistence.Table;
    @Entity
    @NamedQuery(name = "User.findAll", query = "select o from User o")
    @Table(name = "USERS")
    public class User implements Serializable {
    @Column(name="FIRST_NAME")
    private String firstName;
    @Column(name="LAST_NAME")
    private String lastName;
    @Column(nullable = false)
    private String password;
    @Column(nullable = false)
    private String username;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="users_seq_generator")
    @SequenceGenerator(name="users_seq_generator", sequenceName="users_user_id_seq")
    @Column(name="USER_ID", nullable = false)
    private Long userId;
    public User() {
    public String getFirstName() {
    return firstName;
    public void setFirstName(String firstName) {
    this.firstName = firstName;
    public String getLastName() {
    return lastName;
    public void setLastName(String lastName) {
    this.lastName = lastName;
    public String getPassword() {
    return password;
    public void setPassword(String password) {
    this.password = password;
    public String getUsername() {
    return username;
    public void setUsername(String username) {
    this.username = username;
    public Long getUserId() {
    return userId;
    public void setUserId(Long userId) {
    this.userId = userId;
    Step 5: STATELESS SESSION BEAN - In the EJB Node Right Click and Select EJB à New Entites from Table (JPA/EJB3.0)
    Again Right Click on Model and create Session Bean from Wizard which creates two files –
    UserDAOBean.java – Stateless Session Bean
    UserDAO.java – Local Interface
    package lux.facade;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    import lux.domain.User;
    @Stateless(name="UserDAO")
    public class UserDAOBean implements UserDAO {
    @PersistenceContext(unitName="Model")
    private EntityManager em;
    public UserDAOBean() {
    public User getUser(int UserId) {
    User u = new User();
    u = em.find(User.class, UserId);
    return u;
    public List<User> getAllUsers() {
    Query q = em.createQuery("SELECT u FROM User u");
    List<User> users = q.getResultList();
    return users;
    public void createUser(User u) {
    String hashedPw = hashPassword(u.getPassword());
    u.setPassword(hashedPw);
    em.persist(u);
    public void updateUser(User u) {
    String hashedPw = hashPassword(u.getPassword());
    u.setPassword(hashedPw);
    em.merge(u);
    public void deleteUser(User u) {
    em.remove(u);
    private String hashPassword(String password) {
    StringBuilder sb = new StringBuilder();
    try {
    MessageDigest messageDigest = MessageDigest.getInstance("SHA");
    byte[] bs;
    bs = messageDigest.digest(password.getBytes());
    for (int i = 0; i < bs.length; i++) {
    String hexVal = Integer.toHexString(0xFF & bs);
    if (hexVal.length() == 1) {
    sb.append("0");
    sb.append(hexVal);
    } catch (NoSuchAlgorithmException ex) {
    Logger.getLogger(UserDAOBean.class.getName()).log(Level.SEVERE, null, ex);
    return sb.toString();
    Step 6: Create a Deployment file in the Model and Deploy this to a JAR file
    Step 7: Now Right Click on View/Controller Node and create a Java File –
    UserController.java -
    package lux.controllers;
    import javax.ejb.EJB;
    import javax.faces.model.DataModel;
    import javax.faces.model.ListDataModel;
    import lux.domain.User;
    import lux.facade.UserDAO;
    public class UserController {
    @EJB UserDAO userDao;
    private User user;
    private DataModel model;
    public String createUser() {
    this.user = new User();
    return "create_new_user";
    public String saveUser() {
    String r = "success";
    try {
    userDao.createUser(user);
    } catch (Exception e) {
    e.printStackTrace();
    r = "failed";
    return r;
    public DataModel getUsers() {
    model = new ListDataModel(userDao.getAllUsers());
    return model;
    public User getUser() {
    return user;
    public void setUser(User user) {
    this.user = user;
    Step 8: Configure page flow in faces-config.xml
    1. Create the JSP file adduser.jsp by right-clicking View-Controller
    node and selecting New > JSP. Use the wizard to create JSF – JSP Page, fill in
    File Name adduser.jsp, click Finish. -
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>New user</title>
    </head>
    <body>
    <f:view>
    <h:form>
    <h:messages/>
    <h:panelGrid columns="2">
    <h:outputText value="Username"/>
    <h:inputText
    id="Username"
    value="#{user.user.username}"
    required="true"/>
    <h:outputText value="First name"/>
    <h:inputText
    id="FirstName"
    value="#{user.user.firstName}" />
    <h:outputText value="Last name"/>
    <h:inputText
    id="LastName"
    value="#{user.user.lastName}" />
    <h:outputText value="Password" />
    <h:inputSecret
    id="Password"
    value="#{user.user.password}"
    required="true" />
    <h:panelGroup/>
    <h:commandButton
    action="#{user.saveUser}"
    value="Save"/>
    </h:panelGrid>
    </h:form>
    </f:view>
    </body>
    </html>
    2. Repeat the previous step for another JSP file failed.jsp.
    3. On failed.jsp add the string
    Save failed
    Next we configure the page flow.
    1. Open faces-config.xml.
    2. Create index.jsp -
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>User Listing</title>
    </head>
    <body>
    <f:view>
    <h:form>
    <h:outputText value="User Listing"/>
    <h:commandLink action="#{user.createUser}" value="Create a user"/>
    <h:dataTable value="#{user.user}"
    var="dataTableItem" border="1" cellpadding="2" cellspacing="2">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Username"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.username}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="First name"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.firstName}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Last name"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.lastName}" />
    </h:column>
    </h:dataTable>
    </h:form>
    </f:view>
    </body>
    </html>
    3. Drag an arrow from index.jsp to adduser.jsp and replace the arrow’s label to create_new_user.
    4. Repeat the previous step for failed, by dragging and arrow from adduser.jsp to failed.jsp renaming the label to f
    ailed
    5. Finally repeat the step for adduser.jsp, by dragging from adduser.jsp to index.jsp renaming the label to success.
    This creates the following faces-config.xml file –
    <?xml version='1.0' encoding='UTF-8'?>
    <faces-config>
    <managed-bean>
    <managed-bean-name>user</managed-bean-name>
    <managed-bean-class>lux.controllers.UserController</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>username</property-name>
    <value>#{username}</value>
    </managed-property>
    <managed-property>
    <property-name>firstName</property-name>
    <value>#{firstName}</value>
    </managed-property>
    <managed-property>
    <property-name>lastName</property-name>
    <value>#{lastName}</value>
    </managed-property>
    <managed-property>
    <property-name>password</property-name>
    <value>#{password}</value>
    </managed-property>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/index.jsp</from-view-id>
    <navigation-case>
    <from-outcome>create_new_user</from-outcome>
    <to-view-id>/adduser.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/adduser.jsp</from-view-id>
    <navigation-case>
    <from-outcome>failed</from-outcome>
    <to-view-id>/failed.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/index.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    Step 9: Create a Deployment file in the View-Controller and Deploy this to a WAR file
    Step 10: Create a Deployment file in the View-Controller and create an EAR file and add Model’s JAR and View-Controller’s
    WAR files to it.
    Step 11: Run the JSP Files
    SCENARIO END
    Now, When I execute Index.jsp, it does not list values from database and when I click on Create User link, it takes me to adduser.jsp page. When I fill values in this page and click Save button, it takes me to Save Failed page and data does not persist to the database.
    WHAT IS WRONG OUT HERE ???

    If you set a breakpoint in your createUser method - does this code get executed?
    We have a couple of tutorials that might show you how to do this.
    EJB/JSF with ADF-binding tutorial:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/ejb_and_jpa/master-detail_pagewith_ejb.htm
    EJB/JSF without ADF binding:
    http://www.oracle.com/technology/obe/JavaEE_tutorial_10131/index.htm

  • JSF - EJB 3.0 Application - Data does not persist to the database

    Hi,
    I am developing a JSF - EJB application and the data that I send from JSP Page through JSF Managed Bean --> Session Bean --> Java Persistence does not persist in database.
    Here is my scenario ( Iam using JDeveloper IDE to create this application) -
    ------------------------------------------------------- SCENARIO START
    The scenario consists of two web pages, one enlisting all the users stored in the database, the other contains a form for adding a user
    1.) INDEX.JSP
    2.) ADDUSER.JSP
    Step 1: Create the USERS Table in database
    CREATE TABLE users
    user_id serial,
    username varchar(255) NOT NULL,
    first_name varchar(255),
    last_name varchar(255),
    password char(64) NOT NULL,
    CONSTRAINT pk_users PRIMARY KEY (user_id)
    Step 2: Add Database Connection To JDeveloper
    Go to Database Connection Navigator and create a New Database Connection using the Wizard
    Step 3: Create a New Application in JDeveloper and select JSF, EJB from Application Template
    Step 4: ENTITY BEAN - In the EJB Node Right Click and Select EJB � New Entites from Table (JPA/EJB3.0)
    Use The Wizard and create Entity Bean from Users Table which creates an Entity Bea POJO file as follows �
    User.java -
    package lux.domain;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQuery;
    import javax.persistence.SequenceGenerator;
    import javax.persistence.Table;
    @Entity
    @NamedQuery(name = "User.findAll", query = "select o from User o")
    @Table(name = "USERS")
    public class User implements Serializable {
    @Column(name="FIRST_NAME")
    private String firstName;
    @Column(name="LAST_NAME")
    private String lastName;
    @Column(nullable = false)
    private String password;
    @Column(nullable = false)
    private String username;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="users_seq_generator")
    @SequenceGenerator(name="users_seq_generator", sequenceName="users_user_id_seq")
    @Column(name="USER_ID", nullable = false)
    private Long userId;
    public User() {
    public String getFirstName() {
    return firstName;
    public void setFirstName(String firstName) {
    this.firstName = firstName;
    public String getLastName() {
    return lastName;
    public void setLastName(String lastName) {
    this.lastName = lastName;
    public String getPassword() {
    return password;
    public void setPassword(String password) {
    this.password = password;
    public String getUsername() {
    return username;
    public void setUsername(String username) {
    this.username = username;
    public Long getUserId() {
    return userId;
    public void setUserId(Long userId) {
    this.userId = userId;
    Step 5: STATELESS SESSION BEAN - In the EJB Node Right Click and Select EJB � New Entites from Table (JPA/EJB3.0)
    Again Right Click on Model and create Session Bean from Wizard which creates two files �
    UserDAOBean.java � Stateless Session Bean
    UserDAO.java � Local Interface
    package lux.facade;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    import lux.domain.User;
    @Stateless(name="UserDAO")
    public class UserDAOBean implements UserDAO {
    @PersistenceContext(unitName="Model")
    private EntityManager em;
    public UserDAOBean() {
    public User getUser(int UserId) {
    User u = new User();
    u = em.find(User.class, UserId);
    return u;
    public List<User> getAllUsers() {
    Query q = em.createQuery("SELECT u FROM User u");
    List<User> users = q.getResultList();
    return users;
    public void createUser(User u) {
    String hashedPw = hashPassword(u.getPassword());
    u.setPassword(hashedPw);
    em.persist(u);
    public void updateUser(User u) {
    String hashedPw = hashPassword(u.getPassword());
    u.setPassword(hashedPw);
    em.merge(u);
    public void deleteUser(User u) {
    em.remove(u);
    private String hashPassword(String password) {
    StringBuilder sb = new StringBuilder();
    try {
    MessageDigest messageDigest = MessageDigest.getInstance("SHA");
    byte[] bs;
    bs = messageDigest.digest(password.getBytes());
    for (int i = 0; i < bs.length; i++) {
    String hexVal = Integer.toHexString(0xFF & bs);
    if (hexVal.length() == 1) {
    sb.append("0");
    sb.append(hexVal);
    } catch (NoSuchAlgorithmException ex) {
    Logger.getLogger(UserDAOBean.class.getName()).log(Level.SEVERE, null, ex);
    return sb.toString();
    Step 6: Create a Deployment file in the Model and Deploy this to a JAR file
    Step 7: Now Right Click on View/Controller Node and create a Java File �
    UserController.java -
    package lux.controllers;
    import javax.ejb.EJB;
    import javax.faces.model.DataModel;
    import javax.faces.model.ListDataModel;
    import lux.domain.User;
    import lux.facade.UserDAO;
    public class UserController {
    @EJB UserDAO userDao;
    private User user;
    private DataModel model;
    public String createUser() {
    this.user = new User();
    return "create_new_user";
    public String saveUser() {
    String r = "success";
    try {
    userDao.createUser(user);
    } catch (Exception e) {
    e.printStackTrace();
    r = "failed";
    return r;
    public DataModel getUsers() {
    model = new ListDataModel(userDao.getAllUsers());
    return model;
    public User getUser() {
    return user;
    public void setUser(User user) {
    this.user = user;
    Step 8: Configure page flow in faces-config.xml
    1. Create the JSP file adduser.jsp by right-clicking View-Controller
    node and selecting New > JSP. Use the wizard to create JSF � JSP Page, fill in
    File Name adduser.jsp, click Finish. -
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>New user</title>
    </head>
    <body>
    <f:view>
    <h:form>
    <h:messages/>
    <h:panelGrid columns="2">
    <h:outputText value="Username"/>
    <h:inputText
    id="Username"
    value="#{user.user.username}"
    required="true"/>
    <h:outputText value="First name"/>
    <h:inputText
    id="FirstName"
    value="#{user.user.firstName}" />
    <h:outputText value="Last name"/>
    <h:inputText
    id="LastName"
    value="#{user.user.lastName}" />
    <h:outputText value="Password" />
    <h:inputSecret
    id="Password"
    value="#{user.user.password}"
    required="true" />
    <h:panelGroup/>
    <h:commandButton
    action="#{user.saveUser}"
    value="Save"/>
    </h:panelGrid>
    </h:form>
    </f:view>
    </body>
    </html>
    2. Repeat the previous step for another JSP file failed.jsp.
    3. On failed.jsp add the string <h2>Save failed</h2>.
    Next we configure the page flow.
    1. Open faces-config.xml.
    2. Create index.jsp -
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>User Listing</title>
    </head>
    <body>
    <f:view>
    <h:form>
    <h1><h:outputText value="User Listing"/></h1>
    <p><h:commandLink action="#{user.createUser}" value="Create a user"/></p>
    <h:dataTable value="#{user.user}"
    var="dataTableItem" border="1" cellpadding="2" cellspacing="2">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Username"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.username}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="First name"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.firstName}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Last name"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.lastName}" />
    </h:column>
    </h:dataTable>
    </h:form>
    </f:view>
    </body>
    </html>
    3. Drag an arrow from index.jsp to adduser.jsp and replace the arrow�s label to create_new_user.
    4. Repeat the previous step for failed, by dragging and arrow from adduser.jsp to failed.jsp renaming the label to f
    ailed
    5. Finally repeat the step for adduser.jsp, by dragging from adduser.jsp to index.jsp renaming the label to success.
    This creates the following faces-config.xml file �
    <?xml version='1.0' encoding='UTF-8'?>
    <faces-config>
    <managed-bean>
    <managed-bean-name>user</managed-bean-name>
    <managed-bean-class>lux.controllers.UserController</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>username</property-name>
    <value>#{username}</value>
    </managed-property>
    <managed-property>
    <property-name>firstName</property-name>
    <value>#{firstName}</value>
    </managed-property>
    <managed-property>
    <property-name>lastName</property-name>
    <value>#{lastName}</value>
    </managed-property>
    <managed-property>
    <property-name>password</property-name>
    <value>#{password}</value>
    </managed-property>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/index.jsp</from-view-id>
    <navigation-case>
    <from-outcome>create_new_user</from-outcome>
    <to-view-id>/adduser.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/adduser.jsp</from-view-id>
    <navigation-case>
    <from-outcome>failed</from-outcome>
    <to-view-id>/failed.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/index.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    Step 9: Create a Deployment file in the View-Controller and Deploy this to a WAR file
    Step 10: Create a Deployment file in the View-Controller and create an EAR file and add Model�s JAR and View-Controller�s
    WAR files to it.
    Step 11: Run the JSP Files
    ------------------------------------------------------- SCENARIO END
    Now, When I execute Index.jsp, it does not list values from database and when I click on Create User link, it takes me to adduser.jsp page. When I fill values in this page and click Save button, it takes me to Save Failed page and data does not persist to the database.
    WHAT IS WRONG OUT HERE ???

    PLZZZZZZZZZzzzzzzzzzzz HELP ! ! !

  • SQL MP - System Center Management Health Service Credentials Not Found Alert Message

    Hi Dears,
    I have read so many open cases, but I could not find solution to my situation...
    Error: System Center Management Health Service Credentials Not Found Alert Message
    Desc are 1 of those 2:
    An account specified in the Run As profile "Microsoft.SQLServer.SQLDiscoveryAccount" cannot be resolved.
    An account specified in the Run As profile "Microsoft.SQLServer.SQLDefaultAccount" cannot be resolved.
    Okay, I am fine, I  verify the RunAs account configuration and yes this is the problem... I was able to solve it for those SQL running servicec account using domain user account, I created the run as account, and assoistte it with SQL profiles,
    and it is fine....
    BUT, what about my 8 SQL Servers running SQL Service Account under System and Network accounts,
    so how Can I add this coz I cannot target all objects,so what shall I target (Object Health Service or WHAT)?
    Please I need it step by step coz I am not able to handle this issue....
    Thank you Guys

    Hi,
    If you have not distributed the Run As Account to a system, but we discovered SQL on it, you will see the error message.
    This condition may have occurred because the account is not configured to be distributed to this computer. To resolve this problem, please distribute the account to this computer if appropriate. You can refer to the following blog to distribute the Run As
    credential.
    Niki Han
    TechNet Community Support

  • EJB-JSF Application : Data does not persist to the database

    Hi,
    I am developing a JSF - EJB application and the data that I send from JSP Page through JSF Managed Bean --> Session Bean --> Java Persistence does not persist in database.
    Here is my scenario ( Iam using JDeveloper IDE to create this application) -
    SCENARIO START
    The scenario consists of two web pages, one enlisting all the users stored in the database, the other contains a form for adding a user
    1.) INDEX.JSP
    2.) ADDUSER.JSP
    Step 1: Create the USERS Table in database
    CREATE TABLE users
    user_id serial,
    username varchar(255) NOT NULL,
    first_name varchar(255),
    last_name varchar(255),
    password char(64) NOT NULL,
    CONSTRAINT pk_users PRIMARY KEY (user_id)
    Step 2: Add Database Connection To JDeveloper
    Go to Database Connection Navigator and create a New Database Connection using the Wizard
    Step 3: Create a New Application in JDeveloper and select JSF, EJB from Application Template
    Step 4: ENTITY BEAN - In the EJB Node Right Click and Select EJB � New Entites from Table (JPA/EJB3.0)
    Use The Wizard and create Entity Bean from Users Table which creates an Entity Bea POJO file as follows �
    User.java -
    package lux.domain;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQuery;
    import javax.persistence.SequenceGenerator;
    import javax.persistence.Table;
    @Entity
    @NamedQuery(name = "User.findAll", query = "select o from User o")
    @Table(name = "USERS")
    public class User implements Serializable {
    @Column(name="FIRST_NAME")
    private String firstName;
    @Column(name="LAST_NAME")
    private String lastName;
    @Column(nullable = false)
    private String password;
    @Column(nullable = false)
    private String username;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="users_seq_generator")
    @SequenceGenerator(name="users_seq_generator", sequenceName="users_user_id_seq")
    @Column(name="USER_ID", nullable = false)
    private Long userId;
    public User() {
    public String getFirstName() {
    return firstName;
    public void setFirstName(String firstName) {
    this.firstName = firstName;
    public String getLastName() {
    return lastName;
    public void setLastName(String lastName) {
    this.lastName = lastName;
    public String getPassword() {
    return password;
    public void setPassword(String password) {
    this.password = password;
    public String getUsername() {
    return username;
    public void setUsername(String username) {
    this.username = username;
    public Long getUserId() {
    return userId;
    public void setUserId(Long userId) {
    this.userId = userId;
    Step 5: STATELESS SESSION BEAN - In the EJB Node Right Click and Select EJB � New Entites from Table (JPA/EJB3.0)
    Again Right Click on Model and create Session Bean from Wizard which creates two files �
    UserDAOBean.java � Stateless Session Bean
    UserDAO.java � Local Interface
    package lux.facade;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    import lux.domain.User;
    @Stateless(name="UserDAO")
    public class UserDAOBean implements UserDAO {
    @PersistenceContext(unitName="Model")
    private EntityManager em;
    public UserDAOBean() {
    public User getUser(int UserId) {
    User u = new User();
    u = em.find(User.class, UserId);
    return u;
    public List<User> getAllUsers() {
    Query q = em.createQuery("SELECT u FROM User u");
    List<User> users = q.getResultList();
    return users;
    public void createUser(User u) {
    String hashedPw = hashPassword(u.getPassword());
    u.setPassword(hashedPw);
    em.persist(u);
    public void updateUser(User u) {
    String hashedPw = hashPassword(u.getPassword());
    u.setPassword(hashedPw);
    em.merge(u);
    public void deleteUser(User u) {
    em.remove(u);
    private String hashPassword(String password) {
    StringBuilder sb = new StringBuilder();
    try {
    MessageDigest messageDigest = MessageDigest.getInstance("SHA");
    byte[] bs;
    bs = messageDigest.digest(password.getBytes());
    for (int i = 0; i < bs.length; i++) {
    String hexVal = Integer.toHexString(0xFF & bs);
    if (hexVal.length() == 1) {
    sb.append("0");
    sb.append(hexVal);
    } catch (NoSuchAlgorithmException ex) {
    Logger.getLogger(UserDAOBean.class.getName()).log(Level.SEVERE, null, ex);
    return sb.toString();
    Step 6: Create a Deployment file in the Model and Deploy this to a JAR file
    Step 7: Now Right Click on View/Controller Node and create a Java File �
    UserController.java -
    package lux.controllers;
    import javax.ejb.EJB;
    import javax.faces.model.DataModel;
    import javax.faces.model.ListDataModel;
    import lux.domain.User;
    import lux.facade.UserDAO;
    public class UserController {
    @EJB UserDAO userDao;
    private User user;
    private DataModel model;
    public String createUser() {
    this.user = new User();
    return "create_new_user";
    public String saveUser() {
    String r = "success";
    try {
    userDao.createUser(user);
    } catch (Exception e) {
    e.printStackTrace();
    r = "failed";
    return r;
    public DataModel getUsers() {
    model = new ListDataModel(userDao.getAllUsers());
    return model;
    public User getUser() {
    return user;
    public void setUser(User user) {
    this.user = user;
    Step 8: Configure page flow in faces-config.xml
    1. Create the JSP file adduser.jsp by right-clicking View-Controller
    node and selecting New > JSP. Use the wizard to create JSF � JSP Page, fill in
    File Name adduser.jsp, click Finish. -
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>New user</title>
    </head>
    <body>
    <f:view>
    <h:form>
    <h:messages/>
    <h:panelGrid columns="2">
    <h:outputText value="Username"/>
    <h:inputText
    id="Username"
    value="#{user.user.username}"
    required="true"/>
    <h:outputText value="First name"/>
    <h:inputText
    id="FirstName"
    value="#{user.user.firstName}" />
    <h:outputText value="Last name"/>
    <h:inputText
    id="LastName"
    value="#{user.user.lastName}" />
    <h:outputText value="Password" />
    <h:inputSecret
    id="Password"
    value="#{user.user.password}"
    required="true" />
    <h:panelGroup/>
    <h:commandButton
    action="#{user.saveUser}"
    value="Save"/>
    </h:panelGrid>
    </h:form>
    </f:view>
    </body>
    </html>
    2. Repeat the previous step for another JSP file failed.jsp.
    3. On failed.jsp add the string
    Save failed
    Next we configure the page flow.
    1. Open faces-config.xml.
    2. Create index.jsp -
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>User Listing</title>
    </head>
    <body>
    <f:view>
    <h:form>
    <h:outputText value="User Listing"/>
    <h:commandLink action="#{user.createUser}" value="Create a user"/>
    <h:dataTable value="#{user.user}"
    var="dataTableItem" border="1" cellpadding="2" cellspacing="2">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Username"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.username}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="First name"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.firstName}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Last name"/>
    </f:facet>
    <h:outputText value="#{dataTableItem.lastName}" />
    </h:column>
    </h:dataTable>
    </h:form>
    </f:view>
    </body>
    </html>
    3. Drag an arrow from index.jsp to adduser.jsp and replace the arrow�s label to create_new_user.
    4. Repeat the previous step for failed, by dragging and arrow from adduser.jsp to failed.jsp renaming the label to f
    ailed
    5. Finally repeat the step for adduser.jsp, by dragging from adduser.jsp to index.jsp renaming the label to success.
    This creates the following faces-config.xml file �
    <?xml version='1.0' encoding='UTF-8'?>
    <faces-config>
    <managed-bean>
    <managed-bean-name>user</managed-bean-name>
    <managed-bean-class>lux.controllers.UserController</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>username</property-name>
    <value>#{username}</value>
    </managed-property>
    <managed-property>
    <property-name>firstName</property-name>
    <value>#{firstName}</value>
    </managed-property>
    <managed-property>
    <property-name>lastName</property-name>
    <value>#{lastName}</value>
    </managed-property>
    <managed-property>
    <property-name>password</property-name>
    <value>#{password}</value>
    </managed-property>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/index.jsp</from-view-id>
    <navigation-case>
    <from-outcome>create_new_user</from-outcome>
    <to-view-id>/adduser.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/adduser.jsp</from-view-id>
    <navigation-case>
    <from-outcome>failed</from-outcome>
    <to-view-id>/failed.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/index.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    Step 9: Create a Deployment file in the View-Controller and Deploy this to a WAR file
    Step 10: Create a Deployment file in the View-Controller and create an EAR file and add Model�s JAR and View-Controller�s
    WAR files to it.
    Step 11: Run the JSP Files
    SCENARIO END
    Now, When I execute Index.jsp, it does not list values from database and when I click on Create User link, it takes me to adduser.jsp page. When I fill values in this page and click Save button, it takes me to Save Failed page and data does not persist to the database.
    WHAT IS WRONG OUT HERE ???

    If you set a breakpoint in your createUser method - does this code get executed?
    We have a couple of tutorials that might show you how to do this.
    EJB/JSF with ADF-binding tutorial:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/ejb_and_jpa/master-detail_pagewith_ejb.htm
    EJB/JSF without ADF binding:
    http://www.oracle.com/technology/obe/JavaEE_tutorial_10131/index.htm

  • I have imported an mp3 to my Library.  I want to keep it as media kind = podcast but no matter how often I change the tag in get info options media kind, the change will not persist.

    I have imported an mp3 to my Library.  I want to keep it as media kind = podcast but no matter how often I change the tag in get info > options > media kind, the change will not persist, and the file remains in my Music list not my Podcast list.

    Resolved in update.

  • Online course progress is not persistent

    I'm doing the online course: Ref: WJB-110-SE6: Fundamentals of the Java(TM) Programming Language
    I have completed several sections of this course. It seems that progress entries are not persistent from the previous session (after a logout followed by a login).
    So, each time I log in, I have to start at the beginning again.
    Please advise.

    OldGrantonian wrote:
    Please advise.I'd say [contact Sun Training directly|http://www.sun.com/training/contact_us/index.html]; you're likely to get a much faster, more authoritative answer that way.
    ~

Maybe you are looking for

  • Development of custom IDOC's

    Hi All, Can we go for approach of developing custom IDOC's? where in our scenarios are getting files from thrid party and updating data in file  into ECC. Approach towards Custom IDOC's is for error monitoring and recprocessing. Would request your in

  • Capturing to DVD Recorder, etc...

    I was wondering if this is a viable option for capturing my videos to my project. I have so much problem with dropped frames when capturing via FCP and so I would like to capture the footages straight to my DVD recorder (at the highest rec quality, o

  • Date Scrolling Info won't clear

    I just installed iPhoto 7.02 on my Macbook. When I scroll through thumbnails a black overlay with the date appears. I assume this is the "scrolling information." However, it refuses to go away. It remains over the center of the photo in all the modes

  • Photoshop CC crashes on launch

    I just downloaded the trial version of Photochop CC and it crashes immediately upon launch.  No error messages are received.  I have tried rebooting several times and have tried Adobe's recommended fix of logging out of Creative Cloud and logging bac

  • How to see data records of idoc?

    Hi Can anybody tell me how can i see the data records of idoc.. i think its stored in EDID4 table..but i am not able to see the sdata field