Login application -- 500 points -- Need help getting my action to work.

This part of my application is supposed to be very simple.  I am using Jdeveloper 10g and an oracle database 10g to accomplish a simple login solution!  The user is presented with a login page which allows them to input a username and password and hit submit!  Then the action is called and looks for that username and password inside my table in the oracle database!  If username and password exists in the table and match the data in the table the user gets presented with the welcome.jsp page, if not the user is redirected to the fail.jsp page!

Please help me getting this to work!


Instead trying to explain what's going wrong I am going to post my files and the errors I am getting!  I think the problem is within my "ACTION".  
Anyone who can help I will greatly appreciate!  500 points for this. Thank you in advance!

Here it goes:

1. "login.jsp"


<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ page contentType="text/html;charset=windows-1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>untitled</title>
<link href="css/jdeveloper.css" rel="stylesheet" media="screen"/>
</head>
<body>
  <H2>
    <U>Welcome to the employee registration page</U>
  </H2>
  <P>&nbsp;</P>
  <P>&nbsp;</P>
  <H3>
    <U>Please log in!</U>
  </H3>
  <html:form action="login.do">
    <table cellspacing="2" cellpadding="3" border="1" width="46%" height="50">
      <tr>
        <td>User Name:</td>
        <td>
          <input type="text" name="username"/>
        </td>
      </tr>
      <tr>
        <td> &nbsp;Password:</td>
        <td>
          <P>
            <input type="password" name="password"/>
          </P>
        </td>
      </tr>
      <tr>
        <td>
          <input type="submit" value="Submit" name="submit"/>
        </td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </html:form>
</body>
</html>
------------------------------------------------------------------------------------------------

2. login action:

import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;public class LoginAction extends Action
{
  /**
   * This is the main action called from the Struts framework.
   * @param mapping The ActionMapping used to select this instance.
   * @param form The optional ActionForm bean for this request.
   * @param request The HTTP Request we are processing.
   * @param response The HTTP Response we are processing.
   * @throws javax.servlet.ServletException
   * @throws java.io.IOException
   * @return
   */
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
  {

String password = (String) ((DynaActionForm)form).get("password");
String username = (String) ((DynaActionForm)form).get("username");

System.out.println("Username = " + username);
System.out.println("Password = " + password);

Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs= null;

try
{
    InitialContext ic = new InitialContext();
    DataSource ds = (javax.sql.DataSource)ic.lookup("jdbc/toystore");  // Change this based on your datasource name

    conn = ds.getConnection();
    String sql = "select username, password from signon where username = ? and password = ?"; // Change this according your DB

    pstmt = conn.prepareStatement(sql);
    pstmt.setString(1, username);
    pstmt.setString(2, password);
   
    rs = pstmt.executeQuery();
 
    if(rs.next())
    {
        // Login success, put all the redirect here and everything
        return mapping.findForward("success");
    }
    else
    {
        // Login fail
        return mapping.findForward("fail");
    }
}
catch(Exception e)
{
    e.printStackTrace();
}
finally
{
    // Clean up codes here
}

return mapping.findForward("fail");
  }
 
}
--------------------------------------------------------------------------------

3. "failure.jsp"

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ page contentType="text/html;charset=windows-1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>untitled</title>
</head>
<body>Login failed, please try again
<html:link page="/login.jsp">
  <bean:message key="link.login"/>
</html:link>
</body>
</html>
--------------------------------------------------------------------------------------------------

4. "welcome.jsp"

<%@ page contentType="text/html;charset=windows-1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>untitled</title>
</head>
<body>Welcome to the application...
</body>
</html>

-------------------------------------------------------------------

5. The application will compile entirely with no erros or warnning.  After I run it and input the user name and password and hit submit, here what the browser is telling me:


The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

Please try the following:

Open the 134.139.135.52:8988 home page, and then look for links to the information you want.
Click the  Refresh button, or try again later.

Click  Search to look for information on the Internet.
You can also see a list of related sites.


HTTP 500 - Internal server error
Internet Explorer  

Thank you for your help!

Regards.
tadeu_lbcAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KuldeepchaturvediCommented:
Looks like your relative paths for fail.jsp and login.jsp are not proper in your config file..can you let us know your directory strucutre and struts-config.xml as how they look
bloodredsunCommented:
Try this as your html:form

