I have a website running on an Amazon EC2 Instance, and I'm trying to get Solr to interface and work with the database I'm using. I'm able to use the admin interface and have gotten the example xml files indexed, but whenever I try to import one of my database tables, I get the error
SEVERE: Exception while processing: gamelydb document : SolrInputDocument[{}]:org.apache.solr.handler.dataimport.DataImportHandlerException:
Unable to execute query: SELECT * FROM league Processing Document # 1
Here's my data-config.xml file. I also added the dataimporthandler to the solrconfig.xml file.
<dataConfig>
<dataSource type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://www.mysite.com/mydb"
user="root"
password="mypassword"/>
<document>
<entity name="mydb"
query="SELECT * FROM league">
<field column="id" name="id" />
<field column="leaguename" name="leaguename" />
</entity>
</document>
</dataConfig>
Any idea why this is happening? And just let me know if I need to clarify anything.
So I changed the url a bit and removed the 'http://' and that error seemed to go away. However none of the information seems to be searchable through the admin. There are now a few files in the data directory (_1.fnm, _1.frq,...). Here is what solr prints to the log.
Jul 13, 2011 1:19:45 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/dataimport params={} status=0 QTime=4
Jul 13, 2011 1:19:48 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/dataimport params={command=full-import} status=0 QTime=4
Jul 13, 2011 1:19:48 PM org.apache.solr.handler.dataimport.DataImporter doFullImport
INFO: Starting Full Import
Jul 13, 2011 1:19:48 PM org.apache.solr.handler.dataimport.SolrWriter readIndexerProperties
INFO: Read dataimport.properties
Jul 13, 2011 1:19:48 PM org.apache.solr.update.DirectUpdateHandler2 deleteAll
INFO: [] REMOVING ALL DOCUMENTS FROM INDEX
Jul 13, 2011 1:19:48 PM org.apache.solr.core.SolrDeletionPolicy onInit
INFO: SolrDeletionPolicy.onInit: commits:num=1
commit{dir=/home/ec2-user/public_html/solr/example/solr/data/index,segFN=segments_2,version=1310405039852,generation=2,filenames=[_0.tis, _0.nrm, _0.fnm, _0.tii, _0.frq, segments_2, _0.fdx, _0.fdt]
Jul 13, 2011 1:19:48 PM org.apache.solr.core.SolrDeletionPolicy updateCommits
INFO: newest commit = 1310405039852
Jul 13, 2011 1:19:48 PM org.apache.solr.handler.dataimport.JdbcDataSource$1 call
INFO: Creating a connection for entity gamelydb with URL: jdbc:mysql://www.gamely.us/gamelydb
Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.JdbcDataSource$1 call
INFO: Time taken for getConnection(): 667
Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.DocBuilder finish
INFO: Import completed successfully
Jul 13, 2011 1:19:49 PM org.apache.solr.update.DirectUpdateHandler2 commit
INFO: start commit(optimize=true,waitFlush=false,waitSearcher=true,expungeDeletes=false)
Jul 13, 2011 1:19:49 PM org.apache.solr.core.SolrDeletionPolicy onCommit
INFO: SolrDeletionPolicy.onCommit: commits:num=2
commit{dir=/home/ec2-user/public_html/solr/example/solr/data/index,segFN=segments_2,version=1310405039852,generation=2,filenames=[_0.tis, _0.nrm, _0.fnm, _0.tii, _0.frq, segments_2, _0.fdx, _0.fdt]
commit{dir=/home/ec2-user/public_html/solr/example/solr/data/index,segFN=segments_3,version=1310405039855,generation=3,filenames=[_1.fdx, _1.tis, _1.frq, _1.fdt, _1.tii, _1.fnm, _1.nrm, segments_3]
Jul 13, 2011 1:19:49 PM org.apache.solr.core.SolrDeletionPolicy updateCommits
INFO: newest commit = 1310405039855
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher <init>
INFO: Opening Searcher#1c4795e main
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming Searcher#1c4795e main from Searcher#1d38b87 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming result for Searcher#1c4795e main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming Searcher#1c4795e main from Searcher#1d38b87 main
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming result for Searcher#1c4795e main
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming Searcher#1c4795e main from Searcher#1d38b87 main
queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=1,evictions=0,size=1,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming result for Searcher#1c4795e main
queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming Searcher#1c4795e main from Searcher#1d38b87 main
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming result for Searcher#1c4795e main
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.core.QuerySenderListener newSearcher
INFO: QuerySenderListener sending requests to Searcher#1c4795e main
Jul 13, 2011 1:19:49 PM org.apache.solr.core.QuerySenderListener newSearcher
INFO: QuerySenderListener done.
Jul 13, 2011 1:19:49 PM org.apache.solr.update.DirectUpdateHandler2 commit
INFO: end_commit_flush
Jul 13, 2011 1:19:49 PM org.apache.solr.core.SolrCore registerSearcher
INFO: [] Registered new searcher Searcher#1c4795e main
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher close
INFO: Closing Searcher#1d38b87 main
fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=1,evictions=0,size=1,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.SolrWriter readIndexerProperties
INFO: Read dataimport.properties
Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.SolrWriter persist
INFO: Wrote last indexed time to /home/ec2-user/public_html/solr/example/solr/./conf/dataimport.properties
Jul 13, 2011 1:19:49 PM org.apache.solr.update.processor.LogUpdateProcessor finish
INFO: {deleteByQuery=*:*,add=[9, 10, 11, 12, 13, 14],optimize=} 0 4
Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.DocBuilder execute
INFO: Time taken = 0:0:1.66
EDIT: If you find something on here that's downvotable, please just let me know so I can fix it.
I think the problem is with the url parameter.
If the MySQL database is on the same machine, then use url="jdbc:mysql://localhost/mydb"
If its on www.mysite.com, then use url="jdbc:mysql://www.mysite.com/mydb"
Also, your log files may have more details regarding the error - please go through the logs and post the appropriate entries here.
I faced a similar problem. My database is on the same machine.
In data-config.xml, I changed the line:
url="jdbc:mysql://localhost/mydb"
to
url="jdbc:mysql://127.0.0.1/mydb"
and then things worked. Strange are the ways of Solr/Lucene!
You can try doing oone of the following troubleshotting:
Use url="jdbc:mysql://localhost:1433/mydb in case the sqlDB was installed on the same machine.
Check the Tomcat folder for errors (Catalina file).
Enable the auditing on the database level and check the logs on it.
Related
This is the error I am getting I am using Gradle as build tool I have tried all the solutions
on internet
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version name: Apache Tomcat/9.0.27
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Oct 7 2019 09:57:22 UTC
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version number: 9.0.27.0
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 5.0.0-32-generic
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Private Build
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:
/home/sudarshan/work/.metadata/.plugins/org.eclipse.wst.server.core/tmp1
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /home/sudarshan/Downloads/apache-tomcat-9.0.27
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -
Dcatalina.base=/home/sudarshan/work/.metadata/.plugins/org.eclipse.wst.server.core/tmp1
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/home/sudarshan/Downloads/apache-tomcat-9.0.27
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -
Dwtp.deploy=/home/sudarshan/work/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/
wtpwebapps
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/home/sudarshan/Downloads/apache-tomcat-
9.0.27/endorsed
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF-8
Oct 24, 2019 3:01:35 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path:
[/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-
gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
Oct 24, 2019 3:01:35 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-2016"]
Oct 24, 2019 3:01:35 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Oct 24, 2019 3:01:35 PM org.apache.catalina.startup.Catalina load
INFO: Server initialization in [549] milliseconds
Oct 24, 2019 3:01:35 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Oct 24, 2019 3:01:35 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet engine: [Apache Tomcat/9.0.27]
Oct 24, 2019 3:01:36 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Oct 24, 2019 3:01:37 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for
this logger for a complete list of JARs that were scanned but no TLDs were found in them.
Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Oct 24, 2019 3:01:37 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class
[org.springframework.web.context.ContextLoaderListener]
java.lang.NoClassDefFoundError:
Lorg/springframework/beans/factory/access/BeanFactoryReference;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:110)
at org.apache.catalina.core.DefaultInstanceManager.populateAnnotationsCache
(DefaultInstanceManager.java:402)
at
org.apache.catalina.core.DefaultInstanceManager.newInstance
(DefaultInstanceManager.java:173)
at org.apache.catalina.core.DefaultInstanceManager.newInstance
(DefaultInstanceManager.java:151)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4607)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5146)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
org.apache.tomcat.util.threads.InlineExecutorService.execute
(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute
(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
Caused by: java.lang.ClassNotFoundException:
org.springframework.beans.factory.access.BeanFactoryReference
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
... 37 more
Oct 24, 2019 3:01:37 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Oct 24, 2019 3:01:37 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate
container log file
Oct 24, 2019 3:01:37 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/HibernateTemplate] startup failed due to previous errors
Oct 24, 2019 3:01:37 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Oct 24, 2019 3:01:37 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for
this logger for a complete list of JARs that were scanned but no TLDs were found in them.
Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Oct 24, 2019 3:01:37 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Oct 24, 2019 3:01:37 PM org.springframework.web.context.ContextLoader
initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Oct 24, 2019 3:01:37 PM org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Thu Oct 24 15:01:37 IST 2019];
root of context hierarchy
Oct 24, 2019 3:01:38 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-core-
config.xml]
Oct 24, 2019 3:01:38 PM org.springframework.web.context.ContextLoader
initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 188 ms
Oct 24, 2019 3:01:38 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'springDispatcherServlet'
Oct 24, 2019 3:01:38 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'springDispatcherServlet': initialization started
Oct 24, 2019 3:01:38 PM org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'springDispatcherServlet-servlet':
startup date [Thu Oct 24 15:01:38 IST 2019]; parent: Root WebApplicationContext
Oct 24, 2019 3:01:38 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-mvc-
config.xml]
Oct 24, 2019 3:01:38 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
registerHandler
INFO: Root mapping to handler 'homeController'
Oct 24, 2019 3:01:38 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'springDispatcherServlet': initialization completed in 425 ms
Oct 24, 2019 3:01:38 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-2016"]
Oct 24, 2019 3:01:38 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Oct 24, 2019 3:01:38 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in [2,794] milliseconds
This is my build.gradle where I have added required dependencies
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'war'
id 'org.gretty' version '2.3.1'
}
repositories {
jcenter()
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile
classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile
classpath.
implementation 'com.google.guava:guava:28.0-jre'
// https://mvnrepository.com/artifact/org.springframework/spring-web
compile group: 'org.springframework', name: 'spring-web', version: '4.3.13.RELEASE'
// https://mvnrepository.com/artifact/org.springframework/spring-webmvc
compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.14.RELEASE'
// https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1'
// https://mvnrepository.com/artifact/javax.servlet/jstl
compile group: 'javax.servlet', name: 'jstl', version: '1.2'
// https://mvnrepository.com/artifact/mysql/mysql-connector-java
compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.13'
// https://mvnrepository.com/artifact/org.springframework/spring-jdbc
compile group: 'org.springframework', name: 'spring-jdbc', version: '5.1.5.RELEASE'
// https://mvnrepository.com/artifact/org.springframework/spring-beans
compile group: 'org.springframework', name: 'spring-beans', version: '5.1.5.RELEASE'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
This is my spring-core-config.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
</beans>
This is my spring-mvc-config.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:component-scan base-package="HibernateTemplate"></context:component-scan>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
</bean>
<bean id="ds" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql://localhost:3306/userdb"></property>
<property name="username" value="root"></property>
<property name="password" value="password"></property>
</bean>
<bean id="jt" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="ds"></property>
</bean>
<bean id="dao" class="HibernateTemplate.StudentDao">
<property name="template" ref="jt"></property>
</bean>
</beans>
This is my web.xml
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-
app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>web application</display-name>
<!-- The front controller of this Spring Web application, responsible for handling all
application requests -->
<servlet>
<servlet-name>springDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-mvc-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map all requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>springDispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-core-config.xml</param-value>
</context-param>
</web-app>
This is my index.jsp
<%# page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
Add Employee
<!-- View Employees -->
</body>
</html>
studform.jsp file where I have created form to take values.
<%# page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
Add Employee
<!-- View Employees -->
</body>
</html>
index.jsp page
<%# page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
Add Employee
<!-- View Employees -->
</body>
</html>
Student.java class
package HibernateTemplate;
public class Student {
private int id;
private String name;
private String email;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
StudentController class
package HibernateTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import HibernateTemplate.Student;
import HibernateTemplate.StudentDao;
#Controller
public class StudentController {
#Autowired
StudentDao dao;
/*It displays a form to input data, here "command" is a reserved request attribute
which is used to display object data into form */
#RequestMapping("/studform")
public String showform(Model m){
m.addAttribute("command", new Student());
return "studform";
}
/*It saves object into database. The #ModelAttribute puts request data into model object.
*You need to mention RequestMethod.POST method
because default request is GET*/
#RequestMapping(value="/save",method = RequestMethod.POST)
public String save(#ModelAttribute("std") Student std){
dao.save(std);
return "save"; //will redirect to viewemp request mapping
}
}
StudentDao class
package HibernateTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
public class StudentDao {
JdbcTemplate template;
public void setTemplate(JdbcTemplate template) {
this.template = template;
}
public int save(Student s){
String sql="insert into student(id,name,email)
values('"+s.getId()+"',"+s.getName()+",'"+s.getEmail()+"')";
return template.update(sql);
}
}
I just needs to connect with database so that I can go ahead and do further operations, also
you can recommend me book where I can learn spring MVC using gradle as there is no gradle
stuff available on internet.
Try by removing this from <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> from <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">. I think this unnecessarily used. This may cause problem.
Updated bean should look like this :
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
</bean>
I 've tried several editions but NOT use. I need to resolve this part to continue the project .
The hibernate is not generating the tables in the database, I can not find where the error is.
The code is:
package br.com.evolutionary.modelo;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
#Entity
public class Pokemon {
#Id
#GeneratedValue
private Long id;
#Column
private String nome;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
}
The persistence is:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="evolutionary"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/evolutionary" />
<property name="hibernate.connection.driver" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="12345" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="update" />
</properties>
</persistence-unit>
The pom.xml is:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com</groupId>
<artifactId>evolutionary</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.1.0.Final</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
The output log tomcat is:
mai 12, 2016 7:30:03 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
ADVERTÊNCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:evolutionary' did not find a matching property.
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server version: Apache Tomcat/8.0.33
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server built: Mar 18 2016 20:31:49 UTC
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server number: 8.0.33.0
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Name: Linux
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Version: 4.4.0-21-generic
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Architecture: amd64
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Version: 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Vendor: Oracle Corporation
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_BASE: /home/douglas/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_HOME: /opt/apache-tomcat-8.0.33
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.base=/home/douglas/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.home=/opt/apache-tomcat-8.0.33
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dwtp.deploy=/home/douglas/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=/opt/apache-tomcat-8.0.33/endorsed
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dfile.encoding=UTF-8
mai 12, 2016 7:30:03 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFORMAÇÕES: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
mai 12, 2016 7:30:03 AM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["http-nio-8080"]
mai 12, 2016 7:30:03 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMAÇÕES: Using a shared selector for servlet write/read
mai 12, 2016 7:30:03 AM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["ajp-nio-8009"]
mai 12, 2016 7:30:03 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMAÇÕES: Using a shared selector for servlet write/read
mai 12, 2016 7:30:03 AM org.apache.catalina.startup.Catalina load
INFORMAÇÕES: Initialization processed in 623 ms
mai 12, 2016 7:30:03 AM org.apache.catalina.core.StandardService startInternal
INFORMAÇÕES: Starting service Catalina
mai 12, 2016 7:30:03 AM org.apache.catalina.core.StandardEngine startInternal
INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/8.0.33
mai 12, 2016 7:30:06 AM org.apache.jasper.servlet.TldScanner scanJars
INFORMAÇÕES: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
mai 12, 2016 7:30:06 AM com.sun.faces.config.ConfigureListener contextInitialized
INFORMAÇÕES: Inicializando Mojarra 2.2.13 ( 20160203-1910 unable to get svn info) para o contexto '/evolutionary'
mai 12, 2016 7:30:06 AM com.sun.faces.spi.InjectionProviderFactory createInstance
INFORMAÇÕES: JSF1048: Anotações PostConstruct/PreDestroy presentes. Os métodos ManagedBeans marcados com essas anotações informarão as anotações processadas.
mai 12, 2016 7:30:07 AM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFORMAÇÕES: Running on PrimeFaces 5.3
mai 12, 2016 7:30:07 AM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["http-nio-8080"]
mai 12, 2016 7:30:07 AM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["ajp-nio-8009"]
mai 12, 2016 7:30:07 AM org.apache.catalina.startup.Catalina start
INFORMAÇÕES: Server startup in 4132 ms
Can anyone help?
Check if persistence.xml is residing in the Meta-INF folder.
In thsi case I guess, Persistence.xml is not getting loaded on the application startup.
Also check whether you are calling Persistence.createEntityManagerFactory(persistantUnitName) in your code.
Please take a look at Hibernate EntityManager documentation below for getting idea on configuration and bootstrapping :
https://docs.jboss.org/hibernate/entitymanager/3.5/reference/en/html/configuration.html
I'm experimenting with standalone JPA and JTA / XA transaction management provided by Atomikos.
My simple unit test persists 3 records, wrapped in a JTA UserTransaction.
When using H2 as backing database, the test works fine.
When using MySQL as the backing database, the second persist throws this exception:
com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_INVAL: Invalid arguments (or unsupported command)
(see full stack trace and logging below). The log file gives more detail:
WARNING: XA resource 'jdbc/mysqlDs': resume for XID '3139322E3136382E31342E3131372E746D30303030323030303831:3139322E3136382E31342E3131372E746D32' raised -5: invalid arguments were given for the XA operation
If I leave only a single persist in the test, it succeeds. The same test also succeeds when using H2 instead of MySQL.
So question: what could be the cause of the exception in the case of MySQL?
Here is the main test code from JtaJpaMySQLAtomikosTest.java:
#Test
public void testSingleCommitMySql() throws Exception {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("javaee7.standalone.jta.pu_mysql");
EntityManager em = emf.createEntityManager();
UserTransaction userTransaction = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
userTransaction.begin();
em.joinTransaction();
em.persist(new TestEntity("FOO", "A"));
em.persist(new TestEntity("BAR", "B"));
em.persist(new TestEntity("BAZ", "C"));
em.flush();
userTransaction.commit();
TypedQuery<TestEntity> query = em.createQuery("SELECT b FROM TestEntity b WHERE name = :name", TestEntity.class)
.setParameter("name", "FOO");
assertEquals("A", query.getSingleResult().getValue());
em.close();
emf.close();
}
If you need the full test code, let me know.
Here's the relevant portion of the logging + exception:
INFO: AtomikosDataSoureBean 'jdbc/mysqlDs': getConnection ( null )...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: AtomikosDataSoureBean 'jdbc/mysqlDs': init...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: calling getAutoCommit...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: calling getMetaData...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: calling createStatement...
Apr 28, 2016 12:34:57 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000396: Updating schema
Apr 28, 2016 12:34:57 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: twophasepoc.testentity
Apr 28, 2016 12:34:57 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [name, id, value]
Apr 28, 2016 12:34:57 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: []
Apr 28, 2016 12:34:57 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [primary]
Apr 28, 2016 12:34:57 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000232: Schema update complete
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: calling getWarnings...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: calling clearWarnings...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: close()...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: createCompositeTransaction ( 10000 ): created new ROOT transaction with id 192.168.14.117.tm0000200081
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: registerSynchronization ( com.atomikos.icatch.jta.Sync2Sync#4e517165 ) for transaction 192.168.14.117.tm0000200081
Hibernate:
insert
into
TestEntity
(name, value)
values
(?, ?)
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: AtomikosDataSoureBean 'jdbc/mysqlDs': getConnection ( null )...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: AtomikosDataSoureBean 'jdbc/mysqlDs': init...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: addParticipant ( XAResourceTransaction: 3139322E3136382E31342E3131372E746D30303030323030303831:3139322E3136382E31342E3131372E746D32 ) for transaction 192.168.14.117.tm0000200081
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: XAResource.start ( 3139322E3136382E31342E3131372E746D30303030323030303831:3139322E3136382E31342E3131372E746D32 , XAResource.TMNOFLAGS ) on resource jdbc/mysqlDs represented by XAResource instance com.mysql.jdbc.jdbc2.optional.JDBC4MysqlXAConnection#16ecee1
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: registerSynchronization ( com.atomikos.jdbc.AtomikosConnectionProxy$JdbcRequeueSynchronization#35a707b3 ) for transaction 192.168.14.117.tm0000200081
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: calling prepareStatement(insert into TestEntity (name, value) values (?, ?),1)...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: isClosed()...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: calling getWarnings...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: calling clearWarnings...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: atomikos connection proxy for com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper#1bb266b3: close()...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: XAResource.end ( 3139322E3136382E31342E3131372E746D30303030323030303831:3139322E3136382E31342E3131372E746D32 , XAResource.TMSUCCESS ) on resource jdbc/mysqlDs represented by XAResource instance com.mysql.jdbc.jdbc2.optional.JDBC4MysqlXAConnection#16ecee1
Hibernate:
insert
into
TestEntity
(name, value)
values
(?, ?)
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: AtomikosDataSoureBean 'jdbc/mysqlDs': getConnection ( null )...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: AtomikosDataSoureBean 'jdbc/mysqlDs': init...
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: addParticipant ( XAResourceTransaction: 3139322E3136382E31342E3131372E746D30303030323030303831:3139322E3136382E31342E3131372E746D32 ) for transaction 192.168.14.117.tm0000200081
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: XAResource.start ( 3139322E3136382E31342E3131372E746D30303030323030303831:3139322E3136382E31342E3131372E746D32 , XAResource.TMJOIN ) on resource jdbc/mysqlDs represented by XAResource instance com.mysql.jdbc.jdbc2.optional.JDBC4MysqlXAConnection#16ecee1
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logWarning
WARNING: XA resource 'jdbc/mysqlDs': resume for XID '3139322E3136382E31342E3131372E746D30303030323030303831:3139322E3136382E31342E3131372E746D32' raised -5: invalid arguments were given for the XA operation
com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_INVAL: Invalid arguments (or unsupported command)
at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.mapXAExceptionFromSQLException(MysqlXAConnection.java:581)
at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.dispatchCommand(MysqlXAConnection.java:566)
at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.start(MysqlXAConnection.java:507)
at com.atomikos.datasource.xa.XAResourceTransaction.resume(XAResourceTransaction.java:427)
at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.<init>(BranchEnlistedStateHandler.java:59)
at com.atomikos.datasource.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(NotInBranchStateHandler.java:64)
at com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(TransactionContext.java:88)
at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:179)
at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:223)
at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:142)
at com.sun.proxy.$Proxy12.prepareStatement(Unknown Source)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:124)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:122)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.prepare(IdentityGenerator.java:89)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:55)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3556)
at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:97)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:480)
at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:191)
at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:175)
at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:210)
at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:324)
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288)
at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:194)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:125)
at org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:84)
at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:206)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:149)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:75)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:807)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:780)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:785)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1181)
at JtaJpaMySQLAtomikosTest.testSingleCommitMySql(JtaJpaMySQLAtomikosTest.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.sql.SQLException: XAER_INVAL: Invalid arguments (or unsupported command)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2478)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2625)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2547)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2505)
at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:840)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:740)
at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.dispatchCommand(MysqlXAConnection.java:560)
... 60 more
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logWarning
WARNING: Error enlisting in transaction - connection might be broken? Please check the logs for more information...
com.atomikos.datasource.ResourceException: XA resource 'jdbc/mysqlDs': resume for XID '3139322E3136382E31342E3131372E746D30303030323030303831:3139322E3136382E31342E3131372E746D32' raised -5: invalid arguments were given for the XA operation
at com.atomikos.datasource.xa.XAResourceTransaction.resume(XAResourceTransaction.java:434)
at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.<init>(BranchEnlistedStateHandler.java:59)
at com.atomikos.datasource.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(NotInBranchStateHandler.java:64)
at com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(TransactionContext.java:88)
at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:179)
at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:223)
at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:142)
at com.sun.proxy.$Proxy12.prepareStatement(Unknown Source)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:124)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:122)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.prepare(IdentityGenerator.java:89)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:55)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3556)
at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:97)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:480)
at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:191)
at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:175)
at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:210)
at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:324)
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288)
at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:194)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:125)
at org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:84)
at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:206)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:149)
at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:75)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:807)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:780)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:785)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1181)
at JtaJpaMySQLAtomikosTest.testSingleCommitMySql(JtaJpaMySQLAtomikosTest.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Apr 28, 2016 12:34:57 PM com.atomikos.logging.JULLogger logInfo
INFO: setRollbackOnly() called for transaction 192.168.14.117.tm0000200081
Here's the persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1">
<persistence-unit name="javaee7.standalone.jta.pu_mysql" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/mysqlDs</jta-data-source>
<class>TestEntity</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.jta.platform" value="AtomikosJtaPlatform"/>
</properties>
</persistence-unit>
</persistence>
The is could be for MySQL server limitation of XA support, https://dev.mysql.com/doc/refman/5.5/en/xa-statements.html
Also might be for the known problem of atomikos https://www.atomikos.com/Documentation/KnownProblems#ActiveMQ_error:_34Transaction_39XID:..._39_has_not_been_started_34
this could be a solution https://www.atomikos.com/Documentation/NonXaDataSource
Refer to geert3 comment below for more specific solution.
Following links can be explored
https://community.oracle.com/thread/2326795
http://fogbugz.atomikos.com/default.asp?community.6.3215.2
pinGlobalTxToPhysicalConnection=true solved my problem. Although I have not set com.atomikos.icatch.serial_jta_transactions=false as I was not sure how to set this in Spring Boot.
For those who are looking how to set pingGlobalTxToPhysicalConnection property, it needs to be appended to connection string like below
jdbc:mariadb://localhost:3306/MYDB?pinGlobalTxToPhysicalConnection=true
i am having trouble here at my work trying to setup Orbeon to use relational databases running on tomcat and mysql.
So i am an as3 programmer that makes games and doing this is quite difficult for me.
I've setup Orbeon forms already, i have a mysql server running, now i have to link it to tomcat and orbeon.
(im running ubuntu servere)
I have apache tomcat 7,
orbeon form 4.10 PE .
Mysql (lastest (?))
This is my server.xml
<Resource name="jdbc/mysql"
auth="Container"
type="javax.sql.DataSource"
initialsize="3"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/?useUnicode=true& amp;characterEncoding=UTF8"
maxActive="15"
maxIdle="20"
maxWait="30000"
username="root"
password="orbeonadmin2015"
/>
my "catalina.out"
sep 07, 2015 12:22:05 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:05 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:06 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:06 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:06 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:06 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:08 PM org.apache.coyote.AbstractProtocol init
INFORMACIÓN: Initializing ProtocolHandler ["http-bio-8080"]
sep 07, 2015 12:22:08 PM org.apache.catalina.startup.Catalina load
INFORMACIÓN: Initialization processed in 1780 ms
sep 07, 2015 12:22:08 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
ADVERTENCIA: maxIdle is larger than maxActive, setting maxIdle to: 15
sep 07, 2015 12:22:09 PM org.apache.catalina.core.StandardService startInternal
INFORMACIÓN: Arrancando servicio Catalina
sep 07, 2015 12:22:09 PM org.apache.catalina.core.StandardEngine startInternal
INFORMACIÓN: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
sep 07, 2015 12:22:09 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFORMACIÓN: Desplieque del descriptor de configuración /etc/tomcat7/Catalina/localhost/examples.xml
sep 07, 2015 12:22:10 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFORMACIÓN: Desplieque del descriptor de configuración /etc/tomcat7/Catalina/localhost/host-manager.xml
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFORMACIÓN: Desplieque del descriptor de configuración /etc/tomcat7/Catalina/localhost/docs.xml
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFORMACIÓN: Desplieque del descriptor de configuración /etc/tomcat7/Catalina/localhost/manager.xml
sep 07, 2015 12:22:12 PM org.apache.catalina.startup.HostConfig deployWAR
INFORMACIÓN: Despliegue del archivo /var/lib/tomcat7/webapps/orbeon.war de la aplicación web
sep 07, 2015 12:22:23 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
GRAVE: Unable to create initial connections of pool.
java.sql.SQLException
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:486)
at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
at org.apache.tomcat.jdbc.pool.DataSourceFactory.createDataSource(DataSourceFactory.java:554)
at org.apache.tomcat.jdbc.pool.DataSourceFactory.getObjectInstance(DataSourceFactory.java:242)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:141)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at org.apache.naming.NamingContext.lookup(NamingContext.java:842)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.NamingContext.lookup(NamingContext.java:830)
at org.apache.naming.NamingContext.lookup(NamingContext.java:167)
at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1091)
at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:670)
at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:269)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:246)
... 32 more
sep 07, 2015 12:22:23 PM org.apache.naming.NamingContext lookup
ADVERTENCIA: Excepción inesperada resolviendo referencia
java.sql.SQLException
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:486)
at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
at org.apache.tomcat.jdbc.pool.DataSourceFactory.createDataSource(DataSourceFactory.java:554)
at org.apache.tomcat.jdbc.pool.DataSourceFactory.getObjectInstance(DataSourceFactory.java:242)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:141)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at org.apache.naming.NamingContext.lookup(NamingContext.java:842)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.NamingContext.lookup(NamingContext.java:830)
at org.apache.naming.NamingContext.lookup(NamingContext.java:167)
at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1091)
at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:670)
at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:269)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:246)
... 32 more
sep 07, 2015 12:22:23 PM org.apache.catalina.core.NamingContextListener addResource
ADVERTENCIA: No pude registrar en JMX: javax.naming.NamingException
Starting Orbeon Forms 4.10.0.201508261723 PE
Initializing Resource Manager with: {oxf.resources.priority.2.oxf.resources.webapp.rootdir=/WEB-INF/resources, org.orbeon.oxf.resources.WebAppResourceManagerImplWebAppContext=org.orbeon.oxf.webapp.ServletWebAppContext#2f4be7b5, oxf.resources.factory=org.orbeon.oxf.resources.PriorityResourceManagerFactory, oxf.resources.priority.2=org.orbeon.oxf.resources.WebAppResourceManagerFactory, oxf.resources.priority.4=org.orbeon.oxf.resources.ClassLoaderResourceManagerFactory}
Using run mode: prod
Using properties file: oxf:/config/properties-prod.xml
This installation of Orbeon Forms 4.10.0.201508261723 PE is licensed to: Leandro / MIW / leandrom#makeitwork.com.uy and expires on 2015-12-02
log4j:ERROR setFile(null,false) call failed.
java.io.FileNotFoundException: ../logs/orbeon.log (No existe el archivo o el directorio)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:142)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:295)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)
at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)
at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:492)
at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1006)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:887)
at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:704)
at org.orbeon.oxf.util.LoggerFactory.initLogger(LoggerFactory.java:95)
at org.orbeon.oxf.webapp.Orbeon$.initialize(Orbeon.scala:81)
at org.orbeon.oxf.webapp.OrbeonWebApp$$anonfun$1.apply(WebAppContext.scala:117)
at org.orbeon.oxf.webapp.OrbeonWebApp$$anonfun$1.apply(WebAppContext.scala:117)
at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:194)
at org.orbeon.oxf.webapp.ParametersAndAttributes$$anon$1.getOrElseUpdate(WebAppContext.scala:93)
at org.orbeon.oxf.webapp.OrbeonWebApp$class.$init$(WebAppContext.scala:117)
at org.orbeon.oxf.webapp.ServletWebAppContext.<init>(WebAppContext.scala:122)
at org.orbeon.oxf.webapp.WebAppContext$.apply(WebAppContext.scala:167)
at org.orbeon.oxf.pipeline.InitUtils$.runWithServletContext(InitUtils.scala:170)
at org.orbeon.oxf.webapp.OrbeonServletContextListener$$anonfun$contextInitialized$1.apply$mcV$sp(OrbeonServletContextListener.scala:40)
at org.orbeon.oxf.webapp.OrbeonServletContextListener$$anonfun$contextInitialized$1.apply(OrbeonServletContextListener.scala:40)
at org.orbeon.oxf.webapp.OrbeonServletContextListener$$anonfun$contextInitialized$1.apply(OrbeonServletContextListener.scala:40)
at org.orbeon.oxf.util.ScalaUtils$.withRootException(ScalaUtils.scala:83)
at org.orbeon.oxf.webapp.OrbeonServletContextListener.contextInitialized(OrbeonServletContextListener.scala:39)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
sep 07, 2015 12:22:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMACIÓN: Despliegue del directorio /var/lib/tomcat7/webapps/ROOT de la aplicación web
sep 07, 2015 12:22:29 PM org.apache.coyote.AbstractProtocol start
INFORMACIÓN: Starting ProtocolHandler ["http-bio-8080"]
sep 07, 2015 12:22:29 PM org.apache.catalina.startup.Catalina start
INFORMACIÓN: Server startup in 20949 ms
And another log:
GRAVE: La aplicación web [/orbeon] parece haber arrancado un hilo llamado [Abandoned connection cleanup thread] pero no ha podido pararlo. Esto tiene todas las papeletas de convertirse en un fallo de memoria.
sep 07, 2015 12:22:03 PM org.apache.coyote.AbstractProtocol stop
INFORMACIÓN: Stopping ProtocolHandler ["http-bio-8080"]
sep 07, 2015 12:22:03 PM org.apache.coyote.AbstractProtocol destroy
INFORMACIÓN: Destroying ProtocolHandler ["http-bio-8080"]
sep 07, 2015 12:22:05 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:05 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:06 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:06 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:06 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:06 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
ADVERTENCIA: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
sep 07, 2015 12:22:08 PM org.apache.coyote.AbstractProtocol init
INFORMACIÓN: Initializing ProtocolHandler ["http-bio-8080"]
sep 07, 2015 12:22:08 PM org.apache.catalina.startup.Catalina load
INFORMACIÓN: Initialization processed in 1780 ms
sep 07, 2015 12:22:08 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
ADVERTENCIA: maxIdle is larger than maxActive, setting maxIdle to: 15
sep 07, 2015 12:22:09 PM org.apache.catalina.core.StandardService startInternal
INFORMACIÓN: Arrancando servicio Catalina
sep 07, 2015 12:22:09 PM org.apache.catalina.core.StandardEngine startInternal
INFORMACIÓN: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
sep 07, 2015 12:22:09 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFORMACIÓN: Desplieque del descriptor de configuración /etc/tomcat7/Catalina/localhost/examples.xml
sep 07, 2015 12:22:10 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.TaglibUriRule body
INFORMACIÓN: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFORMACIÓN: Desplieque del descriptor de configuración /etc/tomcat7/Catalina/localhost/host-manager.xml
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFORMACIÓN: Desplieque del descriptor de configuración /etc/tomcat7/Catalina/localhost/docs.xml
sep 07, 2015 12:22:11 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFORMACIÓN: Desplieque del descriptor de configuración /etc/tomcat7/Catalina/localhost/manager.xml
sep 07, 2015 12:22:12 PM org.apache.catalina.startup.HostConfig deployWAR
INFORMACIÓN: Despliegue del archivo /var/lib/tomcat7/webapps/orbeon.war de la aplicación web
sep 07, 2015 12:22:23 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
GRAVE: Unable to create initial connections of pool.
java.sql.SQLException
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:486)
at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
at org.apache.tomcat.jdbc.pool.DataSourceFactory.createDataSource(DataSourceFactory.java:554)
at org.apache.tomcat.jdbc.pool.DataSourceFactory.getObjectInstance(DataSourceFactory.java:242)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:141)
at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1091)
at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:670)
at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:269)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:246)
... 32 more
sep 07, 2015 12:22:23 PM org.apache.naming.NamingContext lookup
ADVERTENCIA: Excepción inesperada resolviendo referencia
java.sql.SQLException
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
I'm at a loss for a solution. I've been playing with Spring MVC and Hibernate, and I had established a connection with my database, pulling data, no problem.
I added an #Entity, and maybe done some other changes, and now Hibernate won't do anything. By anything, I mean there is no SQL executed (as shown in the tomcat logs, using the show-sql option of hibernate). There is also no exceptions thrown at all, and Hibernate even tells me it has updated the DB schema (which it has not, since no tables have been created.).
I have checked that the getAllArticles() method gets called during runtime using a debugger.
I really don't know what to check now, if someone has any idea I'll be grateful forever.
My servlet config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<mvc:resources location="/resources/" mapping="/resources/**" />
<mvc:annotation-driven />
<context:component-scan base-package="com.last" />
<tx:annotation-driven transaction-manager="transactionManager" />
<bean
class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://10.0.0.2/lastDB" />
<property name="username" value="dbuser" />
<property name="password" value="dbpass" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="packagesToScan" value="com.test" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
The entity:
package com.last.entities;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
#Entity
#Table(name = "ARTICLE")
public class Article {
private int id;
private String content;
private User author;
#Id
#GeneratedValue
#Column(name = "ARTICLE_ID")
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
#Column(name = "CONTENT", length=10000)
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
#ManyToOne
#Column(name="AUTHOR")
#JoinColumn(name = "USER_USER_ID")
public User getAuthor() {
return author;
}
public void setAuthor(User user) {
this.author = user;
}
}
The DAO:
package com.last.dao;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.last.entities.Article;
import com.last.entities.User;
import com.last.exceptions.DAOException;
#SuppressWarnings("unchecked")
#Component
#Transactional(readOnly = true)
public class DAOImpl implements DAO {
#Autowired
SessionFactory sessionFactory;
private Session currentSession() {
return sessionFactory.getCurrentSession();
}
#Override
public List<User> getUserList() {
return currentSession().createCriteria(User.class).list();
}
#Override
public User getUserByID(int id) {
User result = (User) currentSession().createCriteria(User.class)
.add(Restrictions.eq("id", id)).uniqueResult();
if (result == null) {
throw new DAOException(DAOException.NO_RESULT);
} else {
return result;
}
}
#Override
public List<Article> getAllArticles() {
return currentSession().createCriteria(Article.class).list();
}
}
Tomcat's Log:
avr. 22, 2013 4:39:10 PM 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: C:\Program Files\Java\jdk1.7.0_15\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\Programmes\LaTeX\MikTeX\miktex\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Haskell\bin;D:\Programming Stuff\Haskell\2010.2.0.0\lib\extralibs\bin;D:\Programming Stuff\Haskell\2010.2.0.0\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\GTK2-Runtime\bin;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;D:\Programmes\PostgreSQL\bin;C:\Program Files\Calibre2\;F:\RailsInstaller\Git\cmd;F:\RailsInstaller\Ruby1.9.2\bin;D:\Programming Stuff\RailsInstaller\Git\cmd;D:\Programming Stuff\RailsInstaller\Ruby1.9.2\bin;F:\Web Server\wamp\ruby\bin;C:\Program Files\Java\jdk1.7.0_02\bin;D:\Programmes\NetBeans\ant\apache-ant-1.8.4\bin;C:\Program Files (x86)\OpenVPN\bin;.
avr. 22, 2013 4:39:11 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
avr. 22, 2013 4:39:11 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
avr. 22, 2013 4:39:11 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1055 ms
avr. 22, 2013 4:39:11 PM org.apache.catalina.core.StandardService startInternal
INFO: Démarrage du service Catalina
avr. 22, 2013 4:39:11 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.37
avr. 22, 2013 4:39:12 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [128] milliseconds.
avr. 22, 2013 4:39:12 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Déploiement du descripteur de configuration D:\Programming Stuff\Projects\FinalTest\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\Last.xml
avr. 22, 2013 4:39:12 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Last' did not find a matching property.
avr. 22, 2013 4:39:15 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
avr. 22, 2013 4:39:15 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
avr. 22, 2013 4:39:15 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
avr. 22, 2013 4:39:15 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Mon Apr 22 16:39:15 CEST 2013]; root of context hierarchy
avr. 22, 2013 4:39:15 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/last-servlet.xml]
avr. 22, 2013 4:39:16 PM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
INFO: Bean 'dataSource' of type [class org.apache.commons.dbcp.BasicDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
avr. 22, 2013 4:39:16 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
avr. 22, 2013 4:39:16 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.2.0.Final}
avr. 22, 2013 4:39:16 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
avr. 22, 2013 4:39:16 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
avr. 22, 2013 4:39:17 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
avr. 22, 2013 4:39:17 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
avr. 22, 2013 4:39:17 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
avr. 22, 2013 4:39:17 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
avr. 22, 2013 4:39:17 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: HHH000227: Running hbm2ddl schema export
avr. 22, 2013 4:39:17 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: HHH000230: Schema export complete
avr. 22, 2013 4:39:17 PM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
INFO: Bean 'sessionFactory' of type [class org.springframework.orm.hibernate4.LocalSessionFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
avr. 22, 2013 4:39:17 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#1312f348: defining beans [org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,mainController,DAOImpl,serviceImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0,dataSource,sessionFactory,transactionManager,org.springframework.web.servlet.view.InternalResourceViewResolver#0,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
avr. 22, 2013 4:39:17 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
avr. 22, 2013 4:39:17 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.last.controllers.MainController.showHomePage(java.util.Map<java.lang.String, java.lang.Object>)
avr. 22, 2013 4:39:18 PM org.springframework.orm.hibernate4.HibernateTransactionManager afterPropertiesSet
INFO: Using DataSource [org.apache.commons.dbcp.BasicDataSource#6192fb7a] of Hibernate SessionFactory for HibernateTransactionManager
avr. 22, 2013 4:39:18 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 3389 ms
avr. 22, 2013 4:39:18 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'last'
avr. 22, 2013 4:39:18 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'last': initialization started
avr. 22, 2013 4:39:18 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'last-servlet': startup date [Mon Apr 22 16:39:18 CEST 2013]; parent: Root WebApplicationContext
avr. 22, 2013 4:39:18 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/last-servlet.xml]
avr. 22, 2013 4:39:18 PM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
INFO: Bean 'dataSource' of type [class org.apache.commons.dbcp.BasicDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
avr. 22, 2013 4:39:18 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
avr. 22, 2013 4:39:18 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
avr. 22, 2013 4:39:18 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
avr. 22, 2013 4:39:18 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
avr. 22, 2013 4:39:18 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: HHH000227: Running hbm2ddl schema export
avr. 22, 2013 4:39:18 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: HHH000230: Schema export complete
avr. 22, 2013 4:39:18 PM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
INFO: Bean 'sessionFactory' of type [class org.springframework.orm.hibernate4.LocalSessionFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
avr. 22, 2013 4:39:18 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#1b2cc445: defining beans [org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,mainController,DAOImpl,serviceImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0,dataSource,sessionFactory,transactionManager,org.springframework.web.servlet.view.InternalResourceViewResolver#0,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory#1312f348
avr. 22, 2013 4:39:18 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
avr. 22, 2013 4:39:18 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.last.controllers.MainController.showHomePage(java.util.Map<java.lang.String, java.lang.Object>)
avr. 22, 2013 4:39:18 PM org.springframework.orm.hibernate4.HibernateTransactionManager afterPropertiesSet
INFO: Using DataSource [org.apache.commons.dbcp.BasicDataSource#1583f012] of Hibernate SessionFactory for HibernateTransactionManager
avr. 22, 2013 4:39:19 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'last': initialization completed in 503 ms
avr. 22, 2013 4:39:19 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
avr. 22, 2013 4:39:19 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
avr. 22, 2013 4:39:19 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7587 ms
Thank you !
Could be copy-paste, but your hibernate session factory bean is scanning com.test for hibernate entities instead of com.last.