Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ant "deploy" task is broken #5304

Closed
unoexperto opened this issue Apr 3, 2014 · 8 comments
Closed

Ant "deploy" task is broken #5304

unoexperto opened this issue Apr 3, 2014 · 8 comments

Comments

@unoexperto
Copy link

Ant "deploy" task is broken.

Error output:


BUILD FAILED
C:\work\sideprojects\dotCMS\build.xml:199: Problem: failed to create task or type if
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Total time: 5 seconds

I'm using Ant 1.8.4 and Java 8

@unoexperto unoexperto changed the title and "deploy" task is broken Ant "deploy" task is broken Apr 3, 2014
@unoexperto
Copy link
Author

Guys, you need to specify in your installation guide that your ant script has dependency on ANT Contrib. I wasted 20 mins on googling.

@jtesser
Copy link
Contributor

jtesser commented Apr 3, 2014

In 3.0 you can just use gradle and it solves that for you. The error in ant does tell you but sorry you ran into this.

@jtesser jtesser closed this as completed Apr 3, 2014
@unoexperto
Copy link
Author

I used ant because that's what it says in your guide: http://dotcms.com/docs/latest/InstallingFromGit

By the way while we're on topic. Could you please tell me why there is no /tomcat subfolder in git root ?

@jtesser
Copy link
Contributor

jtesser commented Apr 3, 2014

you are working in master and master is NOT released yet. It is 3.0 and will be released at a later time this year. The doc will be updated as it is released. In master there is no tomcat you have to build the distro and such.

If you are just trying to run the latest I suggest using our nightly builds http://dotcms.com/download/nightly.dot
OR you can use our tasks to run deploy-war-tomcat7 which will check out tomcat an place a directory up

In master you can also just replace ANT with ./gradlew

Maybe you should work in master-2.5 If you are trying to develop

@unoexperto
Copy link
Author

I'll be brutally honest, Jason. I'm choosing between number of Java-based CMS (Hippo, Magnolia, dotCMS) and it's second day I have hard time to get even demo installation running. I tried official 2.5.4 zip first which failed with gazzilion of exceptions. Then I decided to do hard way and build everything myself.

On the other hand "master" version:

  1. "war" ant task doesn't include context.xml with db connection string.
  2. cannot find dotmarketing-config.properties if path contains spaces
  3. jdbc drivers are not supplied (in theory ant task can fetch them as it does with tomcat in deploy-war-tomcat7)
  4. fails with another exception which I'm yet to fix
 java.lang.Error: java.io.FileNotFoundException: file:\C:\work\tomcat8\webapps\dotcms_3.0\WEB-INF\classes (The filename, directory name, or volume label syntax is incorrect)
    at com.dotmarketing.util.ResourceCollectorUtil.getResourcesFromJarFile(ResourceCollectorUtil.java:92)
    at com.dotmarketing.util.ResourceCollectorUtil.getResources(ResourceCollectorUtil.java:77)
    at com.dotmarketing.util.ResourceCollectorUtil.getResources(ResourceCollectorUtil.java:64)
    at com.dotmarketing.util.OSGIUtil.getExtraOSGIPackages(OSGIUtil.java:255)
    at com.dotmarketing.util.OSGIUtil.initializeFramework(OSGIUtil.java:97)
    at com.dotmarketing.listeners.OsgiFelixListener.contextInitialized(OsgiFelixListener.java:17)

So I can't even evaluate the product which undermines desire to get enterprise version. In my humble opinion "ant war" should produce one-click-deploy WAR that I can push and run.

Having updated guide at http://dotcms.com/docs/latest/warInstallation for Tomcat would be very helpful as well.

@unoexperto
Copy link
Author

And master version build via deploy-war-tomcat7 fails with following

Apr 03, 2014 9:57:48 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Apr 03, 2014 9:57:52 PM org.apache.catalina.core.ApplicationContext log
INFO: com.dotcms.repackage.urlrewritefilter_4_0_3.org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok)
Apr 03, 2014 9:58:17 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
com.dotmarketing.exception.DotRuntimeException: Unable to save/update Object to Hibernate Session 
    at com.dotmarketing.portlets.contentlet.business.HostAPIImpl.findSystemHost(HostAPIImpl.java:448)
    at com.dotmarketing.servlets.InitServlet.init(InitServlet.java:235)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
    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:633)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)
Caused by: com.dotmarketing.exception.DotHibernateException: Unable to save/update Object to Hibernate Session 
    at com.dotmarketing.db.HibernateUtil.saveOrUpdate(HibernateUtil.java:462)
    at com.dotcms.content.elasticsearch.business.ESContentFactoryImpl.save(ESContentFactoryImpl.java:1353)
    at com.dotcms.content.elasticsearch.business.ESContentFactoryImpl.save(ESContentFactoryImpl.java:1339)
    at com.dotmarketing.portlets.contentlet.business.HostAPIImpl.createSystemHost(HostAPIImpl.java:753)
    at com.dotmarketing.portlets.contentlet.business.HostAPIImpl.findSystemHost(HostAPIImpl.java:439)
    ... 17 more
Caused by: com.dotcms.repackage.hibernate2.net.sf.hibernate.exception.GenericJDBCException: could not insert: [com.dotmarketing.portlets.contentlet.business.Contentlet#3eb639c1-589f-4d9f-9bf7-262dc22ec3cc]
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:79)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:464)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:426)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261)
    at com.dotmarketing.db.HibernateUtil.saveOrUpdate(HibernateUtil.java:460)
    ... 21 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`dotcms`.`contentlet`, CONSTRAINT `fk_contentlet_lang` FOREIGN KEY (`language_id`) REFERENCES `language` (`id`))
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1040)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359)
    at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:454)
    ... 28 more

Apr 03, 2014 9:58:17 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet  threw load() exception
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`dotcms`.`contentlet`, CONSTRAINT `fk_contentlet_lang` FOREIGN KEY (`language_id`) REFERENCES `language` (`id`))
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1040)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359)
    at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:454)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.persister.NormalizedEntityPersister.insert(NormalizedEntityPersister.java:426)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)
    at com.dotcms.repackage.hibernate2.net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261)
    at com.dotmarketing.db.HibernateUtil.saveOrUpdate(HibernateUtil.java:460)
    at com.dotcms.content.elasticsearch.business.ESContentFactoryImpl.save(ESContentFactoryImpl.java:1353)
    at com.dotcms.content.elasticsearch.business.ESContentFactoryImpl.save(ESContentFactoryImpl.java:1339)
    at com.dotmarketing.portlets.contentlet.business.HostAPIImpl.createSystemHost(HostAPIImpl.java:753)
    at com.dotmarketing.portlets.contentlet.business.HostAPIImpl.findSystemHost(HostAPIImpl.java:439)
    at com.dotmarketing.servlets.InitServlet.init(InitServlet.java:235)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
    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:633)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:744)

@jtesser
Copy link
Contributor

jtesser commented Apr 3, 2014

I would definently recommend going with 2.5.4 which you can download from our download page.

You should not be working from our source. It works and has worked for many people. I would point you to the mailing list if you had install issues.

http://dotcms.com/download/

I would NOT try to run as a WAR. Just run normally for your demo. http://dotcms.com/docs/latest/InstallingFromRelease

I bet you should be able to get this going. We have many clients and people who have it running. But again turn to the mailing list as you have issues

http://dotcms.com/forum/

@jtesser
Copy link
Contributor

jtesser commented Apr 3, 2014

Also I wonder if you are having issues because of Java 8. I would run in 7 if I was you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants