You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mort Coleman <mo...@mactiques.com> on 2003/12/12 07:10:07 UTC

OracleDriver fails 1.0 to 1.1 upgrade.

I found one posting about the url needing to be URL but did not help.

here is my struts-config.xml portion: 
<data-sources>
   <data-source>
    <set-property property="description" value="Supporting Database" />
    <set-property property="driverClass"
value="oracle.jdbc.driver.OracleDriver" />
    <set-property property="maxCount"    value="10" />
    <set-property property="minCount"    value="2" />
    <set-property property="URL"
value="jdbc:oracle:thin:cmpcom_web_user/cnagxxxx@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=66.134.16.9)(PORT=8007)))(CONNECT_DATA=(SERVICE_NAME=DEV1.BOOSHLAKA.COM)))" />
   </data-source>
  </data-sources>
 
ActionServlet: MowerPartsActionServlet:
--start here -- 

package com.cmp.servlet;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;

import javax.servlet.ServletException;

import org.apache.struts.action.ActionServlet;

import org.apache.struts.util.GenericDataSource;

import com.cmp.db.IdentifyDatabase;

/**
 * Make sure to identify the default database in use upon 
 * starting/initializing this context.
 *
 * @version 27 February 2002
 */
 public class MowerPartsActionServlet extends ActionServlet{
 
   public void init()
   throws ServletException{
      super.init();
      DataSource dataSource = this.findDataSource(null);
      try{
         Connection conn = dataSource.getConnection();
         IdentifyDatabase.setDB(conn);
         conn.close();
         
         System.out.println("Database detected: " + IdentifyDatabase.getDB());
      } catch (SQLException e){
         this.log("Error getting DB connection.", e);
      }
   }
}

//finish here

log portion here
Dec 10, 2003 12:39:21 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='ApplicationResources', returnNull=true
Dec 10, 2003 12:39:21 AM org.apache.struts.action.ActionServlet
initModuleDataSources
SEVERE: Initializing application data source
org.apache.struts.action.DATA_SOURCE
java.sql.SQLException: open: java.lang.NullPointerException
        at
org.apache.struts.legacy.GenericDataSource.open(GenericDataSource.java:735)
        at
org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1085)
        at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
        at
com.cmp.servlet.MowerPartsActionServlet.init(MowerPartsActionServlet.java:26)
        at javax.servlet.GenericServlet.init(GenericServlet.java:256)

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Cahin actions and GZIP filter

Posted by Jose Ramon Diaz <jo...@aranzadi.es>.
Hello,

  I´m trying to use a filter to compress my application using GZIP. I have
read:
	http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters-p3.html

  and it seems to work except when I chain actions. It uses a RequestWrapper
for not writing the stream to the response. If I call one action which
executes a forward to another action, I get te exception:

java.io.IOException: Cannot flush a closed output stream
	at
es.aranzadi.base.controller.CompressionResponseStream.flush(CompressionRespo
nseStream.java:84)
	at
es.aranzadi.base.controller.CompressionResponseWrapper.flushBuffer(Compressi
onResponseWrapper.java:38)
	at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.
java:244)
	at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.GetParametersRequestDispatcher.forward(GetParametersReques
tDispatcher.java:189)
	at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
	at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
	at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
	at
es.aranzadi.base.controller.CompressionFilter.doFilter(CompressionFilter.jav
a:67)
	at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.j
ava:560)
	at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDis
patcher.java:306)
	at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:
767)
	at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
	at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
	at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.ja
va:803)
	at java.lang.Thread.run(Thread.java:484)


	Why the stream is closed? My application never colses the response stream.
Can anybody help me?

    Jose R.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: OracleDriver fails 1.0 to 1.1 upgrade.

Posted by Antony Paul <an...@hotmail.com>.
try driverClassName.

Antony Paul.

----- Original Message -----
From: "Mort Coleman" <mo...@mactiques.com>
To: <st...@jakarta.apache.org>
Sent: Friday, December 12, 2003 11:40 AM
Subject: OracleDriver fails 1.0 to 1.1 upgrade.


> I found one posting about the url needing to be URL but did not help.
>
> here is my struts-config.xml portion:
> <data-sources>
>    <data-source>
>     <set-property property="description" value="Supporting Database" />
>     <set-property property="driverClass"
> value="oracle.jdbc.driver.OracleDriver" />
>     <set-property property="maxCount"    value="10" />
>     <set-property property="minCount"    value="2" />
>     <set-property property="URL"
>
value="jdbc:oracle:thin:cmpcom_web_user/cnagxxxx@(DESCRIPTION=(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=66.134.16.9)(PORT=8007)))(CONNECT_DATA=(SERVICE
_NAME=DEV1.BOOSHLAKA.COM)))" />
>    </data-source>
>   </data-sources>
>
> ActionServlet: MowerPartsActionServlet:
> --start here --
>
> package com.cmp.servlet;
>
> import java.sql.Connection;
> import java.sql.SQLException;
>
> import javax.sql.DataSource;
>
> import javax.servlet.ServletException;
>
> import org.apache.struts.action.ActionServlet;
>
> import org.apache.struts.util.GenericDataSource;
>
> import com.cmp.db.IdentifyDatabase;
>
> /**
>  * Make sure to identify the default database in use upon
>  * starting/initializing this context.
>  *
>  * @version 27 February 2002
>  */
>  public class MowerPartsActionServlet extends ActionServlet{
>
>    public void init()
>    throws ServletException{
>       super.init();
>       DataSource dataSource = this.findDataSource(null);
>       try{
>          Connection conn = dataSource.getConnection();
>          IdentifyDatabase.setDB(conn);
>          conn.close();
>
>          System.out.println("Database detected: " +
IdentifyDatabase.getDB());
>       } catch (SQLException e){
>          this.log("Error getting DB connection.", e);
>       }
>    }
> }
>
> file://finish here
>
> log portion here
> Dec 10, 2003 12:39:21 AM org.apache.struts.util.PropertyMessageResources
<init>
> INFO: Initializing, config='ApplicationResources', returnNull=true
> Dec 10, 2003 12:39:21 AM org.apache.struts.action.ActionServlet
> initModuleDataSources
> SEVERE: Initializing application data source
> org.apache.struts.action.DATA_SOURCE
> java.sql.SQLException: open: java.lang.NullPointerException
>         at
>
org.apache.struts.legacy.GenericDataSource.open(GenericDataSource.java:735)
>         at
>
org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j
ava:1085)
>         at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
>         at
>
com.cmp.servlet.MowerPartsActionServlet.init(MowerPartsActionServlet.java:26
)
>         at javax.servlet.GenericServlet.init(GenericServlet.java:256)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org