You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Christian Schneider <Ch...@gmx-topmail.de> on 2010/06/01 02:12:45 UTC

Missing ELResolver on MyFaces 1.2 for ManagedBean Accesssing

Hi experts,
i try to access an RequestBean from a SessionBean like this:

final DebuggerBean db = (DebuggerBean) FacesContext.getCurrentInstance().getApplication().getELResolver().resolveVariable(facesContext, "neededBean");

This way is described here [1].

But i got an error that the needed classfile for ELResolver wasn't found on my classpath. The project is maven configured and these are my dependencies:
	<dependencies>
		<dependency>
			<groupId>javax.faces</groupId>
			<artifactId>jsf-api</artifactId>
			<version>1.2</version>
		</dependency>

		<dependency>
			<groupId>org.apache.myfaces.core</groupId>
			<artifactId>myfaces-api</artifactId>
			<version>1.2.8</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.myfaces.core</groupId>
			<artifactId>myfaces-impl</artifactId>
			<version>1.2.8</version>
			<scope>compile</scope>
		</dependency>


		<dependency>
			<groupId>org.apache.myfaces.tomahawk</groupId>
			<artifactId>tomahawk12</artifactId>
			<version>1.1.9</version>
		</dependency>

		<dependency>
			<groupId>com.sun.facelets</groupId>
			<artifactId>jsf-facelets</artifactId>
			<version>1.1.14</version>
		</dependency>

		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.4</version>
		</dependency>
	</dependencies>

How can solve the missing ELResolver class?

If i add the el-api and el-impl to the projects pom, the webserver won't start.

<!--		<dependency>-->
<!--			<groupId>javax.el</groupId>-->
<!--			<artifactId>el-api</artifactId>-->
<!--			<version>1.2</version>-->
<!--			<scope>runtime</scope>-->
<!--		</dependency>-->
<!---->
<!--		<dependency>-->
<!--			<groupId>javax.el</groupId>-->
<!--			<artifactId>el-ri</artifactId>-->
<!--			<version>1.2</version>-->
<!--			<scope>runtime</scope>-->
<!--		</dependency>-->

Thanks for reading/helping,
Christian.



[1] http://wiki.apache.org/myfaces/AccessingOneManagedBeanFromAnother

Re: Missing ELResolver on MyFaces 1.2 for ManagedBean Accesssing

Posted by Christian Schneider <C....@gmx.org>.
Hi Leonardo,
it works perfectly :).

Thanks for the very fast answer.

Regards,
Christian.


Am Montag, den 31.05.2010, 19:18 -0500 schrieb Leonardo Uribe:
> Hi
> 
> Try use provider scope to load EL api dependency:
> 
>         <dependency>
>             <groupId>javax.el</groupId>
>             <artifactId>el-api</artifactId>
>             <version>1.0</version>
>             <scope>provided</scope>
>         </dependency>
> 
> regards,
> 
> Leonardo
> 
> 2010/5/31 Christian Schneider <Ch...@gmx-topmail.de>
> 
> > Hi experts,
> > i try to access an RequestBean from a SessionBean like this:
> >
> > final DebuggerBean db = (DebuggerBean)
> > FacesContext.getCurrentInstance().getApplication().getELResolver().resolveVariable(facesContext,
> > "neededBean");
> >
> > This way is described here [1].
> >
> > But i got an error that the needed classfile for ELResolver wasn't found on
> > my classpath. The project is maven configured and these are my dependencies:
> >        <dependencies>
> >                <dependency>
> >                        <groupId>javax.faces</groupId>
> >                        <artifactId>jsf-api</artifactId>
> >                        <version>1.2</version>
> >                </dependency>
> >
> >                <dependency>
> >                        <groupId>org.apache.myfaces.core</groupId>
> >                        <artifactId>myfaces-api</artifactId>
> >                        <version>1.2.8</version>
> >                        <scope>compile</scope>
> >                </dependency>
> >
> >                <dependency>
> >                        <groupId>org.apache.myfaces.core</groupId>
> >                        <artifactId>myfaces-impl</artifactId>
> >                        <version>1.2.8</version>
> >                        <scope>compile</scope>
> >                </dependency>
> >
> >
> >                <dependency>
> >                        <groupId>org.apache.myfaces.tomahawk</groupId>
> >                        <artifactId>tomahawk12</artifactId>
> >                        <version>1.1.9</version>
> >                </dependency>
> >
> >                <dependency>
> >                        <groupId>com.sun.facelets</groupId>
> >                        <artifactId>jsf-facelets</artifactId>
> >                        <version>1.1.14</version>
> >                </dependency>
> >
> >                <dependency>
> >                        <groupId>javax.servlet</groupId>
> >                        <artifactId>servlet-api</artifactId>
> >                        <version>2.4</version>
> >                </dependency>
> >        </dependencies>
> >
> > How can solve the missing ELResolver class?
> >
> > If i add the el-api and el-impl to the projects pom, the webserver won't
> > start.
> >
> > <!--            <dependency>-->
> > <!--                    <groupId>javax.el</groupId>-->
> > <!--                    <artifactId>el-api</artifactId>-->
> > <!--                    <version>1.2</version>-->
> > <!--                    <scope>runtime</scope>-->
> > <!--            </dependency>-->
> > <!---->
> > <!--            <dependency>-->
> > <!--                    <groupId>javax.el</groupId>-->
> > <!--                    <artifactId>el-ri</artifactId>-->
> > <!--                    <version>1.2</version>-->
> > <!--                    <scope>runtime</scope>-->
> > <!--            </dependency>-->
> >
> > Thanks for reading/helping,
> > Christian.
> >
> >
> >
> > [1] http://wiki.apache.org/myfaces/AccessingOneManagedBeanFromAnother
> >


