Problemas com maven

4 respostas
anderson.bonavides

Pessoal, tenho esse mesmo projeto em casa funcionando. Tenho essa lib no meu pom.xml:

<dependency> <groupId>javax.faces</groupId> <artifactId>jsf-impl</artifactId> <version>1.2</version> <type>jar</type> <classifier>NIGHTLY_20060227</classifier> <scope>compile</scope> </dependency>

O projeto roda em casa perfeitamente mas quando tento testar aki no pc do meu trampo e gerado este erro:

C:\eclipse\workspace\ProjetoBase>mvn jetty:run -o
[INFO]
NOTE: Maven is executing in offline mode. Any artifacts not already in your loca
l
repository will be inaccessible.

[INFO] Scanning for projects

[INFO] ------------------------------------------------------------------------

[INFO] Building ProjetoBase

[INFO]    task-segment: [jetty:run]

[INFO] ------------------------------------------------------------------------

[INFO] Preparing jetty:run

[INFO] [resources:resources]

[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,

i.e. build is platform dependent!

[INFO] Copying 4 resources

[INFO] [compiler:compile]

[INFO] Nothing to compile - all classes are up to date

[INFO] [resources:testResources]

[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,

i.e. build is platform dependent!

[INFO] Copying 0 resource

[INFO] [compiler:testCompile]

[INFO] Nothing to compile - all classes are up to date

[INFO] [jetty:run]

[INFO] Configuring Jetty for project: ProjetoBase

[INFO] Webapp source directory = C:\eclipse\workspace\ProjetoBase\src\main\webap

p

[INFO] web.xml file = C:\eclipse\workspace\ProjetoBase\src\main\webapp\WEB-INF\w

eb.xml

[INFO] Classes = C:\eclipse\workspace\ProjetoBase\target\classes

2009-06-10 14:06:12.015::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog

[INFO] Context path = /ProjetoBase

[INFO] Tmp directory =  determined at runtime

[INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml

[INFO] Web overrides =  none

[INFO] Webapp directory = C:\eclipse\workspace\ProjetoBase\src\main\webapp

[INFO] Starting jetty 6.1.10 

2009-06-10 14:06:12.093::INFO:  jetty-6.1.10

2009-06-10 14:06:12.232::INFO:  No Transaction manager found - if your webapp re

quires one, please configure one.

2009-06-10 14:06:13.060:/ProjetoBase:INFO:  Initializing Spring root WebApplicat

ionContext

0    [main] ERROR org.apache.myfaces.shared_impl.config.MyfacesConfig  - Both My

Faces and the RI are on your classpath. Please make sure to use only one of the

two JSF-implementations.

203  [main] WARN  org.apache.myfaces.shared_impl.util.LocaleUtils  - Locale name

in faces-config.xml null or empty, setting locale to default locale : pt_BR

10/06/2009 14:06:14 com.sun.faces.config.ConfigureListener contextInitialized

INFO: Initializing Suns JavaServer Faces implementation (1.2-NIGHTLY_20060227)

for context ProjetoBase

java.lang.NullPointerException

at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.ja

va:888)

at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.ja

va:762)

at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureLi

stener.java:546)

at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.

java:540)

at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)

at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.jav

a:1220)

at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:

510)

at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448

)

at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6Plug

inWebAppContext.java:110)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:

39)

at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection

.java:152)

at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHan

dlerCollection.java:156)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:

39)

at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection

.java:152)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:

39)

at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:

130)

at org.mortbay.jetty.Server.doStart(Server.java:222)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:

39)

at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.

java:132)

at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMo

jo.java:371)

at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.

java:307)

at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRu

nMojo.java:203)

at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184

)

at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi

nManager.java:483)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa

ultLifecycleExecutor.java:678)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone

Goal(DefaultLifecycleExecutor.java:553)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau

ltLifecycleExecutor.java:523)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan

dleFailures(DefaultLifecycleExecutor.java:371)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen

ts(DefaultLifecycleExecutor.java:332)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi

fecycleExecutor.java:181)

at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)

at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)

at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)

at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)

at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
10/06/2009 14:06:14 com.sun.faces.config.ConfigureListener contextInitialized

INFO: Completed initializing Suns JavaServer Faces implementation (1.2-NIGHTLY_

20060227) for context ProjetoBase

2009-06-10 14:06:14.779::WARN:  Failed startup of context org.mortbay.jetty.plug

in.Jetty6PluginWebAppContext@9c87c1{/ProjetoBase,C:\eclipse\workspace\ProjetoBas

e\src\main\webapp}

javax.faces.FacesException: java.lang.NullPointerException

at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureLi

stener.java:552)

at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.

java:540)

at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)

at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.jav

a:1220)

at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:

510)

at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448

)

at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6Plug

inWebAppContext.java:110)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:

39)

at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection

.java:152)

at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHan

dlerCollection.java:156)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:

39)

at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection

.java:152)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:

39)

at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:

130)

at org.mortbay.jetty.Server.doStart(Server.java:222)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:

39)

at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.

java:132)

at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMo

jo.java:371)

at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.

java:307)

at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRu

