On 05/27/2011 03:38 PM, Caleb James DeLisle wrote:
Good report, thanks.
We define sql_mode to work around a hibernate bug: http://jira.xwiki.org/jira/browse/XWIKI-1945 http://opensource.atlassian.com/projects/hibernate/browse/HHH-468
It appears that our workaround has exposed us to a new mysql connector bug: http://bugs.mysql.com/bug.php?id=61201
From the connector bug report it says that 5.1.14 and 5.1.15 are unaffected so you could downgrade your connector version.
Caleb
Hi Caleb, I started to suspect the params in the hibernate config - and on Friday afternoon I changed the jdbc URL to read simply: <property name="connection.url">jdbc:mysql://localhost/testxwiki</property> Everything SEEMS to be working fine at this point - I'm not sure if I'll run in to any problems down the road by not specifying unicode or UTF-8 but it's just in test at the moment. I'll let the list know if I see anything. The general 'fix' for the 5.1.16 connector seems to be just simplify the connect URL. I'd be interested in knowing if anyone suspects future issues with what I've done. Cheers! Neil
On 05/26/2011 10:14 AM, Neil Streeter wrote:
Hi all,
I need help with installation...
I'm trying to get xwiki running on: RHEL 6 x64... JDK 6 latest... Mysql 5.1.52... Tomcat 7.0.14
I've followed the admin guide as near as possible... The deviations I've made are..
created my db as 'testxwiki' instead of just xwiki... modified xwiki.db=testxwiki (this was just a stab in the dark - not sure I need to change this) made appropriate modifications to the jdbc url in hibernate.cfg.xml...
I've varified that I can connect to the database using: mysql -uxwiki -psome_password testxwiki
and show tables returns the empty set... xwiki / hibernate is supposed to create the initial schema on startup right (less indexes)?
A more complete catalina.out snip is below but essentially I'm getting...
FATAL store.DBCPConnectionProvider - Could not create a DBCP pool. There is an error in the hibernate configuration file, please review it.
Unfortunately I have been through this file many many times... and I just don't see anything wrong with it...
I also get some interesting results when I stop tomcat after attempting to browse the xwiki site...
SEVERE: The web application [/xwiki] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/xwiki] appears to have started a thread named [EvictionTimer-0] but has failed to stop it. This is very likely to create a memory leak. May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/xwiki] appears to have started a thread named [EvictionTimer-1] but has failed to stop it. This is very likely to create a memory leak. May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/xwiki] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type [java.util.Hashtable] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/xwiki] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type [java.util.Hashtable] (value [{url=http://neil.nmc.edu:8080/xwiki/bin/view/Main/}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/xwiki] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type [java.util.Hashtable] (value [{url=http://neil.nmc.edu:8080/xwiki/bin/view/Main/}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Here's the gory details of everything I did (as well as I can remember)...
====
Installed the 64bit jdk from oracle..
java -version java version "1.6.0_25" Java(TM) SE Runtime Environment (build 1.6.0_25-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
====
Downloaded tomcat and installed it... tar -zxvf apache-tomcat-7.0.14.tar.gz
Modified the server.xml file and added: deployOnStartup="true" to the Host node
Modified catalina.sh and added: JAVA_HOME=/usr/local/jdk160_25 JAVA_OPTS="-Xmx512m -XX:MaxPermSize=128m"
Removed examples, host-manager, and manager from 'webapps'... I prefer not to leave them...
====
Started tomcat - at that point I could get to the ROOT application and browse the tomcat docs...
====
Installed mysql from RPM packages... Configured a few parameters in my.cnf...
default-storage-engine=INNODB innodb_file_per_table
skip-external-locking max_connections=200 read_buffer_size=1M sort_buffer_size=1M
key_buffer_size=128M
max_allowed_packet=32M
innodb_data_file_path = ibdata1:100M:autoextend
innodb_buffer_pool_size=256M innodb_additional_mem_pool_size=20M
innodb_log_file_size=64M innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1
====
Created the database and the user...
create database testxwiki default character set utf8; grant all privileges on testxwiki.* to xwiki@localhost identified by 'some_password'; flush privileges;
====
Extracted the war file to 'xwiki' inside of webapps...
Added mysql-connector-java-5.1.16-bin.jar to xwiki/WEB-INF/lib
====
Changed hibernate.cfg.xml by:
commenting out the hsqldb section... moved the comment tag for the mysql section up under the reference to xwiki-1945 Leaving the property and mapping nodes uncommented:
<property name="connection.url">jdbc:mysql://localhost/testxwiki?useServerPrepStmts=false&useUnicode=true&characterEncoding=UTF-8&sessionVariables=sql_mode=''</property> <property name="connection.username">xwiki</property> <property name="connection.password">some_password</property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property> <property name="connection.pool_size">2</property> <property name="statement_cache.size">2</property> <mapping resource="xwiki.hbm.xml"/> <mapping resource="feeds.hbm.xml"/> <mapping resource="activitystream.hbm.xml"/>
====
changed xwiki.cfg as follows:
diff xwiki.original xwiki.cfg 82c82 < # xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.xml ---
xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.xml 104c104 < # xwiki.db=xwiki
xwiki.db=testxwiki
DO I NEED TO CHANGE THE XWIKI.DB PROPERTY???
====
When I start tomcat and go to the xwiki site I get the following in catalina.out
STARTING TOMCAT...
May 26, 2011 2:02:57 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/local/jdk160_25/jre/lib/amd64/server:/usr/local/jdk160_25/jre/lib/amd64:/usr/local/jdk160_25/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib May 26, 2011 2:02:57 AM org.apache.coyote.AbstractProtocolHandler init INFO: Initializing ProtocolHandler ["http-bio-8080"] May 26, 2011 2:02:57 AM org.apache.coyote.AbstractProtocolHandler init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] May 26, 2011 2:02:57 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1213 ms May 26, 2011 2:02:57 AM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina May 26, 2011 2:02:57 AM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.14 May 26, 2011 2:02:57 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory xwiki May 26, 2011 2:02:59 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://jakarta.apache.org/struts/tags-html-1.0.2 is already defined May 26, 2011 2:02:59 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://jakarta.apache.org/struts/tags-bean-1.0.2 is already defined May 26, 2011 2:02:59 AM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://jakarta.apache.org/struts/tags-logic-1.0.2 is already defined May 26, 2011 2:03:09 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory docs May 26, 2011 2:03:09 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory ROOT May 26, 2011 2:03:09 AM org.apache.coyote.AbstractProtocolHandler start INFO: Starting ProtocolHandler ["http-bio-8080"] May 26, 2011 2:03:09 AM org.apache.coyote.AbstractProtocolHandler start INFO: Starting ProtocolHandler ["ajp-bio-8009"] May 26, 2011 2:03:09 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 12410 ms
BROWSE TO THE XWIKI APP....
2011-05-26 02:03:29,868 [/xwiki/bin/view/Main/] FATAL store.DBCPConnectionProvider - Could not create a DBCP pool. There is an error in the hibernate configuration file, please review it. org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unexpected exception encountered during query.) at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at com.xpn.xwiki.store.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:193) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:414) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298) at com.xpn.xwiki.store.XWikiHibernateBaseStore.initHibernate(XWikiHibernateBaseStore.java:166) at com.xpn.xwiki.store.XWikiHibernateBaseStore.checkHibernate(XWikiHibernateBaseStore.java:560) at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1073) at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeRead(XWikiHibernateBaseStore.java:1117) at com.xpn.xwiki.store.migration.hibernate.XWikiHibernateMigrationManager.getDBVersion(XWikiHibernateMigrationManager.java:68) at com.xpn.xwiki.store.migration.AbstractXWikiMigrationManager.<init>(AbstractXWikiMigrationManager.java:68) at com.xpn.xwiki.store.migration.hibernate.XWikiHibernateMigrationManager.<init>(XWikiHibernateMigrationManager.java:51) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.xpn.xwiki.XWiki.createClassFromConfig(XWiki.java:1132) at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:813) at com.xpn.xwiki.XWiki.<init>(XWiki.java:756) at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:408) at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:496) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:137) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:117) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:129) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:152) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:218) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.sql.SQLException: Unexpected exception encountered during query. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2665) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1698) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1617) at com.mysql.jdbc.ConnectionImpl.setSessionVariables(ConnectionImpl.java:5210) at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3375) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2385) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2154) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556) at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545) ... 64 more Caused by: java.lang.NullPointerException at com.mysql.jdbc.ConnectionImpl.getServerCharacterEncoding(ConnectionImpl.java:3100) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2095) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619) ... 83 more 2011-05-26 02:03:29,876 [/xwiki/bin/view/Main/] WARN action.RequestProcessor - Unhandled Exception thrown: class com.xpn.xwiki.XWikiException May 26, 2011 2:22:34 AM org.apache.catalina.core.StandardServer await
WHEN STOPPING TOMCAT....
INFO: A valid shutdown command was received via the shutdown port. Stopping the Server instance. May 26, 2011 2:22:34 AM org.apache.coyote.AbstractProtocolHandler pause INFO: Pausing ProtocolHandler ["http-bio-8080"] May 26, 2011 2:22:35 AM org.apache.coyote.AbstractProtocolHandler pause INFO: Pausing ProtocolHandler ["ajp-bio-8009"] May 26, 2011 2:22:36 AM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service Catalina May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/xwiki] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/xwiki] appears to have started a thread named [EvictionTimer-0] but has failed to stop it. This is very likely to create a memory leak. May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/xwiki] appears to have started a thread named [EvictionTimer-1] but has failed to stop it. This is very likely to create a memory leak. May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/xwiki] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type [java.util.Hashtable] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/xwiki] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type [java.util.Hashtable] (value [{url=http://neil.nmc.edu:8080/xwiki/bin/view/Main/}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/xwiki] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type [java.util.Hashtable] (value [{url=http://neil.nmc.edu:8080/xwiki/bin/view/Main/}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. May 26, 2011 2:22:37 AM org.apache.coyote.AbstractProtocolHandler stop INFO: Stopping ProtocolHandler ["http-bio-8080"] May 26, 2011 2:22:37 AM org.apache.coyote.AbstractProtocolHandler stop INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users