<html:form action="/login.do">

Also put some logging statements in (even System.out.println("Reached here okay") would do) and check that you are calling your datasource correctly, e.g. that it doesn't need to be something like this

     InitialContext  ic = new InitialContext();
     ds = (javax.sql.DataSource)ic.lookup("java:comp/env/jdbc/toystore");
     conn = ds.getConnection();

The logging statements will tell you where the application is failing and why.
tadeu_lbcAuthor Commented:
Thank you so much, I will give it a try and let you know what happened!

Talk to you  soon!
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

bloodredsunCommented:
okay, good luck with the changes and get back when you have any updates :-)
KuldeepchaturvediCommented:
ooops... didn't look at that 500 internal error at the bottom of the msg.... Bloodred's approach is more yielding here...
tadeu_lbcAuthor Commented:
OK, I forgot to tell you that I am a beginner in java so.............  :)

>>Bloodred's approach is more yielding here... >>Not really sure what you meant by that!


>>Also put some logging statements in (even System.out.println("Reached here okay") would do) and check that you are calling your datasource correctly, e.g. that it doesn't need to be something like this >> I was also confused here!

Sorry!

What do you think I should look for nex?

Regards.

tadeu_lbcAuthor Commented:
Hello Kuldeepchaturvedi,


Also here is how I am calling my datasource,,,

DataSource ds = (javax.sql.DataSource)ic.lookup("jdbc:oracle:thin:@SERVER:1521:toystore");

Do you think that is right?

Regards.
suprapto45Commented:
Hi again,

I am extremely busy.

It is not right.
ds = (javax.sql.DataSource)ic.lookup("java:comp/env/jdbc/toystore");
would be the correct one.

After you did changes on what bloodredsun and Kuldeepchaturvedi, do you still get the error?

Regards
Dave
tadeu_lbcAuthor Commented:
Hello Everybody!!!

Seems to me that this authentication part of my application would be so simple yet I am having a hard time with it!  Please help!

Here is my struts-config.xml file as requested before:

<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
  <form-beans>
    <form-bean name="login" type="org.apache.struts.action.DynaActionForm">
      <form-property name="username" type="java.lang.String"/>
      <form-property name="password" type="java.lang.String"/>    
    </form-bean>
  </form-beans>
  <action-mappings>
    <action name="login" path="/login" type="loginapp.view.LoginAction">
      <forward name="success" path="/welcome.jsp"/>
      <forward name="fail" path="/faliure.jsp"/>
    </action>
  </action-mappings>
  <message-resources parameter="loginapp.view.ApplicationResources"/>
</struts-config>

--------------------------------------------------------------------

So, after I run my app. the error that I am getting is:

>> No action instance for path /login could be created

Is it possible that my action.java is not properly written?  And also that my
struts-config.xml is no completed?  And I am not sure if I am calling the datasource right!
Sorry for being such a beginner!



Here is my loginAction.java:

import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;public class LoginAction extends Action
{
  /**
   * This is the main action called from the Struts framework.
   * @param mapping The ActionMapping used to select this instance.
   * @param form The optional ActionForm bean for this request.
   * @param request The HTTP Request we are processing.
   * @param response The HTTP Response we are processing.
   * @throws javax.servlet.ServletException
   * @throws java.io.IOException
   * @return
   */
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
  {

String password = (String) ((DynaActionForm)form).get("password");
String username = (String) ((DynaActionForm)form).get("username");

System.out.println("Username = " + username);
System.out.println("Password = " + password);

Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs= null;

try
{
    InitialContext ic = new InitialContext();
    //DataSource ds = (javax.sql.DataSource)ic.lookup("jdbc/toystore");  // Change this based on your datasource name
    //DataSource ds = (javax.sql.DataSource)ic.lookup("jdbc:oracle:thin:@134.139.136.48:1521:");  // Change this based on your datasource name
    DataSource ds = (javax.sql.DataSource)ic.lookup("java:comp/env/jdbc/toystore");

    conn = ds.getConnection();
    String sql = "select username, password from signon where username = ? and password = ?"; // Change this according your DB

    pstmt = conn.prepareStatement(sql);
    pstmt.setString(1, username);
    pstmt.setString(2, password);
   
    rs = pstmt.executeQuery();
 
    if(rs.next())
    {
        // Login success, put all the redirect here and everything
        return mapping.findForward("success");
    }
    else
    {
        // Login fail
        return mapping.findForward("fail");
    }
}
catch(Exception e)
{
    e.printStackTrace();
}
finally
{
    // Clean up codes here
}

return mapping.findForward("fail");
  }
 
}

