On Sun, 31 Oct 2004 13:23:40 +0100, Ralph Schaer <[EMAIL PROTECTED]> wrote:
>
> I have a small application with an embedded Tomcat 5.0.x. Now I try to
> upgrade to Tomcat 5.5.x. The problem is that the API changed. My code
> no longer compiles. Below the code for my Tomcat 5.0.x version. The
> part with ContextResource and ResourceParams no longer work this way
> in Tomcat 5.5.x. Does anybody knows what I have to change.
>
> Regards
> Ralph
>
> Embedded embeddedTomcat = new Embedded();
> Engine engine = embeddedTomcat.createEngine();
>
> Host host = embeddedTomcat.createHost("localhost", catalinaHome);
> engine.addChild(host);
>
> StandardContext rootCtx =
> (StandardContext)embeddedTomcat.createContext(context, warFile.getPath());
> rootCtx.setWorkDir(workDir);
>
> ContextResource res = new ContextResource();
> res.setName("jdbc/" + dataSourceName);
> res.setType("javax.sql.DataSource");
> res.setAuth("Container");
> rootCtx.addResource(res);
>
> ResourceParams params = new ResourceParams();
> params.setName("jdbc/" + dataSourceName);
> params.addParameter("factory",
> "org.apache.commons.dbcp.BasicDataSourceFactory");
params.addParameter -> res.setProperty. So ResourceParams is no longer
needed, which should make your code smaller.
Also be careful that the factory name for DBCP changes (Tomcat, like
Java 5, does package renaming to avoid problems). So you'd better
leave it blank.
--
xxxxxxxxxxxxxxxxxxxxxxxxx
R�my Maucherat
Developer & Consultant
JBoss Group (Europe) S�RL
xxxxxxxxxxxxxxxxxxxxxxxxx
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]