Page 1 of 2

I can't start jetty demo after maven install successfully

Posted: Mon Dec 16, 2013 7:25 am
by pwangsom@gmail.com
Dear all,

I'm beginner for broadleaf and maven technology. I tried to follow the get started tutorial.
I imported the DemoSite project and executed the maven install command successfully.
However, I get error when I running jetty demo.
I tried to search similar problem on this forum but they don't help me to figure out.

Here is error when I try running jetty demo.

Buildfile: D:\Users\Peerasak\eclipse-broadleaf-workspace\DemoSite\site\build.xml
start-db:
[artifact:pom] An error has occurred while processing the Maven artifact tasks.
[artifact:pom] Diagnosis:
[artifact:pom]
[artifact:pom] Unable to initialize POM pom.xml: Failed to validate POM for project com.ecommerce:site at D:\Users\Peerasak\eclipse-broadleaf-workspace\DemoSite\site\pom.xml
[artifact:pom]

BUILD FAILED
D:\Users\Peerasak\eclipse-broadleaf-workspace\DemoSite\site\build.xml:95: Unable to initialize POM pom.xml: Failed to validate POM for project com.ecommerce:site at D:\Users\Peerasak\eclipse-broadleaf-workspace\DemoSite\site\pom.xml

Total time: 939 milliseconds

Re: I can't start jetty demo after maven install successfully

Posted: Wed Dec 18, 2013 6:48 am
by Theo Schumacher
I t seams that D:\Users\Peerasak\eclipse-broadleaf-workspace\DemoSite\site\pom.xml may be corrupted.
Can you post your pom file, did you change it ?

Re: I can't start jetty demo after maven install successfully

Posted: Fri Dec 20, 2013 2:11 am
by rafmor
Hello,
I have the same problem - when I try to run jetty demo I get "invalid ...\DemoSite\site\pom.xml" error.
I added to pom.xml one dependency:

<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.7.0_25</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>

I had to add this dependency because earlier I faced another problem that is described in one of previous posts:

viewtopic.php?f=14&t=2321

Thank you in advance for your help!

Re: I can't start jetty demo after maven install successfully

Posted: Sun Dec 22, 2013 6:45 pm
by f0rest
Hi, Me too getting the same error. Below is my /site/pom.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>com.mycompany</groupId>
<artifactId>ecommerce-website</artifactId>
<version>1.0</version>
</parent>
<artifactId>site</artifactId>
<packaging>war</packaging>
<name>site</name>
<description>Web Module For Broadleaf Commerce Based ECommerce Site</description>
<properties>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- httpsPort and httpPort are used by embeded jetty server.-->
<!-- Make sure the following httpsPort matches what's in the runtime-properties file, -->
<httpsPort>8443</httpsPort>
<httpPort>8080</httpPort>
</properties>
<build>
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
<finalName>mycompany</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.5.v20120716</version>
<configuration>
<webAppSourceDirectory>${webappDirectory}</webAppSourceDirectory>
<contextPath>/</contextPath>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>${httpPort}</port>

<maxIdleTime>60000</maxIdleTime>
</connector>
<connector implementation="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
<port>${httpsPort}</port>
<keystore>${webappDirectory}/WEB-INF/blc-example.keystore</keystore>
<keyPassword>broadleaf</keyPassword>
<password>broadleaf</password>
</connector>
</connectors>
<webAppConfig>
<allowDuplicateFragmentNames>true</allowDuplicateFragmentNames>
</webAppConfig>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>keytool-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>generate-resources</phase>
<id>clean</id>
<goals>
<goal>clean</goal>
</goals>
</execution>
<execution>
<phase>generate-resources</phase>
<id>genkey</id>
<goals>
<goal>genkey</goal>
</goals>
</execution>
</executions>
<configuration>
<keystore>${webappDirectory}/WEB-INF/blc-example.keystore</keystore>
<dname>cn=localhost</dname>
<keypass>broadleaf</keypass>
<storepass>broadleaf</storepass>
<alias>broadleaf</alias>
<keyalg>RSA</keyalg>
</configuration>
</plugin>

<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<configuration>
<packaging>war</packaging>
<rootPath>${basedir}</rootPath>
</configuration>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>core</artifactId>
</dependency>
<dependency>
<groupId>org.broadleafcommerce</groupId>
<artifactId>broadleaf-framework-web</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.7.0_45</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
</dependencies>
</project>