Thanks in advance for any help!
tadeu_lbcAuthor Commented:
HELP!  

Please see the comment I posted above!  

>>Comment from tadeu_lbc
Date: 07/12/2005 03:21PM PDT
bloodredsunCommented:
Change this
<form-bean name="login" type="org.apache.struts.action.DynaActionForm">
to this
<form-bean name="loginForm" type="org.apache.struts.action.DynaActionForm">

and change your action to this (change input value to your page that sends the values):

    <action path="/login"
    type="loginapp.view.LoginAction"
    name="loginForm"  
    validate="false"
    input="/index.jsp"
    scope="request">
      <forward name="success" path="/welcome.jsp"/>
      <forward name="fail" path="/faliure.jsp"/>
    </action>

Also, do a check first on your values from the form to check that they aren't null. This should be done at the top of the page as soon as you get the values from the form

if ( password == null || username == null){
        return mapping.findForward("fail");
}
          

I assume that the LoginAction.java is in the package loginapp.view as it's not in the code?
tadeu_lbcAuthor Commented:
Bloodredsun,

Thanks a lot!  That was a big part of the solution. Indeed the LoginAction.java was not in the right place as far as Jdeveloper is concerned!

So now I don’t get any errors anymore!  But for some reason even if I type in a username and password that match it in the database, I still get redirected to the fail page!  So what do you suggest as far as debugging for this part?

PS: Everything on the database side is correct!  I have TOAD connected to it and I see the table and the right data in it!  I so am thinking maybe there is something wrong with my datasource???  

e.g
--------------------------------------------------------
try
{
    InitialContext ic = new InitialContext();
    //DataSource ds = (javax.sql.DataSource)ic.lookup("jdbc/toystore");  // Change this based on your datasource name
    //DataSource ds = (javax.sql.DataSource)ic.lookup("jdbc:oracle:thin:@134.139.136.48:1521:");  // Change this based on your datasource name
    DataSource ds = (javax.sql.DataSource)ic.lookup("java:comp/env/jdbc/toystore");
---------------------------------------------------------
How does that look to you?

PS2: Here is my whole LoginAction.java as it is now:

import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;public class LoginAction extends Action
{
  /**
   * This is the main action called from the Struts framework.
   * @param mapping The ActionMapping used to select this instance.
   * @param form The optional ActionForm bean for this request.
   * @param request The HTTP Request we are processing.
   * @param response The HTTP Response we are processing.
   * @throws javax.servlet.ServletException
   * @throws java.io.IOException
   * @return
   */
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
  {

String password = (String) ((DynaActionForm)form).get("password");
String username = (String) ((DynaActionForm)form).get("username");

System.out.println("Username = " + username);
System.out.println("Password = " + password);

if ( password == null || username == null){
        return mapping.findForward("fail");
}


Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs= null;

try
{
    InitialContext ic = new InitialContext();
    //DataSource ds = (javax.sql.DataSource)ic.lookup("jdbc/toystore");  // Change this based on your datasource name
    //DataSource ds = (javax.sql.DataSource)ic.lookup("jdbc:oracle:thin:@134.139.136.48:1521:");  // Change this based on your datasource name
    DataSource ds = (javax.sql.DataSource)ic.lookup("java:comp/env/jdbc/toystore");

    conn = ds.getConnection();
    String sql = "select username, password from signon where username = ? and password = ?"; // Change this according your DB

    pstmt = conn.prepareStatement(sql);
    pstmt.setString(1, username);
    pstmt.setString(2, password);
   
    rs = pstmt.executeQuery();
 
    if(rs.next())
    {
        // Login success, put all the redirect here and everything
        return mapping.findForward("success");
    }
    else
    {
        // Login fail
        return mapping.findForward("fail");
    }
}
catch(Exception e)
{
    e.printStackTrace();
}
finally
{
    // Clean up codes here
}

return mapping.findForward("fail");
  }
 
}

Thanks again :)
bloodredsunCommented:
in that case we need to see which actionForward is returning the "fail", you need to put in some logging (log4J or somehting is best but this example using system.out.println will do) here to tell.
e.g.
if ( password == null || username == null){
        System.out.println("failing due to incorrect pwd: "+password+" or usr:"+username) ;
        return mapping.findForward("fail");
}

