Failed to detect ServletContainerInitializers for context - Run time error in Spring MVC application - spring-mvc

I am creating spring web-mvc application from scratch without using archetype.
Application build successfully but creating but getting run-time exception
I am using Tomcat-7, I have spring-webmvc in classpath. Please check buildpath image below. Need help to understand issue here
SEVERE: Failed to detect ServletContainerInitializers for context with name [/samplerestservice]
java.io.IOException: java.lang.ClassNotFoundException: org.springframework.web.SpringServletContainerInitializer
at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:199)
at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:157)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1575)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1281)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)
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:5479)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
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.ClassNotFoundException: org.springframework.web.SpringServletContainerInitializer
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1856)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1705)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:196)
... 15 more
pom.xml
<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>com.sample.restservice</groupId>
<artifactId>samplerestservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.1.9.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.5.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.8</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
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"
version="3.0">
<servlet>
<servlet-name>restService-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>restService-dispatcher</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
restService-dispatcher-servlet.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/conext
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="samplerestservice" />
<mvc:annotation-driven></mvc:annotation-driven>
</beans>
Build Path
Deployment Assembly

Check this error line:
SEVERE: Failed to detect ServletContainerInitializers for context with name [/samplerestservice]
It is expecting some ContainerInitializerObject you define in the code.

Any reason you want to configure all this stuff by hand? The recommended way to get started with Spring these days is to use Spring Boot which auto-configures sensible defaults based on what's in your pom.xml and what's on the classpath. Further manual tweaks to configuration can be done in Java and properties files where necessary. It's cleaner, faster and way less hassle than the traditional way. The spring-boot-web-starter also embeds an instance of tomcat preconfigured to run on port 8080. The spring guys provide an official tool called the SPRING INITIALIZR where you can choose which spring projects to include in your spring-boot application and it gives you a project with all the right stuff in the pom.xml and the correct folder structure. You just need to import it into eclipse using import -> existing maven project. You can get up and running in minutes, not hours or days.

Judging from the issue you created on the Spring issue tracker, SPR-13872, it seems this problem is not strictly related to Spring but may come from something else.

issue was related to spring framework 4.1.9.RELEASE
After updating to 4.0.5.RELEASE Issue resolved

Related

issue in resolving dependencies in gradle custom plugin

