JSP, EJB in Jboss 4 with mySQL database. Error in connecting to database

Hi, i using JBoss 4-0-1 with jsp and mySQL database. I get this example from a book using stateless session beans. However i modify it so it can connect to mySQL database.
This is my code for jsp.
<%@ page import="asg.MusicEJB.*,
java.util.*,
javax.naming.Context,
javax.naming.InitialContext,
javax.rmi.PortableRemoteObject" errorPage="error.jsp" %>
<%--
     The following 3 variables appear in a JSP declaration.
     They appear outside the generated _jspService() method,
     which gives them class scope.
     Since we want to initialize our Music EJB object once
     and read the Music Collection database to get the
     recording titles once, we place this code inside
     method jspInit().
     The EJB business method getMusicList()
     returns a collection of RecordingVO objects which we
     store in ArrayList albums.
--%>
<%!
     MusicHome musicHome;
     Music mymusic;
     ArrayList albums;
     Properties properties=new Properties();
     public void jspInit() {
               properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
               properties.put(Context.PROVIDER_URL, "localhost:3306");
               System.out.println("............................in properties");
          try {
               //Context initial = new InitialContext();
               InitialContext jndiContext = new InitialContext(properties);
               //Object ref  = jndiContext.lookup("MusicEJB");
               Object objref = jndiContext.lookup("java:comp/env/ejb/EJBMusic");
               musicHome = (MusicHome)PortableRemoteObject.narrow(objref, MusicHome.class);
               mymusic = musicHome.create();
               albums = mymusic.getMusicList();
               System.out.println(".............................in line 64");
          } catch (Exception ex) {
               System.out.println("Unexpected Exception............: " +
                         ex.getMessage());
               ex.printStackTrace();
%>
<%--
     The following scriptlet accesses the implicit
     request object to obtain the current URL
     and saves it to the session object for later retrieval. 
     It also saves variable mymusic, so we can
     make remote calls to our Music EJB, and the collection of
     RecordingVO objects.  These variables will all be available
     to other pages within the session.
--%>
<%
     String requestURI = request.getRequestURI();
     session.putValue("url", requestURI);
     session.putValue("mymusic", mymusic);
     session.putValue("albums", albums);
%>
<html>
<head>
<title>Music Collection Database Using EJB & JSP Version 9.7</title>
</head>
<body bgcolor=white>
<h1><b><center>Music Collection Database Using EJB & JSP</center></b></h1>
<hr>
<p>
There are <%= albums.size() %> recordings.
<form method="post" action="musicPost.jsp">
<p>
Select Music Recording:
<select name="TITLE">
<%
     // Generate html <option> elements with the recording
     // titles stored in each RecordingVO element.
     // Obtain the current title from the session object
     // (this will be null the first time).
     String title;
     String currentTitle = (String)session.getValue("curTitle");
     if (currentTitle == null) currentTitle = "";
     RecordingVO r;
     Iterator i = albums.iterator();
     while (i.hasNext()) {
          r = (RecordingVO)i.next();
          title = r.getTitle();
          if (title.equals(currentTitle)) {
               out.println("<option selected>" + title + "</option>");
          else {
               out.println("<option>" + title + "</option>");
%>
</select><p><p>
<%--
     Provide a "View Tracks" button to submit
     the requested title to page musicPost.jsp
--%>
<input TYPE="submit" NAME="View" VALUE="View Tracks">
</form>
</body>
</html>Message was edited by:
chongming

This is the deployment descriptor for the .ear file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
<application>
  <display-name>MusicDAOApp</display-name>
  <description>Application description</description>
  <module>
    <web>
      <web-uri>war-ic.war</web-uri>
      <context-root>music</context-root>
    </web>
  </module>
  <module>
    <ejb>ejb-jar-ic.jar</ejb>
  </module>
<!--
  <module>
    <java>app-client-ic.jar</java>
  </module>
-->
</application>
And this is the deployment for the ejb class files:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
  <display-name>MusicEJB</display-name>
  <enterprise-beans>
    <session>
      <display-name>MusicEJB</display-name>
      <ejb-name>MusicEJB</ejb-name>
      <home>asg.MusicEJB.MusicHome</home>
      <remote>asg.MusicEJB.Music</remote>
      <ejb-class>asg.MusicEJB.MusicBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>
      <env-entry>
        <env-entry-name>MusicDAOClass</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value>asg.MusicEJB.MusicDAOCloudscape</env-entry-value>
      </env-entry>
     <env-entry>
     <env-entry-name>dbUrl</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value>jdbc:mysql://localhost/music</env-entry-value>
      </env-entry>
      <env-entry>
        <env-entry-name>dbUserName</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value>chongming</env-entry-value>
      </env-entry>
      <env-entry>
        <env-entry-name>dbPassword</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value>kcm82</env-entry-value>
     </env-entry>
      <security-identity>
        <description></description>
        <use-caller-identity></use-caller-identity>
      </security-identity>
    </session>
  </enterprise-beans>
</ejb-jar>I can combine the jar and war files into a ear file. deploying is alright without any errors.
However when i run the jsp, it prompt this error:
You Have Encountered an Error
Stack Trace
java.lang.NullPointerException
     at org.apache.jsp.musicGet_jsp._jspService(org.apache.jsp.musicGet_jsp:111)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
     at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
     at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
     at java.lang.Thread.run(Thread.java:595)
How to i solve the error? I look at he catch results in the command prompt of JBoss , i found that when running, the code will be caught by the exception and display this:int.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
kerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
13:55:21,375 INFO [STDOUT] Unexpected Exception............: EJBException:; nes
ted exception is:
javax.ejb.EJBException: getMusicList: SQLException during DB Connection:
The url cannot be null
13:55:21,375 INFO [STDOUT] java.rmi.ServerException: EJBException:; nested exce
ption is:
javax.ejb.EJBException: getMusicList: SQLException during DB Connection:
The url cannot be null 13:55:21,375 INFO[STDOUT] at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:352)
13:55:21,375 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:196)
What can i do to solve the problem? please helpMessage was edited by:
chongming
Message was edited by:
chongming
Message was edited by:
chongming

Similar Messages

  • A database error occured. The database error text is: ORA-29275: partial multibyte character . (WIS 10901)

    Hi,
    My Webi report is geeting failed with the error
    "A database error occured. The database error text is: ORA-29275: partial multibyte character . (WIS 10901)"
    may i know the root cause of the above error and how to resolve it. I am using BO 3.1.
    Its very important to provide the report. Please help urgently.
    Thanks in advance.
    Abid

    Hi Abid,
    Please see SAP Note 1556127.
    Symptom
    A database error occurs after refreshing a web intelligence report in java report panel or web intelligence in interactive mode
    The database error text is: ORA 29275 with partial multibyte character (WIS 10901)
    Environment
    windows 2003 Server
    Cause
    Environment variables are not set with value UTF-8:LC_ALL,LANG, and NLS_LANG
    Resolution
    Set following system environment variables: LC_ALL,LANG, and NLS_LANG with value UTF-8. For example, LC_ALL=EN_US.UTF-8

  • A database error occured. The database error text is: ORA-00932: inconsiste

    Hi Experts,
    In WebI XI 3.1, i am getting this error when i run webi report against a derived table "A database error occured. The database error text is: ORA-00932: inconsistent datatypes: expected NUMBER got DATE ". The derived table is designed in such a way that it populates only last week data, however, the result populates data for last week and current week. For the current week, it shows date range from feb19 to feb25, so the data is not correct. how can i get rid of current week.

    Hello, the error means that it is pulling a field with DATE type instead of a number, you should convert the date to a number at universe or document level.

  • Error "no connect to database " after moving group to second node.

    hi experts,
    I set up ERP2005 SR1 and MSSQL2005 with two nodes MSCS.
    I am facing error "no connect to database session terminated mscs" from SAP GUI
    after moving group to second node.
    Now SPS level and kernel patch level has been not updated yet.
    I counld'nt find any sap notes, so any help and suggestion could be appreciated.
    Best Regards
    MASAKI

    solved myself . i was missing set SQL Service Account have Local Admnistrators.

  • Problem with reached maximum number of connections to database

    Dear Experts,
    Our Production system was not responding properly last week.
    The below was the reply from the Basis team.
    "It seems that we have again problem with reached maximum number of connections to database. We have extended this number to 100 this year and now it seems that it’s not enough again. It seems that something is running on Production, which takes over too many connections."
    They have increased the number to 200 as a work around.
    Do we have any means to find out, which component or application is causing the issue.
    Please advise me if any better way is available to correct the issue.
    Please see the below trace.
    From default trace:
    ======
    Caused by: com.sap.engine.services.dbpool.exceptions.BaseSQLException: ResourceException occurred in method ConnectionFactoryImpl.getConnection(): javax.resource.R
    esourceException: (Failed in component: dbpool, BC-JAS-TRH) Cannot create connection. Possible reasons: 1)Maximum allowed connections to DB or EIS is reached. You
    can apply CSN Note 719778 in order to check and resolve connection leaks. 2) Configuration to DB/EIS is wrong or DB/EIS is temporary unreachable. 3) Connections ar
    e not enough for current load.
            at com.sap.engine.services.dbpool.cci.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:60)
            at com.sap.security.core.persistence.datasource.imp.J2EEConnectionPool.getConnection(J2EEConnectionPool.java:205)
            ... 61 more
    Caused by: javax.resource.ResourceException: (Failed in component: dbpool, BC-JAS-TRH) Cannot create connection. Possible reasons: 1)Maximum allowed connections to
    DB or EIS is reached. You can apply CSN Note 719778 in order to check and resolve connection leaks. 2) Configuration to DB/EIS is wrong or DB/EIS is temporary unr
    eachable. 3) Connections are not enough for current load.
            at com.sap.engine.services.connector.jca.ConnectionHashSet.match(ConnectionHashSet.java:230)
            at com.sap.engine.services.connector.jca.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:343)
            at com.sap.engine.services.connector.jca.ShareableConnectionManager.allocateConnection(ShareableConnectionManager.java:54)
            at com.sap.engine.services.dbpool.cci.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:52)
            ... 62 more
    Caused by: com.sap.engine.services.dbpool.exceptions.BaseResourceException: SQLException is thrown by the pooled connection: com.sap.sql.log.OpenSQLException: No c
    onnection to data source SAPEPPDB available. All 100 pooled connections are in use and 70 connection requests are currently waiting. The connection pool size might
    need to be adjusted.
            at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:192)
            at com.sap.engine.services.connector.jca.ConnectionHashSet.match(ConnectionHashSet.java:221)
            ... 65 more
    Caused by: com.sap.sql.log.OpenSQLException: No connection to data source SAPEPPDB available. All 100 pooled connections are in use and 70 connection requests are
    currently waiting. The connection pool size might need to be adjusted.
    ======
    Thanks and Kind Regards,
    Jelbin

    Stop all instances(including DB) and start again, Hope it should work.
    It may happened that jar has not been synchronized with the database and may be version mismatch with the java.
    719778 - Data Source fails to return connection
    1650472 - Transactions are interrupted due to database connection periodically failing to establish
    1138877 - How to Deploy External Drivers JDBC/JMS Adapters
    Change the connection pool so that it can connect to DB as per the note 719778
    Regards
    Vijay Kalluri

  • Error while connecting to Database after Database upgradation

    Hi All,
    I installed and worked with BAM and used Oracle Database 9i previously. After the Database
    was upgraded to 10g (10.2.0.4.0 which is compatible for BAM), I am trying to ReInstall BAM
    which is throwing me an error.
    It accepts the Database Login Information but at the step of building Repository for
    Enterprise Link it gives up the following error:
    ' A connection with the database cannot be made '
    Can anyone please help me to figure out this one.
    Thanks,
    Vishal

    Hi,
    I also have the same problem.Could you plz tell us what configuration I need to add in tnsnames.ora file.
    content of my tnsnames.ora file is below
    # tnsnames.ora Network Configuration File: C:\DevSuiteHome_2\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = Rahul-PC)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = PLSExtProc)
    )

  • Error in connecting Oracle Database from JAVA application!!!

    Hi,
    I am trying to connect to the Oracle11g database server from the client machine using JAVA eclipse. I have installed the oracle client in the client machine. Once i try to execute the below code it was throwing below error:
    public class Dbconnect {
    public static void main (String[] args)throws Exception {
    try {
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    String connectString = "jdbc:oracle:thin:@<IP Address>:1521:orcl";
    OracleDriver drivers = new OracleDriver();
    System.out.println(drivers);
    Connection connection = null;
    connection = (OracleConnection)DriverManager.getConnection(connectString,"ADMIN", "admin");
    System.out.println(connection);
    System.out.println("Connected to the database");
    Error:
    java.sql.SQLException: The Network Adapter could not establish the connection
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at DBConnect.main(DBConnect.java:15)
    Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
         at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:359)
         at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
         at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)
         at oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)
         at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
         ... 7 more
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)
         at oracle.net.nt.ConnOption.connect(ConnOption.java:123)
         at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)
         ... 12 more
    I am unable to connect using sqlplus as well ORA-12560: TNS:protocol adapter error
    Please advise me on how to resolve this issue..
    Thanks

    Prabhu wrote:
    We are not able to connect from SQLplus as we.. If i issue this command in Sqlplus from client machine 'sqlplus admin/admin@'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<Ip Adddress>)(PORT=1521)))(CONNECT_DATA=(SID=orcl)))'' it was throwing the below error.
    Error: ORA-12541: TNS:no listener
    Do i need add get any config details in the client machine..
    Could please tell me what is the general procedure to access the DB server from client machine..on DB Server issue following OS commands
    lsnrctl start
    lsnrctl status
    lsnrctl service
    COPT commands & results, then PASTE all back here

  • Error when connecting to database in windows2000 professionnel

    i have a database in unix and another database in windows 2000 professionnel when i want to connect using sqlplus to database in windows 2000 professionel from database in unix the message error will appear memory fault(coredump)

    yes, when we install oracle 8i in windows professionel we have this problem, before installing 8i we connected to the database without problem
    thank you

  • Error when connecting to database from connection manager

    New installation of JDeveloper 11r2.
    java.lang.NullPointerException
         at oracle.dms.context.DMSContextManager.getContext(DMSContextManager.java:437)
         at oracle.dms.context.ExecutionContext.get(ExecutionContext.java:445)
         at oracle.dms.context.ExecutionContext.get(ExecutionContext.java:492)
         at oracle.dms.instrument.Noun.<init>(Noun.java:188)
         at oracle.dms.instrument.Noun.create(Noun.java:275)
         at oracle.dms.instrument.NounFactory.create(NounFactory.java:66)
         at oracle.jdbc.driver.DMSFactory.createNoun(DMSFactory.java:69)
         at oracle.jdbc.driver.PhysicalConnection.createDMSSensors(PhysicalConnection.java:2253)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:617)
         at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:132)
         at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:54)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:413)
         at oracle.jdeveloper.db.adapter.AbstractConnectionCreator.getConnection(AbstractConnectionCreator.java:117)
         at oracle.jdeveloper.db.adapter.DatabaseProvider.getConnection(DatabaseProvider.java:174)
         at oracle.jdeveloper.db.adapter.DatabaseProvider.getConnection(DatabaseProvider.java:143)
         at oracle.jdevimpl.db.adapter.CADatabaseFactory.createConnectionImpl(CADatabaseFactory.java:44)
         at oracle.javatools.db.DatabaseFactory.createConnection(DatabaseFactory.java:352)
         at oracle.javatools.db.DatabaseFactory.createDatabase(DatabaseFactory.java:148)
         at oracle.jdeveloper.db.DatabaseConnections.getDatabase(DatabaseConnections.java:504)
         at oracle.jdeveloper.db.DatabaseConnections.getDatabase(DatabaseConnections.java:440)
         at oracle.dbtools.raptor.utils.Connections$ConnectionInfo$ConnectRunnable.doWork(Connections.java:1051)
         at oracle.ide.dialogs.ProgressRunnable.run(ProgressRunnable.java:156)
         at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:612)
         at java.lang.Thread.run(Thread.java:595)
    Occurs with both thin and oci8 connections.
    Any ideas?
    Conection name: tryit
    Connection type: Oracle (JDBC)
    username: me
    password: mine
    save password: ticked
    Driver: thin (also tried oci8)
    Host Name: myhost
    SID: my10gdb (also tried service name).

    yes, when we install oracle 8i in windows professionel we have this problem, before installing 8i we connected to the database without problem
    thank you

  • Show error when connect Company Database by DI API in 2004B

    Hi
    I use the DI API to connect company database in 2004B.  I can get the company lists by SAPbobsCOM.CompanyClass.GetCompanyList().
    I write a program to testing the connection that show two different result in client and server side.
    - It show the error -2147221164 (Class not registered), when connect company database in client PC. 
    - The same program run in server, it connected.
    I already checked my config as below
    - SAP 2004B is installed 7.20.145 SP:00 PL:25
    - SAPbobsCOM67.dll is 6.70.188.0 version, and "Special Build Description" is 21.
    The client and server side are same config.
    Any ideas how I should handle this?
    Thanks
      Winson

    sorry! it is wrong posted in here!!

  • Error in connecting to database using a datasource in a jsp file

    Dear SDN's,
    I have a program which retreives Data from the Employee table and displays on portal page.
    What i have done is,
    I have created a pageprocessor component, with 2 jsp files one is for data insert and other is for retriving the data from the database table.
    For inserting the records, i have written the code in the Even handling method of Page Proceessor component.
    For retriving the data i have written the following jsp code in the jsp file and this i am calling in PBO of pageprocessor component based on the condition.
    When i try to insert the records it is working fine.But i am getting an error when try to execute the retreving the records in other jsp.
    Please go through the following code and correct me if anything is wrong here.
    <b><%@ page language="java" %>
    <%@ page import ="java.lang.*,java.sql.Connection,javax.sql.DataSource,java.sql.Statement,java.sql.ResultSet,javax.naming.InitialContext" %>
    <body>
    <center>
         <table border="1">
         <tr cellpadding="1">
         <th>Empid</th>
         <th>Name</th>
         <th>City</th>
         </tr>
    <%
         InitialContext initialContext = new InitialContext();
         DataSource ds = (DataSource) initialContext.lookup("jdbc/MyDS");
         Connection conn = ds.getConnection();
         stmt = conn.createStatement();     
         ResultSet rs=stmt.executeQuery("select * from EMP_DETAILS");
         while(rs.next())
              out.println(rs.getString("EMPID"));
              out.println(rs.getString("NAME"));
              out.println(rs.getString("CITY"));
         %>
         <tr cellpadding="1">
              <td><%=rs.getString("EMPID")%></TD>
              <TD><%=rs.getString("NAME")%></td>
              <td><%=rs.getString("CITY")%></td>
              <br>
              </table>
              catch (Exception e) {                    
         e.printStackTrace();
         out.println("Exception" + e);     
              }</b>
    The error what i am getting is.
      Portal Runtime Error
    An exception occurred while processing a request for :
    iView : JSPdbProject.Empjava
    Component Name : JSPdbProject.Empjava
    Error occurs during the rendering of jsp component.
    Exception id: 04:29_16/11/06_0005_507480350
    See the details for the exception ID in the log file

    Hi Sumathi,
    here is the error log.
    #1.5#0017087C79D800760000004700001C000004225B24927786#1163674757780#com.sap.portal.portal#sap.com/irj#com.sap.portal.portal#J2EE_ADMIN#10231##OBTDEV15_O50_507480350#J2EE_ADMIN#6afb6760756111dbaf3c0017087c79d8#SAPEngine_Application_Thread[impl:3]_24##0#0#Error#1#/System/Server#Java###Exception ID:04:29_16/11/06_0005_507480350
    [EXCEPTION]
    #1#com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Resource
    Component : JSPdbProject.Empjava
    Component class : Empjava
    User : J2EE_ADMIN
         at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:969)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:444)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:527)
         at com.sapportals.portal.prt.component.AbstractComponentResponse.include(AbstractComponentResponse.java:89)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:232)
         at com.sapportals.portal.htmlb.page.JSPDynPage.doOutput(JSPDynPage.java:76)
         at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:129)
         at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
         at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
         at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sapportals.portal.prt.component.PortalComponentException: Error occurs during the compilation of java generated from the jsp
         at com.sapportals.portal.prt.core.broker.JSPComponentItem.getComponentInstance(JSPComponentItem.java:116)
         at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.service(PortalComponentItemFacade.java:355)
         at com.sapportals.portal.prt.core.broker.PortalComponentItem.service(PortalComponentItem.java:934)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:435)
         ... 38 more
    Caused by: com.sapportals.portal.prt.servlets_jsp.server.compiler.CompilingException: Error occurs during the rendering of jsp component
         at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:2189)
         at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.compile(JSPCompiler.java:81)
         at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.run(JSPCompiler.java:140)
         at com.sapportals.portal.prt.core.broker.JSPComponentItem.compileJSP(JSPComponentItem.java:291)
         at com.sapportals.portal.prt.core.broker.JSPComponentItem.getComponentInstance(JSPComponentItem.java:141)
         ... 41 more
    Thanks,
    sireesha.B

  • Error in connecting the database with context.xml resource

    Dear everyone,
    i am trying to connect the application with database...
    i have a table with employee id, name...
    i have given context xml and established connection..
    but i am getting error as
    * " Element type "Resource" must be followed by either attribute specifications, ">" or "/>"."
    * "The context.xml file seems to be broken. Check whether it is well-formed and valid."
    anyone please give ur suggestions....

    the error that i received now was...
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 34 in the jsp file: /index.jsp
    Context cannot be resolved to a type
    31:        int i=0;
    32:       
    33:       
    34:        Context ctx = new InitialContext();
    35:        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/employee");
    36:       
    37:        try
    An error occurred at line: 34 in the jsp file: /index.jsp
    InitialContext cannot be resolved to a type
    31:        int i=0;
    32:       
    33:       
    34:        Context ctx = new InitialContext();
    35:        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/employee");
    36:       
    37:        try
    An error occurred at line: 35 in the jsp file: /index.jsp
    DataSource cannot be resolved to a type
    32:       
    33:       
    34:        Context ctx = new InitialContext();
    35:        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/employee");
    36:       
    37:        try
    38:         {
    An error occurred at line: 35 in the jsp file: /index.jsp
    DataSource cannot be resolved to a type
    32:       
    33:       
    34:        Context ctx = new InitialContext();
    35:        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/employee");
    36:       
    37:        try
    38:         {
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.

  • Debuging EJB in JBoss with JDeveloper

    Can anyone tell me tell me what I have to do to debug EJB on a JBoss 3.2.1 server with JDeveloper 9.0.3???

    Go to http://localhost:8082 and check the JNDI-View MBean. Check both the java and global namespace. If you are outside of the EJB-Container then you have to use the global namespace. The glocal namespace should have your EJB. Use this path as name to do a JNDI look up. Also be sure you are using narrow.

  • Installed MySQL, but can't connect to database...?

    I run a wiki website, but sometimes want to be able to play with ideas and prep pages when I don't have connectivity or when the connection is bad. I've tried installing MediaWiki right on my MacBook, but while I've ensured that PHP and MySQL are set up, I can't figure out what address to put in the Database Host field, having tried localhost, my computer's address shown in the sharing control panel, usr/local/mysql/bin/mysql/data, and so on and so forth. Everything I do comes back with an error that it can't connect to the database server, even though the MySQL preference pane says that it's installed and running.
    Does anyone know what to put in the field?

    Hi,
    From Terminal, have you verified that you can access MySQL from its own command-line interface? This would confirm that at least MySQL is installed and running correctly. Also, in order to have PHP apps running correctly, you have to turn on Web Sharing in the Sharing section of System Preferences. When you turn on Web Sharing, the URL of your personal website is shown on the preference panel. You should be able to navigate to that site, and if you haven't started any development yet, you should get a default Apache page.
    Hope this helps,
    Ken

  • Error while connecting to database

    I have deployed an asp.net web application on a windows server2003 ,the database is oracle10g and the servers .net framework is version 1.
    the application runs correctly on windows xp with .net framework version 1.1 ,but when I run the application on the server it returns this error:
    System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Exception: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    [Exception: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.]
    System.Data.OracleClient.DBObjectPool.GetObject(Object owningObject, Boolean& isInTransaction) +207
    System.Data.OracleClient.OracleConnectionPoolManager.GetPooledConnection(String encryptedConnectionString, OracleConnectionString options, OracleConnection owningObject, Boolean& isInTransaction) +165
    System.Data.OracleClient.OracleConnection.OpenInternal(OracleConnectionString parsedConnectionString, Object transact) +600
    System.Data.OracleClient.OracleConnection.Open() +32
    BusinessLayer.DbLayer.DAL.Select(String selectStr) in e:\mansouri\voisual studio projects\rims\businesslayer\dblayer\dal.cs:45
    RIMS.Common.Public.FillGrid(UltraWebGrid grid, String cmdStr) in E:\Mansouri\Voisual Studio Projects\RIMS\Common\Public.cs:135
    RIMS.MainInitialInfo.FrmSemat.Page_Load(Object sender, EventArgs e) in E:\Mansouri\Voisual Studio Projects\RIMS\MainInitialInfo\FrmSemat.aspx.cs:52
    System.Web.UI.Control.OnLoad(EventArgs e) +67
    System.Web.UI.Control.LoadRecursive() +35
    System.Web.UI.Page.ProcessRequestMain() +750
    Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
    I have changed the permissions to the Oracle_home folder to read & execute for everyone and restarted the server but still recieve the error msg.
    Can AnyOne Help Me With This Problem?

    Hi
    DId you end up resolving this as I am getting a similar error and not sure how to fix it.
    Thanks
    Alex

Maybe you are looking for

  • Nls support in Portal 3.0.7.6.2 / Win 2000 / 8.1.7 Std.

    After installing nls for norwegian language, I have experienced a lot of problems with our portal installation, like: 1. Unability to make new Content Areas (Error: 1006991) 2. Unability to use custom folder types with custom attributs (can't be edit

  • Zoom with scroll wheel?

    The zooming with scroll wheel feature stopped working after I installed MAC OS X 10.6.  Anyone have a suggestion about how to get that feature working again?  Thanks.

  • The timeout of RFC/BPM

    I have 2 scenarios 1. RFC1 -> XI -> MQ (AP1) -> XI -> RFC1 (synchronous/asynchronous bridge)     ps: AP1 gets the message from MQ and put the response into MQ 2. MQ -> XI -> RFC2 -> XI -> MQ (asynchronous/synchronous bridge) But sometimes AP1 and RFC

  • TS3297 I get a R6025 runtime error when signing in to itune

    I receive a R 6025 run time error when starting a search in I Tunes Store. I have downloaed the latest version of itunes.

  • Horizontal Blue Lines

    Hey all, I have a problem that I tackled a LONG time ago and cant remember why it is happening or how I fixed it. I used the PSD2FLA plugin to import my images into Flash. It works marvelously. BUt I just used it for a file that I am working with, an