/*lines of code*/

    else{
        // Login fail
        System.out.println("Login failed for prepared statement for pwd: "+password+" and usr:"+username) ;
        return mapping.findForward("fail");
    }

/*lines of code*/

    finally{
    // Clean up codes here
    }
    System.out.println("failing due to it all going pear shaped at the end!") ;
    return mapping.findForward("fail");
}

If you've worried about the datasource connection, put some more loggin in the section that deals with the exception handling to tell you what the error was like e.getMessage()
tadeu_lbcAuthor Commented:
Hello again,

Sorry for being such a beginner!  I am not really sure how to debug this application but I did realize something!  At the very end of the LoginAction.java file, the last 3 lines goes like this:

------------------------------------------------------------

return mapping.findForward("fail");
  }
 
}

-------------------------------------------------------------

I am under the impression that this is the only part being executed because no matter what information I enter in my form I am always redirected to “fail” and get presented with the failure.jsp page, if this part says “fail”!  And again no mater what information I enter in the form, if I change this part to say “success” it always redirect me to “success” and I get presented with the welcome.jsp page!  

Does that ring a bell to you?

Thanks again!  You are being very helpful :)

Regards Tadeu!  
bloodredsunCommented:
That indicates that an error is being thrown in the try/catch/finally block as that ActionForward is only returned if the previous ones are avoided. Debugging this is pretty simple, all you do is put log statements after each piont of failure and look in the logs to see where it fails and then examine the error message to see why it fails.

Here's a version i would use:

---------------------
//imports
public class LoginAction extends Action {
      /**
       * This is the main action called from the Struts framework.
       * @param mapping The ActionMapping used to select this instance.
       * @param form The optional ActionForm bean for this request.
       * @param request The HTTP Request we are processing.
       * @param response The HTTP Response we are processing.
       * @throws javax.servlet.ServletException
       * @throws java.io.IOException
       * @return
       */
      public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {

            String password = (String) ((DynaActionForm)form).get("password");
            String username = (String) ((DynaActionForm)form).get("username");

            System.out.println("LoginAction: Username = " + username);
            System.out.println("LoginAction: Password = " + password);

            if (password == null || username == null) {
                  System.out.println("LoginAction: failing due to null pwd: "+password+" or usr:"+username) ;
                  return mapping.findForward("fail");
            }

            Connection conn = null;
            PreparedStatement pstmt = null;
            ResultSet rs = null;

            try {
                  InitialContext ic = new InitialContext();
                  System.out.println("LoginAction: got InitialContext okay");
                  DataSource ds = (javax.sql.DataSource)ic.lookup("java:comp/env/jdbc/toystore");
                  System.out.println("LoginAction: got DataSource okay");
                  conn = ds.getConnection();
                  System.out.println("LoginAction: got connection okay") ;
                  String sql = "select username, password from signon where username = ? and password = ?"; // Change this according your DB

                  pstmt = conn.prepareStatement(sql);
                  pstmt.setString(1, username);
                  pstmt.setString(2, password);

                  rs = pstmt.executeQuery();

                  if (rs.next()) {
                        // Login success, put all the redirect here and everything
                        System.out.println("LoginAction: forwarding to success");
                        return mapping.findForward("success");
                  } else {
                        // Login fail
                        System.out.println("LoginAction: forwarding to fail in try/catch block") ;
                        return mapping.findForward("fail");
                  }
            } catch (Exception e) {
                  System.out.println("LoginAction: exception caught: " + e.getMessage() ) ;
                  e.printStackTrace();
            } finally {
                  // Clean up codes here
            }
            System.out.println("LoginAction: forwarding at default/last fail") ;
            return mapping.findForward("fail");
      }

}

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tadeu_lbcAuthor Commented:
Hello,

After looking at my log.... I realized that the problem is with the way I am calling my datasource!
Here is what the log say:

