JsfUnit setup exception
hmashruf Jan 10, 2011 10:40 PMHi there,
I have maven application (myapp) setup as multi-module (2 sub-modules as springservices and jsfbeans), as per the instructions in the getting started guide (http://www.jboss.org/jsfunit/gettingstarted); followed by creation of new sub-module (JSFUnified) for myapp and declared those 2 modules as dependencies and wrote a jsfUnit test case. From the eclipse menu 'maven install' is run on the JSFUnified, it runs the life cycle phases. Here is the trace and using cargo to start/stop jetty7x. But it is ignoring the tests. Do you see I miss any step. thanks.
Maven 2.2.1, Jdk 1.6
--- xmlbeans-maven-plugin:2.3.2:xmlbeans (default) @ myapp ---
[INFO] Nothing to generate.
[INFO]
[INFO] --- maven-resources-plugin:2.4.1:resources (default-resources) @ myapp ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ myapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.4.1:testResources (default-testResources) @ myapp ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory G:\development\code\fs-myapp\trunk\JSFUnified\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ myapp ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.4.3:test (default-test) @ myapp ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-surefire-plugin:2.4.3:test (surefire-it) @ myapp ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.0:war (default-war) @ myapp ---
[INFO] Exploding webapp...
[INFO] Copy webapp webResources to G:\development\code\fs-myapp\trunk\JSFUnified\target\myapp
[INFO] Assembling webapp myapp in G:\development\code\fs-myapp\trunk\JSFUnified\target\myapp
[INFO] Overlaying 1 war(s).
[INFO] Generating war G:\development\code\fs-myapp\trunk\JSFUnified\target\myapp.war
[INFO] Building war: G:\development\code\fs-myapp\trunk\JSFUnified\target\myapp.war
[INFO]
[INFO] --- cargo-maven2-plugin:1.0.4-SNAPSHOT:start (start-container) @ myapp ---
[INFO] [beddedLocalContainer] Jetty 7.x Embedded starting...
2011-01-10 18:26:05.039:INFO::jetty-7.1.6.v20100715
2011-01-10 18:26:05.601:INFO::Extract jar:file:/G:/development/code/fs-myapp/trunk/JSFUnified/target/myapp.war!/ to G:\development\code\fs-myapp\trunk\JSFUnified\target\myapp
2011-01-10 18:27:43.289:INFO:/myapp:Set web app root system property: 'webapp.root' = [G:\development\code\fs-myapp\trunk\JSFUnified\target\myapp] null null
2011-01-10 18:27:43.320:INFO:/myapp:Initializing log4j from [G:\development\code\fs-myapp\trunk\JSFUnified\target\myapp\WEB-INF\log4j_dev.properties] null null
2011-01-10 18:27:43.492:INFO:/myapp:Initializing Spring root WebApplicationContext null null
Jan 10, 2011 6:27:47 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.0.3 (FCS b03) for context '/myapp'
Jan 10, 2011 6:27:48 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Jan 10, 2011 6:27:50 PM com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor <init>
INFO: Monitoring file:/G:/development/code/fs-myapp/trunk/JSFUnified/target/myapp/WEB-INF/faces-config.xml for modifications
Jan 10, 2011 6:27:50 PM com.sun.faces.config.WebConfiguration$DeferredBooleanParameterLoggingAction log
WARNING: JSF1025: [/myapp] Context initialization parameter 'facelets.SKIP_COMMENTS' is deprecated. The option will still be configured, but please use 'javax.faces.FACELETS_SKIP_COMMENTS' in the future.
Jan 10, 2011 6:27:50 PM com.sun.faces.config.WebConfiguration$DeferredBooleanParameterLoggingAction log
INFO: JSF1020: [/myapp] Configuration option 'javax.faces.FACELETS_SKIP_COMMENTS' RESET to ENABLED
2011-01-10 18:27:50.508:INFO::Extract jar:file:/G:/development/code/fs-myapp/trunk/JSFUnified/target/jetty7x/cargocpc.war!/ to C:\Documents and Settings\hashruf\Local Settings\Temp\Jetty_0_0_0_0_8080_cargocpc.war__cargocpc__xflgf3\webapp
2011-01-10 18:27:50.570:INFO::Started SelectChannelConnector@0.0.0.0:8080
[INFO] [beddedLocalContainer] Jetty 7.x Embedded started on port [8080]
[INFO]
[INFO] --- cargo-maven2-plugin:1.0.4-SNAPSHOT:stop (stop-container) @ myapp ---
[INFO] [beddedLocalContainer] Jetty 7.x Embedded is stopping...
2011-01-10 18:27:51.086:INFO:/myapp:Closing Spring root WebApplicationContext null null
2011-01-10 18:27:51.086:INFO:/myapp:Shutting down log4j null null
[INFO] [beddedLocalContainer] Jetty 7.x Embedded is stopped
[INFO]
[INFO] --- maven-install-plugin:2.3:install (default-install) @ myapp ---
[INFO] Installing G:\development\code\fs-myapp\trunk\JSFUnified\target\myapp.war to C:\Development\repository\com\cla\ai\fs-myapp\myapp\1.0-SNAPSHOT\myapp-1.0-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:31.516s
[INFO] Finished at: Mon Jan 10 18:27:55 PST 2011
[INFO] Final Memory: 12M/36M
[INFO] ------------------------------------------------------------------------
Sure fire plugin entry from pom.xml of the new submodule:
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<!-- We only want test to run during integration-test phase -->
<configuration>
<skip>false</skip>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
<executions>
<execution>
<id>surefire-it</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
<systemProperties>
<property>
<name>cactus.contextURL</name>
<value>http://localhost:8080/${artifactId}</value>
</property>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
Exception: on running: mvn integration-test from console
INFO: Initializing Mojarra 2.0.3 (FCS b03) for context '/myapp'
log4j:WARN No appenders could be found for logger (org.richfaces.log.Renderkit).
log4j:WARN Please initialize the log4j system properly.
Jan 10, 2011 7:24:14 PM com.sun.faces.config.ConfigManager initialize
INFO: Unsanitized stacktrace from failed start...
com.sun.faces.config.ConfigurationException:
Source Document: file:/G:/development/code/fs-myapp/trunk/JSFUnified/target/
myapp/WEB-INF/faces-config.xml
Cause: Unable to create a new instance of 'com.la.is.fs.myapp.phaselisten
er.myappPhaseListener': java.lang.NullPointerException
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance
(AbstractConfigProcessor.java:289)
at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListe
ners(LifecycleConfigProcessor.java:128)
at com.sun.faces.config.processor.LifecycleConfigProcessor.process(Lifec
ycleConfigProcessor.java:107)
at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(Abs
tractConfigProcessor.java:110)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(Factory
ConfigProcessor.java:212)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:332)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureLi
stener.java:220)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextH
andler.java:634)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletC
ontextHandler.java:228)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.jav
a:1132)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandle
r.java:577)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:491
)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection$1.run(HandlerColle
ction.java:200)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool
.java:450)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at com.la.is.fs.myapp.phaselistener.myappPhaseListener.<init>(Non
PearPhaseListener.java:35)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance
(AbstractConfigProcessor.java:264)
... 15 more