If those are the only services you are trying to add, I would suggest
using the commons-fileupload and commons-dbcp versions.

commons-fileupload is not released, but its base was the turbine
fileupload code and it likely contains bugfixes that are not in the 2.x
tree.  There has not been much change of the interfaces.

I'm not sure which version of the connection pool you are thinking of
using.  But if it is the turbine2.1 version, I would not use it outside
of using torque.  If you are talking about the latest versions which
implement the DataSource interface, there may be some benefit to using
them within the service framework, but if you are having problems with
getting that going, they are quite usable as simple components.

init()
{
TorqueDataSource tds = new TorqueDataSource();
tds.setMaxConnections(10);
...
}

public getConnection()
{
return tds.getConnection();
}

The latest dev version of dbcp contains a couple choices of DataSource
pools.  The released version contains BasicDataSource which is the
standard pool provided by tomcat via jndi.

john mcnally  


On Thu, 2003-01-09 at 09:06, Judd Wilcox wrote:
> Hi, all.
>     I'm attempting to add turbine functionality (specifically upload and 
> db connection pooling services) to a pre-existing servlet (compiled with 
> Java 1.4.1 and running in the tomcat 4.0 container) on a Win2KPro 
> machine. I've blown two days on this and I'm nearing the point where 
> I'll have to give up so I'm hoping I get jump start from more 
> experienced users.
>     So far I have:
> 
>    1. added to the servlet's init() method:
>       TurbineConfig tc = new
>       TurbineConfig("c:\\java\\tomcat\\4.0\\webapps\\PPQLSrv\\WEB-INF",
>       "conf/TurbineResources.properties");
>       tc.init();
>       (by the way, having to code the full path to a properties file
>       seems like a hack to me...;)
>    2. added .jar files to the servlet's classpath (by ensuring they land
>       in the .../WEB-INF/lib directory):
>       commons-configuration-1.0-dev.jar
>       commons-lang-1.0.jar
>       stratum-1.0-b3.jar
>       turbine-2.2.jar
>       All of these are taken from the tdk-2.2 distribution, so I don't
>       suspect a problem with version mismatches..
>    3. added the unmodified TurbineResources.properties (from the tdk-2.2
>       distribution in the tdk/ancillary/2/src/conf directory) to the
>       servlet's conf directory (by ensuring it lands in the
>       .../WEB-INF/conf directory).
>    4. Start tomcat 
> 
> I get the following .../WEB-INF/logs/turbine.log:
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- init
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- ServiceBroker: LoggingService 
> enabled.
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> ResourceService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> LoggingService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> ComponentService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> FactoryService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> PoolService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> RunDataService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> ServletService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> AssemblerBrokerService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> LocalizationService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> MimeTypeService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> GlobalCacheService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> SchedulerService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> XmlRpcService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> UniqueIdService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> UploadService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> SecurityService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> PoolBrokerService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> MapBrokerService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> PullService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> TemplateService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> XSLTService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Added Mapping for Service: 
> VelocityService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Initializing all services 
> using: org.apache.turbine.util.TurbineConfig
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Start Initializing service 
> (early): ResourceService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Finish Initializing service 
> (early): ResourceService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Start Initializing service 
> (early): LoggingService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Finish Initializing service 
> (early): LoggingService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Start Initializing service 
> (early): ComponentService
> [Thu Jan 09 10:53:35 CST 2003] -- INFO -- Turbine: init() failed: 
> java.lang.NullPointerException
>     at java.util.Hashtable.put(Hashtable.java:389)
>     at 
> 
>org.apache.commons.configuration.BaseConfiguration.addPropertyDirect(BaseConfiguration.java:248)
>     at 
> 
>org.apache.commons.configuration.BaseConfiguration.addProperty(BaseConfiguration.java:183)
>     at 
> 
>org.apache.turbine.services.component.TurbineComponentService.init(TurbineComponentService.java:153)
>     at 
> org.apache.turbine.services.TurbineBaseService.init(TurbineBaseService.java:108)
>     at 
> org.apache.turbine.services.BaseInitableBroker.initClass(BaseInitableBroker.java:149)
>     at 
> 
>org.apache.turbine.services.BaseServiceBroker.doInitService(BaseServiceBroker.java:224)
>     at 
> 
>org.apache.turbine.services.BaseServiceBroker.initServices(BaseServiceBroker.java:193)
>     at org.apache.turbine.Turbine.init(Turbine.java:257)
>     at javax.servlet.GenericServlet.init(GenericServlet.java:258)
>     at 
> org.apache.turbine.util.TurbineConfig.initialize(TurbineConfig.java:193)
>     at org.apache.turbine.util.TurbineConfig.init(TurbineConfig.java:179)
>     at com.lucent.fsmtools.PPQLSrv.init(Unknown Source)
>     at javax.servlet.GenericServlet.init(GenericServlet.java:258)
>     at 
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:918)
>     at 
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
>     at 
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3279)
>     at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:3421)
>     at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
>     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:478)
>     at org.apache.catalina.core.StandardHost.install(StandardHost.java:738)
>     at 
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:324)
>     at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
>     at 
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
>     at 
> 
>org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
>     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
>     at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
>     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
>     at 
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
>     at 
> org.apache.catalina.core.StandardService.start(StandardService.java:388)
>     at 
> org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
>     at 
> org.apache.catalina.startup.CatalinaService.start(CatalinaService.java:261)
>     at 
> org.apache.catalina.startup.CatalinaService.execute(CatalinaService.java:172)
>     at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:324)
>     at 
> org.apache.catalina.startup.BootstrapService.main(BootstrapService.java:428)
> 
> I'm stuck on the exception and would like help getting past it. Any help 
> offered to me (if it actually works) will be digested, tested, and 
> re-posted for other newcomers.
> Thanks.
> Judd Wilcox
> Lucent Technologies



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to