I'm getting an error when trying to deploy content to an oracle broker database (I'm running Tridion 2011 sp1). I've had a search on the SDL Tridion forum and cannot find anyone that's had the same issue.
The error message in the cme is:
Committing Deployment Failed
Phase: Deployment Prepare Commit Phase failed, Unable to prepare transaction: tcm:0-55-66560,
org.hibernate.exception.SQLGrammarException: could not execute query,
org.hibernate.exception.SQLGrammarException: could not execute query, Unable to prepare transaction:
tcm:0-55-66560, org.hibernate.exception.SQLGrammarException: could not execute query,
org.hibernate.exception.SQLGrammarException: could not execute query
And in the deployer logs i get the following:
2012-02-24 15:07:27,866 WARN DeployPipelineExecutor - Phase: Deployment Prepare Commit Phase failure message: Unable to prepare transaction: tcm:0-55-66560, org.hibernate.exception.SQLGrammarException: could not execute query, org.hibernate.exception.SQLGrammarException: could not execute query for transaction: tcm:0-55-66560
2012-02-24 15:07:27,866 DEBUG DeployPipelineExecutor - Failure in Phase: Deployment Prepare Commit Phase attempt: 11 for transaction: tcm:0-55-66560
2012-02-24 15:07:27,866 ERROR DeployPipelineExecutor - Final attempt in Phase: Deployment Prepare Commit Phase failed for transaction: tcm:0-55-66560
2012-02-24 15:07:27,875 ERROR DeployPipelineExecutor - Original stacktrace for transaction: tcm:0-55-66560
com.tridion.deployer.ProcessingException: Unable to prepare transaction: tcm:0-55-66560, org.hibernate.exception.SQLGrammarException: could not execute query, org.hibernate.exception.SQLGrammarException: could not execute query
at com.tridion.deployer.phases.PreCommitPhase.handleFailure(PreCommitPhase.java:120) ~[cd_deployer.jar:na]
at com.tridion.deployer.phases.PreCommitPhase.execute(PreCommitPhase.java:101) ~[cd_deployer.jar:na]
at com.tridion.deployer.phases.DeployPipelineExecutor.runMainExecutePhase(DeployPipelineExecutor.java:186) [cd_deployer.jar:na]
at com.tridion.deployer.phases.DeployPipelineExecutor.doExecute(DeployPipelineExecutor.java:97) [cd_deployer.jar:na]
at com.tridion.deployer.phases.DeployPipelineExecutor.execute(DeployPipelineExecutor.java:61) [cd_deployer.jar:na]
at com.tridion.deployer.TransactionManager.handleDeployPackage(TransactionManager.java:80) [cd_deployer.jar:na]
at com.tridion.deployer.queue.QueueLocationHandler$1.run(QueueLocationHandler.java:176) [cd_deployer.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) [na:1.5.0_11]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) [na:1.5.0_11]
at java.util.concurrent.FutureTask.run(FutureTask.java:123) [na:1.5.0_11]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) [na:1.5.0_11]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) [na:1.5.0_11]
at java.lang.Thread.run(Thread.java:595) [na:1.5.0_11]
2012-02-24 15:07:27,875 INFO TransactionPersistence - Removing deployment transaction information: tcm:0-55-66560
2012-02-24 15:07:27,876 ERROR DeployPipelineExecutor - Unable to start processing deployment package with transactionId: tcm:0-55-66560
2012-02-24 15:07:27,880 DEBUG DeployPipelineExecutor - Checking if transaction is completed: tcm:0-55-66560 is true
2012-02-24 15:07:27,880 INFO DeployPipelineExecutor - Transaction is completed: tcm:0-55-66560
2012-02-24 15:07:27,882 INFO DeployPipelineExecutor - Finished executing deployment pipeline for: tcm:0-55-66560 in 2274 ms.
EDIT:
Here is the node from the cd_storage_conf.xml file:
<Storages>
<Storage Type="persistence" Id="ddeploy" dialect="ORACLESQL" Class="com.tridion.storage.persistence.JPADAOFactory">
<Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
<DataSource Class="oracle.jdbc.pool.OracleDataSource">
<Property Name="driverType" Value="thin"/>
<Property Name="networkProtocol" Value="tcp"/>
<Property Name="serverName" Value="secret"/>
<Property Name="portNumber" Value="1526"/>
<Property Name="databaseName" Value="secret"/>
<Property Name="user" Value="secret"/>
<Property Name="password" Value="secret"/>
</DataSource>
</Storage>
<Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory" Id="defaultFile" defaultFilesystem="false">
<Root Path="/htdocs/en_US/" />
</Storage>
<Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory" Id="defaultDataFile" defaultFilesystem="true" defaultStorage="true">
<Root Path="/htdocs/en_US/data" />
</Storage>
</Storages>
And the item types
<ItemTypes defaultStorageId="ddeploy" cached="false">
<Item typeMapping="Page" cached="false" storageId="defaultFile"/>
<Item typeMapping="Binary" cached="false" storageId="defaultFile"/>
</ItemTypes>
Any help would be greatly appreciated.
Doh! - I can confirm the issue here was that the oracle database user did not have access to the correct schema.
Still if anyone searches here for the same issue, they'll know the correct place to look :)
The error message indicates that the SQL query generated by hibernate doesn't execute properly on your database. Can you double check your storage config (perhaps post the <Storage/> element here. In particular, can you check that the dialect attribute is correct.
Related
We have a setup where we use SonarQube with Ant and connect to SonarCloud (https://sonarcloud.io). This setup was always working from local developer machine and also from bitbucket pipelines. Since two days, we have been getting below error on local and bitbucket pipelines. Below is the stacktrace:
Project.sonar:
[sonar:sonar] Apache Ant(TM) version 1.10.5 compiled on July 10 2018
[sonar:sonar] SonarQube Ant Task version: 2.5
[sonar:sonar] Loaded from: file:<redacted_path>/sonarqube-ant-task-2.5.jar
[sonar:sonar] User cache: /Users/<user>/.sonar/cache
BUILD FAILED
<redacted_path>/build-sonar.xml:120: java.lang.IllegalStateException: not started
at org.sonarsource.scanner.api.EmbeddedScanner.checkLauncherExists(EmbeddedScanner.java:244)
at org.sonarsource.scanner.api.EmbeddedScanner.stop(EmbeddedScanner.java:164)
at org.sonarsource.scanner.ant.SonarQubeTask.launchAnalysis(SonarQubeTask.java:101)
at org.sonarsource.scanner.ant.SonarQubeTask.execute(SonarQubeTask.java:81)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:834)
at org.apache.tools.ant.Main.startAnt(Main.java:223)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Below is the command that we use for running sonar:
ant compile Project.sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=<org_name> -Dsonar.login=<token_which_has_all_privs>
We have tried changing the sonar.login token with a new one (thinking that old might have expired) but it didn't work with new one also.
I am not able to find any help anywhere else regarding this error since it does not say much. I see other errors like "WebApp did not start" but that seems to be related to the use case where SonarQube is running on local. But in our case we are connecting to https://sonarcloud.io host. We have also tried with sonar.login and sonar.password and it still fails.
Any help would be appreciated.
Update 1 for mc1arke question Is this sufficient? I can create a new basic build-sonar.xml and provide it but it will only have below content and some properties/variables specific for our environment.
Extract from build-sonar.xml looks as below:
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<classpath>
<pathelement location="${lib.dir}/sonarqube-ant-task-2.5.jar"/>
</classpath>
</taskdef>
<target name="Project.sonar">
<property name="sonar.projectKey" value="ProjectKey" />
<property name="sonar.projectName" value="ProjectName" />
<property name="sonar.projectVersion" value="1.0" />
<property name="sonar.sources" value="${src.dir}" />
<property name="sonar.binaries" value="${build.dir}" />
<property name="sonar.java.binaries" value="${build.dir}" />
<property name="sonar.java.libraries" value="${lib.dir}/*.jar"/>
<property name="sonar.java.test.libraries" value="${lib.dir}/*.jar"/>
<property name="sonar.java.source" value="1.8" />
<property name="sonar.exclusions" value="<some modules>"/>
<property name="sonar.jacoco.reportPath" value="${junit.reports}/coverage/jacoco.exec"/>
<property name="sonar.junit.reportsPath" value="${junit.reports}" />
<property name="sonar.jacoco.itReportPath" value="${junit.reports}/coverage/jacoco-it.exec"/>
<property name="sonar.coverage.exclusions" value="<some modules>"/>
<sonar:sonar/>
</target>
Update 2: I looked at the sonar code in EmbeddedScanner.java, IsolatedLauncherFactory.java, and IsolatedLauncherProxy.java which actually should be throwing the error. I also ran the ant command in -v mode and below is the output of it:
Project.sonar:
[antlib:org.sonar.ant] Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.
[sonar:sonar] Apache Ant(TM) version 1.10.5 compiled on July 10 2018
[sonar:sonar] SonarQube Ant Task version: 2.5
[sonar:sonar] Loaded from: file:<redacted_path>/sonarqube-ant-task-2.5.jar
[sonar:sonar] keyStore is :
[sonar:sonar] keyStore type is : jks
[sonar:sonar] keyStore provider is :
[sonar:sonar] init keystore
[sonar:sonar] init keymanager of type SunX509
[sonar:sonar] User cache: /Users/<user.name>/.sonar/cache
[sonar:sonar] Extract sonar-scanner-api-batch in temp...
[sonar:sonar] Get bootstrap index...
[sonar:sonar] Download: https://sonarcloud.io/batch_bootstrap/index
[sonar:sonar] Get bootstrap completed
So looking at the code and its output I think below is the code flow:
EmbeddedScanner.checkLauncherExists() --> IsolatedLauncherFactory.createLauncher() --> JarDownloader.download() --> JarDownloader.getScannerEngineFiles() --> BootstrapIndexDownloader.getIndex()
From the log, it seems that the index was returned successfully. But either the JarDownloader.getScannerEngineFiles() or JarDownloader.download() failed because the log statement logger.debug("Create isolated classloader..."); right after List<File> jarFiles = jarDownloader.download() in IsolatedLauncherFactory.createLauncher() is not printed.
Reference: Sonar source code available here
Your issue is that sonar-ant-plugin does not seem to support SonarCloud. The plugin depends on an old version of sonar-scanner-api which attempts to retrieve a list of Jars to download by retrieving /batch_bootstrap/index from the remote SonarQube server. SonarCloud doesn't provide such a URL, but does have /bootstrap/index which newer versions of sonar-scanner-api do use.
Update: version 2.6.0.1426 of the scanner for Ant has been released to fix the issue.
I installed sldap on my ubuntu 12.04 system.https://help.ubuntu.com/community/OpenLDAPServer
I can add /search records to lsdap from terminal.e.g. I can add ldif file.
ldapadd -x -D cn=admin,dc=test,dc=com -W -f ldap-add.ldif
and it ask me password .I entered pass000 and it added new entry.its working fine .i can add search records from terminal. Now I tried It from my spring application .i added dependency ldap-core to my pom .i set up bean etc. every thing is fine except it gives me error in valid credetials thouh I entered same as I entered while ading ldif file from terminal. My bean configuration is
<!-- ldap template -->
<ldap:context-source id="contextSource" url="ldap://localhost:389"
base="dc=test,dc=com" username="cn=admin" password="pass000" />
<ldap:ldap-template id="ldapTemplate"
context-source-ref="contextSource" />
<bean id="personDao" class="com.cheasyy.cofinding.dao.PersonDaoImpl">
<property name="ldapTemplate" ref="ldapTemplate" />
</bean>
It gives error
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.ldap.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:205)
com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:266)
root cause
org.springframework.ldap.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:191)
org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:356)
org.springframework.ldap.core.support.AbstractContextSource.doGetContext(AbstractContextSource.java:140)
If with same credentials I can add ldif file from terminal then why not with my spring application?is their anything missing in configuration?
The 'username' DN needs to be the full DN of the admin user, including the base; in your case:
<ldap:context-source id="contextSource" url="ldap://localhost:389"
base="dc=test,dc=com" username="cn=admin,dc=test,dc=com" password="pass000" />
It's not uncommon for the admin user to be located in a different part of the LDAP tree than the base DN from which you want your operations to originate.
The goal is to have a J2EE application running on a WebsphereApplicationServer 7, which accesses a JDBC datasource (DB2) via OpenJPA 2.0. On most of our testservers, my code is working fine; however, we have one testserver where the EntityManager aborts / does not get initialized properly because of a stale connection ("java.net.SocketException: Broken pipe"):
<openjpa-2.1.2-SNAPSHOT-r422266:1384519 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Failed to execute query "select count(x.profSurname) from Surname x where x.profUsrstate = 0". Check the query syntax for correctness. See nested exception for details.
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:872)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:315)
at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:331)
at org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:359)
(...)
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: [jcc][t4][2030][11211][4.13.127] A communication error occurred during operations on the connection's underlying socket, socket input stream,
or socket output stream. Error location: T4Agent.sendRequest() - flush (-1). Message: Broken pipe. ERRORCODE=-4499, SQLSTATE=08001 {prepstmnt 1826931080 SELECT COUNT(t0.PROF_SURNAME) FROM EMPINST.SURNAME t0 WHERE (t0.PROF_USRSTATE = CAST(? AS BIGINT)) optimize for 1 row [params=?]} [code=-4499, state=08001]
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:281)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:265)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:72)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1183)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:284)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1787)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:274)
at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:499)
at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:424)
at com.ibm.ws.persistence.jdbc.sql.SelectImpl.execute(SelectImpl.java:89)
at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:391)
at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427)
at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.open(QueryImpl.java:2070)
at org.apache.openjpa.kernel.QueryImpl.singleResult(QueryImpl.java:1320)
at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1242)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
... 113 more
---- Begin backtrace for Nested Throwables
com.ibm.websphere.ce.cm.StaleConnectionException: [jcc][t4][2030][11211][4.13.127] A communication error occurred during operations on the connection's underlying socket, socket input stream,
or socket output stream. Error location: T4Agent.sendRequest() - flush (-1). Message: Broken pipe. ERRORCODE=-4499, SQLSTATE=08001
at sun.reflect.GeneratedConstructorAccessor91.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:527)
at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapExceptionHelper(GenericDataStoreHelper.java:607)
at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapException(GenericDataStoreHelper.java:666)
at com.ibm.ws.rsadapter.AdapterUtil.mapException(AdapterUtil.java:2271)
at com.ibm.ws.rsadapter.jdbc.WSJdbcUtil.mapException(WSJdbcUtil.java:1185)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeQuery(WSJdbcPreparedStatement.java:726)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:286)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1181)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:284)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1787)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:274)
at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:499)
at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:424)
at com.ibm.ws.persistence.jdbc.sql.SelectImpl.execute(SelectImpl.java:89)
at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:391)
at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427)
at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
(...)
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:103)
at java.net.SocketOutputStream.write(SocketOutputStream.java:147)
at com.ibm.db2.jcc.t4.fb.b(fb.java:1685)
at com.ibm.db2.jcc.t4.fb.a(fb.java:1633)
at com.ibm.db2.jcc.t4.a.D(a.java:421)
... 138 more
I am working with OpenJPA using the Springframework 3.0 JpaTransactionManager and LocalContainerEntityManagerFactory to get my persistence context:
<tx:annotation-driven transaction-manager="lctxManager" />
<bean id="lctxManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="lcentityManagerFactory"></property>
</bean>
<bean id="lcentityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="activities"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter">
<property name="showSql" value="false"></property>
</bean>
</property>
</bean>
The persistence.xml is as follows:
<persistence-unit name="activities" transaction-type="RESOURCE_LOCAL">
<non-jta-data-source>jdbc/activities</non-jta-data-source>
<!-- My classes -->
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="openjpa.TransactionMode" value="local" />
</properties>
I need to restart the server on which the application runs for the Exception to vanish again -- before it (randomly?) pops up again.
On googling the problem, I found a site that mentioned it was faulty code (no commit on transactions) that causes the problem: http://mikeschubert.com/2006/08/03/javanetsocketex/
However, I am under the impression that the JPATransactionManager is supposed to take care of that.
Other websites mentioned that implementing a connection pool would help (when using Hibernate in communication with a Tomcat-server, e.g. elegantly handling stale database connections in Hibernate/Spring Transactions); however, the Websphere Application Server already manages a connections pool for the jdbc/activities datasource (minSize: 1; maxSize: 10; Connection timeout: 180 sec; Reap time: 180sec; Unused timeout: 1800 sec, Purge policy: FailingConnectionOnly).
Any hints on where I should start looking into the problem would be great.
There is a possibility that if you don't set DB2COMM registry variable then communication error might happen.
DB2COMM should be set to TCPIP.
I have installed the TeamCity build agent on my machine a few different ways- using Java Web Start and the manual .zip distribution. Both result in viable installations, as I have once or twice been able to connect and register properly with the TeamCity server. However, upon restarting (<install_location>/bin/agent.sh stop...<install_location>/bin/agent.sh start) I get the following error in teamcity-agent.log (with extra debugging turned on in the log4j config file).
[2013-04-03 09:05:09,870] DEBUG - jetbrains.buildServer.XMLRPC - faultStringjava.lang.RuntimeException: org.jdom.input.JDOMParseException: Error on line 28: XML document structures must start and end within the same entity.faultCode0
[2013-04-03 09:05:09,878] DEBUG - buildServer.AGENT.registration - jetbrains.buildServer.xmlrpc.RemoteCallException: Call http://teamcityserver:8080/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: org.jdom.input.JDOMParseException: Error on line 28: XML document structures must start and end within the same entity.
jetbrains.buildServer.xmlrpc.RemoteCallException: Call http://teamcityserver:8080/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: org.jdom.input.JDOMParseException: Error on line 28: XML document structures must start and end within the same entity.
at jetbrains.buildServer.xmlrpc.AbstractXmlRpcTarget.call(AbstractXmlRpcTarget.java:94)
at jetbrains.buildServer.agent.impl.ServerXmlRpcProxy.registerAgent3(ServerXmlRpcProxy.java:62)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.doRegisterOnBuildServer(BuildAgentImpl.java:776)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.registerOnBuildServer(BuildAgentImpl.java:748)
at jetbrains.buildServer.agent.impl.ServerMonitor.run(ServerMonitor.java:71)
Caused by: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: org.jdom.input.JDOMParseException: Error on line 28: XML document structures must start and end within the same entity.
at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeException(XmlRpcClientResponseProcessor.java:104)
at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeResponse(XmlRpcClientResponseProcessor.java:71)
at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:73)
at org.apache.xmlrpc.TCXmlRpcClient$1.execute(TCXmlRpcClient.java:89)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178)
at jetbrains.buildServer.xmlrpc.impl.CommonsXmlRpcTargetImpl$1.execute(CommonsXmlRpcTargetImpl.java:72)
at jetbrains.buildServer.xmlrpc.AbstractXmlRpcTarget.call(AbstractXmlRpcTarget.java:84)
... 4 more
[2013-04-03 09:05:09,878] WARN - buildServer.AGENT.registration - Call http://teamcityserver:8080/RPC2 buildServer.registerAgent3: org.apache.xmlrpc.XmlRpcException: java.lang.RuntimeException: org.jdom.input.JDOMParseException: Error on line 28: XML document structures must start and end within the same entity.
[2013-04-03 09:05:09,878] WARN - buildServer.AGENT.registration - Connection to TeamCity server is probably lost. Will be trying to restore it. Take a look at logs/teamcity-agent.log for details (unless you're using custom logging).
This is the xml in question according to the logs with extra xmlrpc debugging:
<?xml version="1.0"?><methodCall><methodName>buildServer.registerAgent3</methodName><params><param><value><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<agentDetails agentName="aaronhbox_0" agentPort="9090" authToken="" osName="Linux, version 3.5.0-17-generic">
<alternativeAddresses>
<address>10.2.1.232</address>
<address>192.168.225.1</address>
<address>192.168.80.1</address>
</alternativeAddresses>
<availableRunners>
<runner runType="Ant" />
<runner runType="Duplicator" />
<runner runType="gradle-runner" />
<runner runType="Inspection" />
<runner runType="Ipr" />
<runner runType="JPS" />
<runner runType="Maven2" />
<runner runType="rake-runner" />
<runner runType="simpleRunner" />
</availableRunners>
<availableVcs>
<vcs name="perforce" />
<vcs name="mercurial" />
<vcs name="jetbrains.git" />
<vcs name="svn" />
<vcs name="cvs" />
</availableVcs>
<buildParameters>
<param name="env.COLORTERM" value="gnome-terminal" />
<param name="env.COMP_WORDBREAKS"><![CDATA["'><;|]]></value></param></params></methodCall>
Only once have I been able to restart the agent and have it connect again properly. Generally, I can install it, have it run once, then restarting it gives this error. Any ideas?
It looks like the formatting of the COMP_WORDBREAKS environment variable was messing with the xml structure and not allowing the complete generation of the xml request message.
The COMP_WORDBREAKS value on my machine is "'><;|&(:.
Placing the following line in the buildAgent.properties file fixed this problem and allows the agent to properly register.
env.COMP_WORDBREAKS=
I don't see any side-effects yet of making this change; the agent now seems to behave properly.
Folks,
My Issue
Why is an HSQLDB file-based database I have pre-populated with a schema and data not populated when I connect to it later?
I think I'm missing some small, but HUGELY IMPORTANT configuration.
My Environment
HSQLDB setup with the Maven Sql plugin and Maven Liquibase plugin.
Spring / Hibernate Webapp
Steps to Populate the Database and Run the App
Run the Sql Maven plugin to create 3 schemas in the HSQL database
Run the Maven liquibase plugin, populating with ddl and lookup data
The jdbc url I'm using within Maven to setup hsql is: jdbc:hsqldb:file:${project.basedir}/target/db/build;shutdown=true.
It translates to: jdbc:hsqldb:file:/Users/myHomeDir/work/myProj/target/db/build;shutdown=true
I have confirmed the the hsql database files are created and populated -- insert statements in the build.script file are present as expected. I can connect to the database using RazorSQL and see the data and tables present.
Running the App
I've configured my DataSource in my Spring config as follows:
<bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource">
<property name="driverClassName" value="org.hsqldb.jdbcDriver" />
<property name="url" value="jdbc:hsqldb:file:/Users/myHomeDir/work/myProj/target/db/build;shutdown=true" />
<property name="username" value="sa" />
<property name="password" value="" />
I've fired up the app and see that Hibernate/Spring makes the connection to the database. A database.lck file is created so I know the app has made a connection. (Also, I've ensured that RazorSQL is shutdown and not using the database at the same time).
The Error
The error indicates that the database entities don't exist:
[INFO] Started Jetty Server
Hibernate:
select
this_.id as id5_2_,
this_.created_date as created2_5_2_,
this_.creating_user_id as creating3_5_2_,
this_.email as email5_2_,
this_.first_name as first5_5_2_,
this_.is_enabled as is6_5_2_,
this_.last_login_date as last7_5_2_,
this_.last_modified_date as last8_5_2_,
this_.last_modifying_user_id as last9_5_2_,
this_.last_name as last10_5_2_,
this_.login as login5_2_,
this_.middle_initial as middle12_5_2_,
this_.password_hash as password13_5_2_,
this_.password_history as password14_5_2_,
this_.suffix as suffix5_2_,
roles2_.user_id as user1_5_4_,
role3_.id as role2_4_,
role3_.id as id3_0_,
role3_.code as code3_0_,
role3_.description as descript3_3_0_,
role3_.name as name3_0_,
role3_.type_id as type5_3_0_,
roletype4_.id as id4_1_,
roletype4_.description as descript2_4_1_
from
security.user this_
left outer join
security.user_role roles2_
on this_.id=roles2_.user_id
left outer join
security.role role3_
on roles2_.role_id=role3_.id
left outer join
security.role_type roletype4_
on role3_.type_id=roletype4_.id
where
this_.login=?
[01/20/2012 17:30:18,440] WARN : org.hibernate.util.JDBCExceptionReporter - SQL Error: -5501, SQLState: 42501
[01/20/2012 17:30:18,440] ERROR: org.hibernate.util.JDBCExceptionReporter - user lacks privilege or object not found: USER
2012-01-20 17:30:18.443:WARN::/my-webapp/j_spring_security_check
org.hibernate.exception.SQLGrammarException: could not execute query
Just to make sure, can't it be caused by conflict of table name (USER) with SQL keyword?
Try to use different table name instead, or at least configure Hibernate to escape it (#Table(name = "\"user\"")).