Re: I can't start jetty demo after maven install successfully

Posted: Tue Dec 24, 2013 12:34 pm
by kcondezo
I was trying to fix it but no results. :evil:
There is the same error reported in http://stackoverflow.com/questions/2003 ... 2#20764222. There is no answer too.

Please somebody.

Re: I can't start jetty demo after maven install successfully

Posted: Thu Jan 02, 2014 2:20 am
by f0rest
what am i missing here? anybody?

Re: I can't start jetty demo after maven install successfully

Posted: Thu Jan 02, 2014 3:34 am
by pwangsom@gmail.com
Theo Schumacher wrote:I t seams that D:\Users\Peerasak\eclipse-broadleaf-workspace\DemoSite\site\pom.xml may be corrupted.
Can you post your pom file, did you change it ?


I'm sorry for late reply. Here is my pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>com.ecommerce</groupId>
<artifactId>ecommerce-website</artifactId>
<version>1.0</version>
</parent>
<artifactId>site</artifactId>
<packaging>war</packaging>
<name>site</name>
<description>Web Module For Broadleaf Commerce Based ECommerce Site</description>
<properties>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- httpsPort and httpPort are used by embeded jetty server.-->
<!-- Make sure the following httpsPort matches what's in the runtime-properties file, -->
<httpsPort>8443</httpsPort>
<httpPort>8080</httpPort>
</properties>
<build>
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
<finalName>ecommerce</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.5.v20120716</version>
<configuration>
<webAppSourceDirectory>${webappDirectory}</webAppSourceDirectory>
<contextPath>/</contextPath>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>${httpPort}</port>

<maxIdleTime>60000</maxIdleTime>
</connector>
<connector implementation="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
<port>${httpsPort}</port>
<keystore>${webappDirectory}/WEB-INF/blc-example.keystore</keystore>
<keyPassword>broadleaf</keyPassword>
<password>broadleaf</password>
</connector>
</connectors>
<webAppConfig>
<allowDuplicateFragmentNames>true</allowDuplicateFragmentNames>
</webAppConfig>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>keytool-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>generate-resources</phase>
<id>clean</id>
<goals>
<goal>clean</goal>
</goals>
</execution>
<execution>
<phase>generate-resources</phase>
<id>genkey</id>
<goals>
<goal>genkey</goal>
</goals>
</execution>
</executions>
<configuration>
<keystore>${webappDirectory}/WEB-INF/blc-example.keystore</keystore>
<dname>cn=localhost</dname>
<keypass>broadleaf</keypass>
<storepass>broadleaf</storepass>
<alias>broadleaf</alias>
<keyalg>RSA</keyalg>
</configuration>
</plugin>

<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<configuration>
<packaging>war</packaging>
<rootPath>${basedir}</rootPath>
</configuration>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.ecommerce</groupId>
<artifactId>core</artifactId>
</dependency>
<dependency>
<groupId>org.broadleafcommerce</groupId>
<artifactId>broadleaf-framework-web</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.7.0_07</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
</dependencies>
</project>

Re: I can't start jetty demo after maven install successfully

Posted: Sat Jan 04, 2014 10:15 am
by pwangsom@gmail.com
Dear all,

After I try as rafmor's reply and also try configuring ur local repository path in site/build.xml, issued in the post: viewtopic.php?f=14&t=2275, I can't resolve this issue. In addition, I see the warning in ant view. It shows <D:\Users\Peerasak\eclipse-broadleaf-workspace\DemoSite\site\dir does not exist>. But there is no \dir path in D:\Users\Peerasak\eclipse-broadleaf-workspace\DemoSite\site path. I'm wondering why does ant require \dir path. How can I fix it?

01-site-pom-error.png
01-site-pom-error.png (19.38 KiB) Viewed 17220 times


Thanks

Re: I can't start jetty demo after maven install successfully

Posted: Sat Jan 04, 2014 1:42 pm
by f0rest
on the same page with Peerasak. Need help to resolve this.

Re: I can't start jetty demo after maven install successfully

Posted: Sat Jan 04, 2014 3:37 pm
by f0rest
@peerasak: I created a new folder inside \DemoSite\site\ --"dir" and followed the steps mentioned. And I was able to successfully run both the admin and the normal site.