nMojo.java:203)

at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184

)

at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi

nManager.java:483)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa

ultLifecycleExecutor.java:678)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone

Goal(DefaultLifecycleExecutor.java:553)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau

ltLifecycleExecutor.java:523)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan

dleFailures(DefaultLifecycleExecutor.java:371)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen

ts(DefaultLifecycleExecutor.java:332)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi

fecycleExecutor.java:181)

at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)

at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)

at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)

at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)

at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.NullPointerException

at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.ja

va:888)

at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.ja

va:762)

at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureLi

stener.java:546)

 38 more

2009-06-10 14:06:14.825::INFO:  Started SelectChannelConnector@0.0.0.0:8080

[INFO] Started Jetty Server

[INFO] Starting scanner at interval of 10 seconds.</blockquote>

É como se não estivesse sendo encontrado a lib.

Grato!

4 Respostas

mario.fts

vc poderia postar toda a parte de dependencias do seu pom? o primeiro erro q dá ta falando q vc tem duas implementações de jsf nele.

anderson.bonavides

Segue:

<dependencies>
		<dependency>
			<groupId>javax.annotation</groupId>
			<artifactId>jsr250-api</artifactId>
			<version>1.0</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>		
		<dependency>
			<groupId>commons-beanutils</groupId>
			<artifactId>commons-beanutils</artifactId>
			<version>20030211.134440</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>commons-collections</groupId>
			<artifactId>commons-collections</artifactId>
			<version>20040616</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>commons-digester</groupId>
			<artifactId>commons-digester</artifactId>
			<version>2.0</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
			<version>1.1.1</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>javax.faces</groupId>
			<artifactId>jsf-api</artifactId>
			<version>1.2_02</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>javax.faces</groupId>
			<artifactId>jsf-impl</artifactId>
			<version>1.2</version>
			<type>jar</type>
			<classifier>NIGHTLY_20060227</classifier>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<version>1.2</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jsp-api</artifactId>
			<version>2.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>taglibs</groupId>
			<artifactId>standard</artifactId>
			<version>1.1.2</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.sun.facelets</groupId>
			<artifactId>jsf-facelets</artifactId>
			<version>1.1.14</version>
			<type>jar</type>
			<scope>compile</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>el-api</artifactId>
			<version>1.0</version>
			<type>jar</type>
			<scope>provided</scope>
		</dependency>
		
		
		<!-- FALTA LIB NO CLASSPATH - OK -->
		<dependency>
			<groupId>org.richfaces.ui</groupId>
			<artifactId>richfaces-ui</artifactId>
			<version>3.3.0.GA</version>
		</dependency>
		<!-- FALTA LIB NO CLASSPATH - OK -->
		<dependency>
			<groupId>org.richfaces.samples</groupId>
			<artifactId>laguna</artifactId>
			<version>3.3.0.GA</version>
		</dependency>
		<!-- FALTA LIB NO CLASSPATH - OK -->
		<dependency>
			<groupId>org.richfaces.samples</groupId>
			<artifactId>glassX</artifactId>
			<version>3.3.0.GA</version>
		</dependency>
		<!-- FALTA LIB NO CLASSPATH - OK -->
		<dependency>
			<groupId>org.richfaces.samples</groupId>
			<artifactId>darkX</artifactId>
			<version>3.3.0.GA</version>
		</dependency>		
		<dependency>
			<groupId>org.apache.myfaces.core</groupId>
			<artifactId>myfaces-api</artifactId>
			<version>1.2.6</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.myfaces.core</groupId>
			<artifactId>myfaces-impl</artifactId>
			<version>1.2.6</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-annotations</artifactId>
			<version>3.4.0.GA</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<!-- FALTA LIB NO CLASSPATH -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>ejb3-persistence</artifactId>
			<version>3.3.2.Beta1</version>
			<type>pom</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.6</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.lucene</groupId>
			<artifactId>lucene-core</artifactId>
			<version>2.4.0</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.5.6</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>1.5.6</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>javassist</groupId>
			<artifactId>javassist</artifactId>
			<version>3.8.0.GA</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring</artifactId>
			<version>2.5.6</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>2.5.6</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>2.5.6</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aop</artifactId>
			<version>2.5.6</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aspects</artifactId>
			<version>2.5.6</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.lowagie</groupId>
			<artifactId>itext</artifactId>
			<version>2.0.7</version>
		</dependency>
		<dependency>
			<groupId>net.sf.jasperreports.engine</groupId>
			<artifactId>jasperreports</artifactId>
			<version>3.0.0</version>
		</dependency>	
	</dependencies>
wamaral

0 [main] ERROR org.apache.myfaces.shared_impl.config.MyfacesConfig - Both My Faces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.
Este erro já deve dizer alguma coisa, ou seja, use somente uma das duas implementalção do jsf.

anderson.bonavides

Pessoal o problema foi resolvido. Obrigado a todos.
Agora me surgiu outro problema: O RichFaces não está 100% está todo desconfigurado. Alguem tem idéia do que seja?

Grato!

Criado 10 de junho de 2009
Ultima resposta 10 de jun. de 2009
Respostas 4
Participantes 3