tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadzim Radchykau <v_radchy...@adamantium.net>
Subject Re: Tomcat 8
Date Tue, 03 Feb 2015 11:13:42 GMT
1. Attached file stack.txt
2. version 8.0.18

2015-02-03 14:01 GMT+03:00 Konstantin Kolinko <knst.kolinko@gmail.com>:

> 2015-02-03 12:44 GMT+03:00 Vadzim Radchykau <v_radchykau@adamantium.net>:
> > Hello, everybody! I have a question about context config in Tomcat 8. I
> > migrating project from Tomcat 7 to 8 and have unusual problem: if nothing
> > change in cofig I catched an error:
> > "2015-02-03 12:05:48,310 FIRST_ADMIN ERROR web.context.ContextLoader:331
> >  -> Context initialization failed
> > org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to
> > register MBean [org.apache.tomcat.dbcp.dbcp2.BasicDataSource@434990dd]
> with
> > key 'dataSource'; nested exception is
> > javax.management.InstanceAlreadyExistsException:
> >
> Catalina:type=DataSource,host=localhost,context=/first-admin,class=javax.sql.DataSource,name="jdbc/datasource/first"
> >
> > Part of context:
> > <Resource name="jdbc/datasource/first"
> >               auth="Container"
> >               type="javax.sql.DataSource"
> >               poolPreparedStatements="true"
> >               initialSize="25"
> >               maxActive="100"
> >               maxIdle="100"
> >               minIdle="25"
> >               username="us"
> >               password="pa"
> >               driverClassName="com.mysql.jdbc.Driver"
> >               validationQuery="select 1"
> >               testOnBorrow="true"
> >
> >
> url="jdbc:mysql://localhost:3306/firstproject?useUnicode=true&amp;characterEncoding=UTF-8&amp;profileSQL=false&amp;autoSlowLog=false&amp;slowQueryThresholdMillis=100&amp;autoReconnect=true"/>
> >
> > So, it's works in tomcat 7 without any proble. In Tomcat 8 I can solve
> this
> > problem in 2 ways:
> > 1. By adding to resource: singleton = "false";
> > 2. By adding to resource:
> > factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
> >
> > If I clearly understand tomcat creates datasource for my app and for jmx,
> > but in Tomcat 7 it was single object, in Tomcat 8 it must be differents.
> So
> > my question is why that situation is happend? I coudn't find any
> > information of this change in documentation. And I'm interesting what is
> > better: create single datasource (I think so) or create several by
> factory.
> > Thanks a lot for help!
>
>
> 1. Full stacktrace of javax.management.InstanceAlreadyExistsException =?
>
> 2. Exact version of Tomcat 8.0.x = ?  I suspect that you are using
> some old version, as the last time I remember hearing about similar
> issues was ~2 years ago.
>
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 


[image: Adamantium]

*Vadim Radchikov | Software Engineer*
*mob:* +375 29 3300032   *skype:* vadzimik
*email:* *v_radchykau@adamantium.net* <name@adamantium.net>

Mime
View raw message