C:\jdev1012\jdk\bin\javaw.exe -jar C:\jdev1012\j2ee\home\admin.jar ormi://IP:23892 admin **** -updateConfig

05/07/14 09:44:02 ApplicationServer: appName = bc4j

05/07/14 09:44:02 ApplicationServer: appName = current-workspace-app

Ready message received from Oc4jNotifier.

05/07/14 09:44:02 Auto-deploying file:/C:/jdev1012/jdev/mywork/RegApp/ViewController/public_html/ (New server version detected)...

Embedded OC4J startup time: 1360 ms.



Target URL -- http://IP:8989/RegApp-ViewController-context-root/login.jsp
Jul 14, 2005 9:44:03 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true

Jul 14, 2005 9:44:03 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true

Jul 14, 2005 9:44:04 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='loginapp.view.ApplicationResources', returnNull=true

Jul 14, 2005 9:44:04 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true

Jul 14, 2005 9:44:04 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true

05/07/14 09:44:10 LoginAction: This is a test by Tadeu

05/07/14 09:44:10 LoginAction: Username = try

05/07/14 09:44:10 LoginAction: Password = try

05/07/14 09:44:10 LoginAction: got InitialContext okay

05/07/14 09:44:10 LoginAction: exception caught: jdbc/toystore not found in RegApp-ViewController-webapp

05/07/14 09:44:10 javax.naming.NameNotFoundException: jdbc/toystore not found in RegApp-ViewController-webapp

05/07/14 09:44:10       at com.oracle.naming.J2EEContext.getSubContext(J2EEContext.java:93)

05/07/14 09:44:10       at com.oracle.naming.J2EEContext.lookup(J2EEContext.java:76)

05/07/14 09:44:10       at com.evermind.server.ApplicationContext.lookupJavaCompEnv(ApplicationContext.java:265)

05/07/14 09:44:10       at com.evermind.server.ApplicationContext.lookupJavaComp(ApplicationContext.java:132)

05/07/14 09:44:10       at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:306)

05/07/14 09:44:10       at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:120)

05/07/14 09:44:10       at javax.naming.InitialContext.lookup(InitialContext.java:347)

05/07/14 09:44:10       at LoginAction.execute(LoginAction.java:50)

05/07/14 09:44:10       at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)

05/07/14 09:44:10       at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

05/07/14 09:44:10       at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)

05/07/14 09:44:10       at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)

05/07/14 09:44:10       at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

05/07/14 09:44:10       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

05/07/14 09:44:10       at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)

05/07/14 09:44:10       at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)

05/07/14 09:44:10       at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)

05/07/14 09:44:10       at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)

05/07/14 09:44:10       at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)

05/07/14 09:44:10       at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)

05/07/14 09:44:10       at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)

05/07/14 09:44:10 LoginAction: forwarding at default/last fail

05/07/14 09:44:10       at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)

05/07/14 09:44:10       at java.lang.Thread.run(Thread.java:534)

Jul 14, 2005 9:44:10 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true

Jul 14, 2005 9:44:10 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true

Jul 14, 2005 9:44:10 AM org.apache.struts.util.PropertyMessageResources <init>

INFO: Initializing, config='org.apache.struts.taglib.bean.LocalStrings', returnNull=true

-------------------------------------------------------------------------------------------------------------------------------------------------------------

I just don't know how to call the datasource!

Here is an export of how I got connection to it:

<?xml version = '1.0'?>
<!DOCTYPE connections>
<connections>
   <connection>
      <JDBC_PORT>1521</JDBC_PORT>
      <ConnectionType>JDBC</ConnectionType>
      <HOSTNAME>***My Server IP Here***</HOSTNAME>
      <user>toystore</user>
      <ConnectionName>toystore</ConnectionName>
      <SID>famis</SID>
      <JdbcDriver>oracle.jdbc.driver.OracleDriver</JdbcDriver>
      <password>toystore</password>
      <ORACLE_JDBC_TYPE>thin</ORACLE_JDBC_TYPE>
   </connection>
</connections>
-----------------------------------------------------------------------------------

Could you please let me know the right way to call the datasource??

Thank you very!

Regards  Tadeu!
tadeu_lbcAuthor Commented:
Thanks guys!  
My application works now!  :)
bloodredsunCommented:
Excellent cheers for the points and grade :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.