I developed one utility in maven.That maven utility i want to use in gradle and maven custom plugins with maven custom plugin this utility is working fine but in case of gradle plugin it is throwing following issue.
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':hiveUnitTask'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
Caused by: java.lang.NoSuchMethodError: org.apache.hive.service.cli.operation.LogDivertAppender.setWriter(Ljava/io/Writer;)V
at org.apache.hive.service.cli.operation.LogDivertAppender.<init>(LogDivertAppender.java:166)
at org.apache.hive.service.cli.operation.OperationManager.initOperationLogCapture(OperationManager.java:85)
at org.apache.hive.service.cli.operation.OperationManager.init(OperationManager.java:63)
Gradle plugin is developed in java.
Pom file of my utility is as follows:
<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>com.datametica.hiveunit</groupId>
<artifactId>hive_unit</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>HiveUnit</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<hadoop.version>2.2.0</hadoop.version>
<hive.version>1.2.1</hive.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>junit-addons</groupId>
<artifactId>junit-addons</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-minicluster</artifactId>
<version>${hadoop.version}</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-service</artifactId>
<version>${hive.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>${hive.version}</version>
<exclusions>
<exclusion>
<artifactId>hive-service</artifactId>
<groupId>org.apache.hive</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Remove log4j-over-slf4j from your class path.
I copied class from the package of hive service jar's source code in which this error is coming and placed it in my plugin project by making same package structure as it was in hive service jar,this solved my issue I know its know perfect solution but its workaround that solved my purpose

Project build error: Non-resolvable parent POM: Could not find artifact

Hi I have an sample project in Magnolia Blossom. When i run the project it is showing Error.
This is my pom.xml
<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>info.magnolia</groupId>
<artifactId>magnolia-parent-pom-community-module</artifactId>
<version>17</version>
</parent>
<groupId>com.hyro</groupId>
<artifactId>hyro-magnolia-blossom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Hyro Magnolia Blossom</name>
<description>Hyro Magnolia and Blossom working example</description>
<properties>
<magnolia.version>4.3.6</magnolia.version>
<blossom.version>1.1.1</blossom.version>
<spring.version>3.0.4.RELEASE</spring.version>
</properties>
<build>
<resources>
<!-- Add the Attributes from the POM to properties files -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<!-- Compiler version -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- Add timestamp to configuration files -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<inherited>true</inherited>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<format>{0,date,yyyy-MM-dd'T'HH:mm:ss.SSS'+10:00'}</format>
<items>
<item>timestamp</item>
</items>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Magnolia Dependencies -->
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-core</artifactId>
<version>${magnolia.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-mail</artifactId>
<version>${magnolia.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-gui</artifactId>
<version>${magnolia.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-admininterface</artifactId>
<version>${magnolia.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-templating</artifactId>
<version>${magnolia.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-fckeditor</artifactId>
<version>${magnolia.version}</version>
<scope>provided</scope>
</dependency>
<!-- Blossom Module -->
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-blossom</artifactId>
<version>${blossom.version}</version>
<scope>provided</scope>
</dependency>
<!-- Logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
at the it is showing the following error:
Project build error: Non-resolvable parent POM: Could not find artifact info.magnolia:magnolia-parent-pom-community-module:pom:1.0.12-SNAPSHOT and 'parent.relativePath' points at wrong local POM
some where i got an idea of deleting all the *lastupdated.xml file but it is not helping.
Anything wrong with the Pom.xml ?
can anyone suggest me how to resolve this.
I tried building your pom. It was missing </project> at the end. I assume this was just copy paste error. Anyway it built fine for me using maven 3.2.1. I did verify info.magnolia:magnolia-parent-pom-community-module:pom:1.0.12-SNAPSHOT does not exist in the nexus.
I did a mvn dependency:tree on your pom and I don't see any dependency on the pom referenced in your error. Maybe you should try and analyze the pom and your end and see where this dependency is being brought in.
Looking at Magnolia Nexus the latest version of parent pom is 29. Your one is quite old. I suggest you change your pom to
<parent>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-parent-pom-community-module</artifactId>
<version>29</version>
</parent>
HTH,
Jan

Spring MVC - Apache CXF: Is there a main() or init() where I can spawn a worker thread on startup?

I am new to Apache CXF and Spring MVC. I would appreciate your help here.
I used Maven (mvn) to download the org.apache.cxf.archetype:cxf-jaxrs-service archetype (Simple CXF JAX-RS webapp service using Spring configuration).
Here are the relevant artefacts and versions in pom.xml:
<properties>
<jackson.version>1.8.6</jackson.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
The web service works great. However, I need to spawn a thread on start-up to initialize a process that I would like to run on my web server. Normally I would do so in the main() method of a simple Java application or HttpServlet init().
Can you tell me how I could achieve the same here? This is a simple application, so I would prefer not to use an application server (e.g. JBOSS), Apache Camel, RMI, etc.
web.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/beans.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
You should be able to implement a custom ServletContextListener and do your work in the "contextInitialized" method.
https://docs.oracle.com/javaee/6/api/javax/servlet/ServletContextListener.html
You register it in your web.xml using the listener-class element. You'll notice that Spring actually bootstraps itself in the same manner using its ContextLoaderListener.

Magnolia Activation Module (version 5.1.0) Ensures that the key property 'magnolia.author.key.location' is present in the Magnolia properties file

I have checked out the following example project ant tried to get it started with magnolia 5
http://svn.magnolia-cms.com/svn/community/magnolia/tags/magnolia-4.3.1/magnolia-empty-webapp
I have updated maven dependencies, fixed a ton of exeptions and errors and my magnolia-empty-webapp pom.xml looks now like this:
<?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/maven-v4_0_0.xsd">
<parent>
<artifactId>magnolia-project</artifactId>
<groupId>info.magnolia</groupId>
<version>5.2.4</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>magnolia-empty-webapp</artifactId>
<packaging>war</packaging>
<name>magnolia-empty-webapp</name>
<description>The basic Magnolia webapp on which projects can depend.</description>
<profiles>
<profile>
<id>with-optional-modules</id>
<dependencies>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-workflow</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-dms</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-samples</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-templating</artifactId>
<version>5.2.2</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-core</artifactId>
<!-- <version>5.2.4</version> -->
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-standard-templating-kit</artifactId>
<version>2.7.4</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-legacy-admininterface</artifactId>
<version>5.1</version>
</dependency>
<dependency>
<groupId>info.magnolia.ui</groupId>
<artifactId>magnolia-ui-admincentral</artifactId>
<version>5.2.4</version>
</dependency>
<dependency>
<groupId>info.magnolia.activation</groupId>
<artifactId>magnolia-module-activation</artifactId>
<version>5.1</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-templating</artifactId>
<version>5.2.4</version>
</dependency>
<dependency>
<groupId>info.magnolia.cache</groupId>
<artifactId>magnolia-module-cache</artifactId>
<version>5.0.3</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-jaas</artifactId>
<!-- <version>4.3.1</version> -->
</dependency>
<dependency>
<groupId>info.magnolia.ui</groupId>
<artifactId>magnolia-ui-framework</artifactId>
<version>5.2.4</version>
</dependency>
<dependency>
<groupId>info.magnolia.ui</groupId>
<artifactId>magnolia-ui-contentapp</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-scheduler</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>info.magnolia.security</groupId>
<artifactId>magnolia-security-app</artifactId>
<version>5.2.4</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-fckeditor</artifactId>
<version>4.5</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-mail</artifactId>
<version>5.0.2</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-categorization</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-core</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.openutils</groupId>
<artifactId>openutils-log4j</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-demo-project</artifactId>
<version>2.7.4</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-dms</artifactId>
<version>1.6</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<!-- these are the resources copied by the remote-resources-plugin -->
<directory>${basedir}/target/maven-shared-archive-resources</directory>
<excludes>
<exclude>**/*</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/cache</directory>
</fileset>
<fileset>
<directory>src/main/webapp/logs</directory>
</fileset>
<fileset>
<directory>src/main/webapp/repositories</directory>
</fileset>
<!-- <fileset> -->
<!-- <directory>src/main/webapp/templates</directory> -->
<!-- </fileset> -->
<fileset>
<directory>src/main/webapp/tmp</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<!-- these are the resources copied by the remote-resources-plugin -->
<directory>${basedir}/target/maven-shared-archive-resources</directory>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<scanIntervalSeconds>5</scanIntervalSeconds>
</configuration>
</plugin>
<plugin>
<groupId>net.sf.alchim</groupId>
<artifactId>winstone-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<goals>
<goal>embed</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>magnolia.nexus.public</id>
<url>http://nexus.magnolia-cms.com/content/groups/public</url>
</repository>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>magnolia</id>
<url>http://repo.magnolia-cms.com/m2</url>
</pluginRepository>
</pluginRepositories>
</project>
Now when I start magnolia-empty-project, I come to the magnolia installation page. When I click on "Start installation", it comes the following message:
BTW if anyone runs into this issue, to get rid of it, go to WEB-INF/config/default/magnolia.properties and add something like:
magnolia.author.key.location=${magnolia.home}/WEB-INF/config/default/magnolia-activation-keypair.properties
Pls note that while this is fine for development, you should keep all the files, incl. the keys outside of the (exploded) war file for production use.
Also related (but off topic for the discussion) - you should not need to have DMS in your pom file. Magnolia 5 doesn't need DMS. It was replaced by DAM. Pom file above looks like generated by some old version of the archetype or copied from old project.
HTH,
Jan
Max,
I think the problem here is that you are mixing up two different versions of Magnolia. You say you checked out the empty webapp tagged 4.3.1 and then made a lot of changes to it. Have you tried checking out a v5 webapp from the Git repository that replaces the SVN one?
Alternatively, you may find it easier to use the Maven archetypes.
here is the easiest way to get magnolia5 running with an empty-project:
http://www.youtube.com/watch?v=aU7q3daQ8S0#t=133

exposing mule http inbound endpoint

Am unable to expose http endpoint/address on a CentOS server. The most confusing part is we are able to expose other endpoints as ajax etc which are in the example package of mule installation. I am unable to expose this simple echo flow either. I even tried an alternative of explicitly defining an http connector for the endpoint to refer.. still it doesn't work. Am really unable to understand what's going wrong... this post 9002 is not even showing up in netstat after I deploy the app to mule server successfully...
Here's the code:
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xsi:schemalocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.2/mule-http.xsd">
<description>
Sample Flows
</description>
<flow name="echo-flow">
<http:inbound-endpoint address="http://0.0.0.0:9002/echo" />
<echo-component />
</flow>
and am using below pom.xml though this sample app does not require all the transports and modules in it am using them in my original app so using the same with this.
<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>mule.user</groupId>
<artifactId>valexIntegration-esb</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule</packaging>
<name>Self-Contained Standalone Mule Hello World</name>
<description>The sources for this application were copied from Mule distributable</description>
<properties>
<mule.version>3.3.0</mule.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.mule.tools</groupId>
<artifactId>maven-mule-plugin</artifactId>
<version>1.7</version>
<extensions>true</extensions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/app</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule-core</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule-core</artifactId>
<version>${mule.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-builders</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-scripting</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-vm</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-http</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-servlet</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-stdio</artifactId>
<version>${mule.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>mule-deps</id>
<name>Mule Dependencies</name>
<url>http://dist.codehaus.org/mule/dependencies/maven2</url>
</repository>
</repositories>
</project>
It seems that the problem is not in the flow configuration or even in mule itself.
I'd advice you to look for clues in the Operating System realm, for example:
Is the port 9002 available in all of the server's network interfaces? Since you're trying to bind it to the 0.0.0.0 address, it will try and bind them to all interfaces.
Is there some error in the mule startup log? Or does it start ok?
If there is no error, can you access the address from inside the server? Not only 127.0.0.1:9002, but all other possible network interfaces (and their respective IP addresses).
If you can access from inside the machine, but not from the outside (or even if you can't access from the inside), have you checked if there is some firewall rule or some port blocking or some other security measure enforced in this server? Consider not only kernel and inner rules but also network rules in routers or firewalls.
Please, provide us the mule startup log so we can have more clues of what can be going on.

Resources