myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerhard Petracek <gerhard.petra...@gmail.com>
Subject Re: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.
Date Tue, 13 Mar 2012 17:12:50 GMT
hi jose,

you can use the myfaces-archetype to generate the correct config for
myfaces-core (as well as mojarra) + owb (+ myfaces codi):

mvn archetype:generate -DarchetypeCatalog=http://myfaces.apache.org
-> e.g. select #11 (afterwards you just have to update the versions in the
generated pom.xml file.)

if it still doesn't work with the generated example, you can provide the
example and we can have a look at it.

regards,
gerhard



2012/3/13 José Luis Cetina <maxtorzito@gmail.com>

> I see, i erase and only put @Named and @ ViewAccessScoped and get the same
> error, but i try with only @Named and @RequestScoped (java) and still the
> error, i think the problem is the @Named is not injecting my bean, not
> MyFaces, because if i use @ManagedBean this works ok, but i dont understand
> why if i chagen from MyFaces to Mojarra the @Named and @ViewAccessScoped
> works ok!!
>
> :(
>
>
> 2012/3/13 Rafael Pestano <rmpestano@yahoo.com.br>
>
> > just a question, why do you have @Model,@Named and @ViewAccessScoped in
> > the same bean?
> >
> > i think you need @model OR @Named and @ViewAccessScoped
> >
> > or im wrong?
> >
> > Att,
> > Rafael M. Pestano
> > Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
> > Graduando em Ciência da Computação UFRGS
> > @realpestano
> > http://code.google.com/p/jsf-conventions-framework/
> >
> >
> >
> > ----- Mensagem original -----
> > De: José Luis Cetina <maxtorzito@gmail.com>
> > Para: MyFaces Discussion <users@myfaces.apache.org>
> > Cc:
> > Enviadas: Terça-feira, 13 de Março de 2012 12:28
> > Assunto: Re: Both MyFaces and the RI are on your classpath. Please make
> > sure to use only one of the two JSF-implementations.
> >
> > I see now im using MyFaces instead of Mojarra, the "ERROR" Message still
> > there, but the application can deploy. My second problem persist:
> >
> > javax.el.PropertyNotFoundException: Target Unreachable, identifier
> 'myBean'
> > resolved to null
> > viewId=/index.xhtml
> >
> >
> location=C:\Users\user\Documents\NetBeansProjects\testweb\build\web\index.xhtml
> > phaseId=INVOKE_APPLICATION(5)
> >
> >
> > i have the my beans.xml under WEB-INF folder:
> > beans.xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <beans 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/beans_1_0.xsd">
> > </beans>
> >
> >
> > And my bean its ok:
> >
> > @Named
> > @ViewAccessScoped
> > @Model
> > @View(Index.class)
> > public class MyBean implements Serializable{
> > }
> >
> > If i change from MyFaces to Mojarra this work ok!!!   :(
> >
> > Somebody know what can i do?
> >
> > *Im using: Netbeans 7.1, Glassfish 3.1.2.1, JDK 7u3, MyFaces 2.1.6,
> > CODI 1.0.4, Windows 7. *
> > *
> > *
> > *Thanks.*
> > *
> > *
> >
> *-------------------------------------------------------------------------*
> >
> >
> > 2012/3/13 Werner Punz <werner.punz@gmail.com>
> >
> > > Mhh this looks like a bug in Glassfish to me, the entries  in the
> > > glassfish-web.xml look correct to me. Problem is generally that
> glassfish
> > > is not to keen on overrides of its system libs in my experience. Even
> > while
> > > myfaces runs, try to replace Weld for instance and you run into a mess.
> > > Glassfish as good as it is is an all or nothing pack in many cases.
> > > But it has been some time since I last touched Glassfish, things might
> > > have changed.
> > >
> > >
> > >
> > > Werner
> > >
> > >
> > > Am 12.03.12 17:40, schrieb José Luis Cetina:
> > >
> > >> Im triying to start a new project for first time with myfaces, i
> always
> > >> used Mojarra but know i want to change but im having problems at the
> > >> start:
> > >>
> > >> My only requierement is use Glassfish 3.1.2.1.
> > >>
> > >> Hi i have this WARNING:
> > >>
> > >> *Both MyFaces and the RI are on your classpath. Please make sure to
> use
> > >> only one of the two JSF-implementations.*
> > >>
> > >>
> > >> Why this happend if im using only jars from myfaces?? maybe for
> > glassfish
> > >> i
> > >> think, i have these in my *glassfish-web.xml* file, under WEB-INF
> > folder:
> > >>
> > >>
> > >> <?xml version="1.0" encoding="UTF-8"?>
> > >> <!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish
> > >> Application Server 3.1 Servlet 3.0//EN" "
> > >> http://glassfish.org/dtds/**glassfish-web-app_3_0-1.dtd<
> > http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd>
> > >> ">
> > >> <glassfish-web-app error-url="">
> > >>     <!--Para establecer el charset a utf8 y remover el mensaje de:
> > >> PWC4011:
> > >> Unable to set request character encoding to UTF-8 from context-->
> > >>     <parameter-encoding default-charset="UTF-8"/>
> > >>     *<class-loader delegate="false"/>*
> > >> *<property name="useBundledJsf" value="true"/>*
> > >>
> > >>     <!--<class-loader delegate="true"/>-->
> > >>     <jsp-config>
> > >>         <property name="keepgenerated" value="true">
> > >>             <description>Keep a copy of the generated servlet class'
> > java
> > >> code.</description>
> > >>         </property>
> > >>     </jsp-config>
> > >> </glassfish-web-app>
> > >>
> > >> ----------------  ----------------  ----------------
> > >>
> > >> This is my web.xml
> > >>
> > >> <?xml version="1.0" encoding="UTF-8"?>
> > >> <web-app version="3.0" xmlns="http://java.sun.com/**xml/ns/javaee<
> > http://java.sun.com/xml/ns/javaee>"
> > >> xmlns:xsi="
> > >> http://www.w3.org/2001/**XMLSchema-instance<
> > http://www.w3.org/2001/XMLSchema-instance>"
> > >> xsi:schemaLocation="
> > >> http://java.sun.com/xml/ns/**javaee <
> http://java.sun.com/xml/ns/javaee>
> > >> http://java.sun.com/xml/ns/**javaee/web-app_3_0.xsd<
> > http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd>
> > >> ">
> > >>     <context-param>
> > >>         <param-name>javax.faces.**PROJECT_STAGE</param-name>
> > >>         <param-value>Development</**param-value>
> > >>     </context-param>
> > >>     <context-param>
> > >>         <param-name>com.ocpsoft.**pretty.DEVELOPMENT</param-**name>
> > >>         <param-value>true</param-**value>
> > >>     </context-param>
> > >>     <context-param>
> > >>         <param-name>javax.faces.STATE_**SAVING_METHOD</param-name>
> > >>         <param-value>server</param-**value>
> > >>     </context-param>
> > >>     <context-param>
> > >>         <param-name>
> > >> javax.faces.DATETIMECONVERTER_**DEFAULT_TIMEZONE_IS_SYSTEM_**
> > >> TIMEZONE</param-name>
> > >>         <param-value>true</param-**value>
> > >>     </context-param>
> > >>      <context-param>
> > >>
> <param-name>javax.faces.**FACELETS_SKIP_COMMENTS</param-**name>
> > >>         <param-value>true</param-**value>
> > >>     </context-param>
> > >>     <context-param>
> > >>
> > >> <param-name>com.sun.faces.**enableMissingResourceLibraryDe**
> > >> tection</param-name>
> > >>         <param-value>true</param-**value>
> > >>     </context-param>
> > >>     <listener>
> > >>         *
> > >> <listener-class>org.apache.**myfaces.webapp.**
> > >> StartupServletContextListener<**/listener-class>
> > >> *
> > >>     </listener>
> > >>     <servlet>
> > >>         <servlet-name>Faces Servlet</servlet-name>
> > >>         <servlet-class>javax.faces.**webapp.FacesServlet</servlet-**
> > >> class>
> > >>         <load-on-startup>1</load-on-**startup>
> > >>     </servlet>
> > >>     <servlet-mapping>
> > >>         <servlet-name>Faces Servlet</servlet-name>
> > >>         <url-pattern>/faces/*</url-**pattern>
> > >>     </servlet-mapping>
> > >>     <session-config>
> > >>         <session-timeout>
> > >>             30
> > >>         </session-timeout>
> > >>     </session-config>
> > >>     <welcome-file-list>
> > >>         <welcome-file>faces/index.**xhtml</welcome-file>
> > >>     </welcome-file-list>
> > >> </web-app>
> > >>
> > >> ----------------  ----------------  ----------------
> > >>
> > >> Here are my libraries:
> > >>
> > >> --MYFACES
> > >> myfaces-api-2.1.6.jar
> > >> myfaces-impl-2.1.6.jar
> > >> commons-beanutils-1.8.3.jar
> > >> commons-digester-1.8.jar
> > >> commons-logging-1.8.jar
> > >> commons-codec-1.1.1.jar
> > >> commons-collections-3.2.jar
> > >> --MYFACES CODI
> > >> myfaces-extcdi-alternative-**implementation-module-1.0.4
> > >> myfaces-extcdi-bv1-module-api-**1.0.4
> > >> myfaces-extcdi-bv1-module-**impl-1.0.4
> > >> myfaces-extcdi-core-**alternative-configuration-1.0.**4
> > >> myfaces-extcdi-core-api-1.0.4
> > >> myfaces-extcdi-core-impl-1.0.4
> > >> myfaces-extcdi-jpa1-module-**api-1.0.4
> > >> myfaces-extcdi-jpa1-module-**impl-1.0.4
> > >> myfaces-extcdi-jsf20-module-**api-1.0.4
> > >> myfaces-extcdi-jsf20-module-**impl-1.0.4
> > >> myfaces-extcdi-jsf-**alternative-configuration-1.0.**4
> > >> myfaces-extcdi-message-module-**api-1.0.4
> > >> myfaces-extcdi-message-module-**impl-1.0.4
> > >> myfaces-extcdi-scripting-**module-api-1.0.4
> > >> myfaces-extcdi-scripting-**module-impl-1.0.4
> > >>
> > >>
> > >> I dont know if because the "WARNING" i have other problem:
> > >>
> > >> javax.el.**PropertyNotFoundException: Target Unreachable, identifier
> > >> 'myBean'
> > >> resolved to null,
> > >>
> > >> I have in my beans.xml file under WEB-INF this:
> > >>
> > >> <?xml version="1.0" encoding="UTF-8"?>
> > >> <beans xmlns="http://java.sun.com/**xml/ns/javaee<
> > http://java.sun.com/xml/ns/javaee>
> > >> "
> > >>        xmlns:xsi="http://www.w3.org/**2001/XMLSchema-instance<
> > http://www.w3.org/2001/XMLSchema-instance>
> > >> "
> > >>        xsi:schemaLocation="http://**java.sun.com/xml/ns/javaee<
> > http://java.sun.com/xml/ns/javaee>
> > >> http://java.sun.com/xml/ns/**javaee/beans_1_0.xsd<
> > http://java.sun.com/xml/ns/javaee/beans_1_0.xsd>
> > >> ">
> > >> </beans>
> > >>
> > >> and in my bean:
> > >>
> > >> @Named
> > >> @ViewAccessScoped
> > >> @Model
> > >> @View(Index.class)
> > >> public class MyBean implements Serializable{
> > >>    public void test(){
> > >>      //do nothing
> > >>    }
> > >>
> > >> .....
> > >> }
> > >>
> > >> and in my index.xhtml
> > >>
> > >> <h:commandButton value="CLICK" action="#{myBean.test}"/>
> > >>
> > >> if i click my button the i get this error:
> > >>
> > >> javax.el.**PropertyNotFoundException: Target Unreachable, identifier
> > >> 'myBean'
> > >> resolved to null
> > >> viewId=/index.xhtml
> > >> location=C:\Users\user\**Documents\NetBeansProjects\**
> > >> testweb\build\web\index.xhtml
> > >> phaseId=INVOKE_APPLICATION(5)
> > >> Caused by:
> > >> javax.el.**PropertyNotFoundException - Target Unreachable, identifier
> > >> 'myBean' resolved to null
> > >> at com.sun.el.parser.AstValue.**getTarget(AstValue.java:153)
> > >>
> > >>
> > >> I dont know if this is for the first problem  (*Both MyFaces and the
> RI
> > >> are
> > >>
> > >> on your classpath. Please make sure to use only one of the two
> > >> JSF-implementations.*)
> > >>
> > >> I read i need to have my beans.xml but i have it!!!
> > >>
> > >> Thanks, and sorry for the english, is not my native language
> > >>
> > >>
> > >> Im using: Netbeans 7.1, *Glassfish 3.1.2.1,* JDK 7u3, MyFaces 2.1.6,
> > CODI
> > >> 1.0.4, Windows 7.
> > >>
> > >>
> > >
> > >
> >
> >
> > --
> > -------------------------------------------------------------------
> > *SCJA. José Luis Cetina*
> > -------------------------------------------------------------------
> >
> >
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message