Announcement Announcement Module
Collapse
No announcement yet.
Spring + Glassfish Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring + Glassfish

    Regards,

    I need to move from Tomcat to Glassfish. Before the change I use this conection to database:

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="com.ibm.db2.jcc.DB2Driver"/>
    <property name="url" value="jdbc:db2://localhost:50000:currentSchema=SYSTEM;"/>
    <property name="username" value="root"/>
    <property name="password" value="root"/>
    </bean>

    As you can see the data class is for apache. What class I need to use Glassfish?

    Thank you,

    Praedos

  • #2
    Exactly the same...

    Comment


    • #3
      Then error

      Then, why the aplication server throws this error?

      Code:
      org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Excepción de E/S: The Network Adapter could not establish the connection)
      If my connection line is that:

      Code:
      <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
                        <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
                        <property name="url" value="jdbc:oracle:thin://localhost:1521:currentSchema=SYSTEM;"/>
                        <property name="username" value="root"/>
                        <property name="password" value="root"/> 
          </bean>
      Thanks,

      Praedos

      Comment


      • #4
        Then, why the aplication server throws this error?
        Well your exception tells you what is wrong, it cannot create a connection. Is your database running, is the port still the same, do you have ALL the needed jars on your classpath (although I would expect a ClassDefNotFoundException in that case). Do you have the correct oracle driver etc.

        But there is NO difference in your configuration the fact that you use a apache datasource implementation doesn't matter.

        Comment


        • #5
          is resolved

          Thank you,

          The problem was that the connection descriptor is not correct.

          Comment

          Working...
          X