Re: Missing ELResolver on MyFaces 1.2 for ManagedBean Accesssing

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

Try use provider scope to load EL api dependency:

        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>el-api</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>

regards,

Leonardo

2010/5/31 Christian Schneider <Ch...@gmx-topmail.de>

> Hi experts,
> i try to access an RequestBean from a SessionBean like this:
>
> final DebuggerBean db = (DebuggerBean)
> FacesContext.getCurrentInstance().getApplication().getELResolver().resolveVariable(facesContext,
> "neededBean");
>
> This way is described here [1].
>
> But i got an error that the needed classfile for ELResolver wasn't found on
> my classpath. The project is maven configured and these are my dependencies:
>        <dependencies>
>                <dependency>
>                        <groupId>javax.faces</groupId>
>                        <artifactId>jsf-api</artifactId>
>                        <version>1.2</version>
>                </dependency>
>
>                <dependency>
>                        <groupId>org.apache.myfaces.core</groupId>
>                        <artifactId>myfaces-api</artifactId>
>                        <version>1.2.8</version>
>                        <scope>compile</scope>
>                </dependency>
>
>                <dependency>
>                        <groupId>org.apache.myfaces.core</groupId>
>                        <artifactId>myfaces-impl</artifactId>
>                        <version>1.2.8</version>
>                        <scope>compile</scope>
>                </dependency>
>
>
>                <dependency>
>                        <groupId>org.apache.myfaces.tomahawk</groupId>
>                        <artifactId>tomahawk12</artifactId>
>                        <version>1.1.9</version>
>                </dependency>
>
>                <dependency>
>                        <groupId>com.sun.facelets</groupId>
>                        <artifactId>jsf-facelets</artifactId>
>                        <version>1.1.14</version>
>                </dependency>
>
>                <dependency>
>                        <groupId>javax.servlet</groupId>
>                        <artifactId>servlet-api</artifactId>
>                        <version>2.4</version>
>                </dependency>
>        </dependencies>
>
> How can solve the missing ELResolver class?
>
> If i add the el-api and el-impl to the projects pom, the webserver won't
> start.
>
> <!--            <dependency>-->
> <!--                    <groupId>javax.el</groupId>-->
> <!--                    <artifactId>el-api</artifactId>-->
> <!--                    <version>1.2</version>-->
> <!--                    <scope>runtime</scope>-->
> <!--            </dependency>-->
> <!---->
> <!--            <dependency>-->
> <!--                    <groupId>javax.el</groupId>-->
> <!--                    <artifactId>el-ri</artifactId>-->
> <!--                    <version>1.2</version>-->
> <!--                    <scope>runtime</scope>-->
> <!--            </dependency>-->
>
> Thanks for reading/helping,
> Christian.
>
>
>
> [1] http://wiki.apache.org/myfaces/AccessingOneManagedBeanFromAnother
>