Faces-config bean won't resolve
Hello,
A while ago I was reading about a naming convention for spring beans. In spring I can create a bean like this:
<bean id="prefix:beanId" class="org.company....">
The prefix works similar to that of namespaces: when there's two beans from independent projects/modules sharing the same name the prefix helps to keep them unique.
Anyway, when the faces-config.xml is parsed, it won't allow a colon in the name of the bean like so (an exception is thrown):
<managed-bean>..........<value>#{prefix:beanId}</value></managed-bean>
It does allow a period in there, such as:
<managed-bean>..........<value>#{prefix.beanId}</value></managed-bean>
However, after adjusting the bean identifier, it simply won't resolve. No exception, I'm getting null injected. When removing the periods, it does resolve.
Why is that?
Also, I'd like to know your experience with using id prefixes.
Thanks,
David
well, i figured out the problem so thought to share with all aswell.
all i changed was the name of the variable from mDept to dept.
java beans has its own set of rules and naming conventions which i have not read much about but this problem had to do sumthing with that!
just changing the name simply works fine!
Similar Messages
-
I can't find the package, "com.sun.faces.config.beans"
Hi. To research the implementation mechnism of JSF, I downloaded JSF reference implementation source JAR from javaserverfaces.dev.java.net.
But when I unziped the JAR and import these files into eclipse to compile this project, a serials of compile errors occurred. Making a comparation between binary JAR and source JAR, I found that some files contained in binary JAR weren't in the source JAR. For example, com.sun.faces.config.beans package exists in the jsf-impl.jar, but not in jsf-impl's source JAR. I ensure that the binary files and source files have the same version.
Any advice is welcome. THX.
nullThere are three source projects for JSF. The jsf-api, jsf-impl, and jsf-tools. The jsf-tools one contains the package you're looking for.
I never understood why the JSF developers organized their projects this way. Basically, it looks like the jsf-tools project gets compiled into the jsf-impl jar. Thus it's not 1 project to 1 JAR. And confuses people like us!
CowKing -
? on using faces-config bean properties
I like the idea of being able to set bean property values in faces-config - one because it's sort of self-documenting and two because I can change my app without re-compiling. Now from what I've read and from tests I've conducted, the bean is instantiated on first reference from a jsp - the framework calls the no-arg constructor and then calls the setter methods for any faces-config properties. Fine. But what if these properties are central to the bean's behavior - say they're used in the calculation of other properties. I don't have access to them in the constructor, and trying to do something in the setter for each property would be messy. Any ideas, or am I missing something fundamental?
You have the correct understanding. What I would do if I had a property that was dependant on the value of other properties is do the calculation in the getter of that property. As you said, trying to do it in the setter of the other properties would be messy to say the least. Also, be aware that JSF 1.0 has a bug in that it does not support setting nested properties from a faces-config file.
-
How to configure multiple jsp files with diff beans in faces-config.xml??
Hi All,
I have 2 seperate jsp pages one is a login page and the other is the main application page.Now i am handling both the pages with seperate Bean class with respective setter and getter methods.How can i state the same in faces-config.xml file???..
Is the below way correct???
<?xml version='1.0' encoding='UTF-8'?>
<!-- =========== FULL CONFIGURATION FILE ================================== -->
<faces-config version="1.2"
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-facesconfig_1_2.xsd">
<managed-bean>
<managed-bean-name>LoginForm</managed-bean-name>
<managed-bean-class>useraccess.LoginForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-action>#{LoginForm.CheckValidUser}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/success.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{LoginForm.CheckValidUser}</from-action>
<from-outcome>fail</from-outcome>
<to-view-id>/fail.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>DSRApplication</managed-bean-name>
<managed-bean-class>DSRApplication.LoginForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/DSR.jsp</from-view-id>
<navigation-case>
<from-action>#{DSRApplication.checkValidDateInAllFields}</from-action>
<from-outcome>alldatasuccess</from-outcome>
<to-view-id>/success.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{DSRApplication.checkValidDateInAllFields}</from-action>
<from-outcome>datafail</from-outcome>
<to-view-id>/fail.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>Thanks in advance to all.
regards,
Viswanadh.Thanks ejp for the reply.
Since i am a beginner even i dont know the exact reason to answer you for why am i using JSP with Facelets.Kindly provide me the suggestion and valuable information you have so that i can learn.
Apart from this i want to know whether the way provided in that faces-config.xml is possible or do we have a way to make that possible???
regards,
Viswanadh. -
The Managed Bean in the faces-config.xml File
I am still very new to JSF. I am confused about the managed bean.
For example, I have a button in my web page. A click on this button invokes an action; say, ListAction.java.
In this ListAction class, I instantiate a business delegate; say, ListPersonnel.java and call a method in this business delegate to return an ArrayList: personnel. Of course, this business delegate goes through facade, DAO, etc. to populate the ArrayList. This ArrayList is a collecation of a JavaBean called PersonnelBean that gets and sets a number of personnel information; such as ssn, name, etc.
Upon this ArrayList is successfully populated and received by the ListAction class, I am going to display a web page with a table. In JSF, it is <h:dataTable ...>.
My questions are regarding the managed bean in the faces-config.xml file.
1. Which one is my <managed-bean-class>? packageName.ListAction? or packageName.PersonnelBean? or something else?
2. What should be my <managed-bean-name>? I guess that I can give a name I like. Is it right? What about xyz?
3. Then, how do I specify the "value" attribute of my <h:dataTable ...> tag when I display a web page to show the data table? Is it correct to specify value="#{xyz.personnel}"? What is the correct specification if it is wrong?
4. I guess that I can give any name to the "var" attribute in the <h:dataTable ...> tag. Is it right?1. Which one is my <managed-bean-class>?
packageName.ListAction? or
packageName.PersonnelBean? or something else?ListAction
2. What should be my <managed-bean-name>? I guess
that I can give a name I like. Is it right? What
about xyz?Anything you like. xyz is OK.
3. Then, how do I specify the "value" attribute of my
<h:dataTable ...> tag when I display a web page to
show the data table? Is it correct to specify
value="#{xyz.personnel}"? What is the correct
specification if it is wrong?xyz.personnel is OK assuming that ListAction class has a public
method getPersonnel() which returns the ArrayList of PersonnellBeans.
4. I guess that I can give any name to the "var"
attribute in the <h:dataTable ...> tag. Is it right?Yes, you can give any name you like. -
Managed bean in both adfc-config.xml and faces-config.xml file
hi,
i can see that it's possible to declare managed bean in both adfc-config.xml and faces-config.xml file.
is there any difference? which one is recommended?
read here - http://www.jaypillai.com/tag/adf/
but still not clear.
thanks.Hi.
As you know ADF is a framework based on JSF.
In faces-config.xml you define general application manage beans. It offers you define manage beans for all application using JSF default scopes (application, session, request).
In adfc-config.xml you define general application manage beans using ADF Scopes. It means that you can use JSF default ones including "view, pageFlow and backing".
My recommendation is use only one point entry for your general manage beans. Use adfc-config.xml because allow you to use more scopes.
Regards. -
What belongs in the faces-config.xml file? Just bean and navigation info?
I am looking for detailed information on the faces-config.xml file.
I've used examples up to this point and I was wondering where the documentation for this configuration file was at.
At this point, I know that bean management and navigation information is in this file, but are there other settings?
Thanks,
--ToddPringi: The tag explantion information, why isn't that easily found on Sun's web site or document site?
This has been the most frustrating part - finding pieces of information here and there... and not in one location.
Thanks,
--Todd -
JSF Beta - faces-config.xml - Managed Bean Errors.
I recently switched from EA4 to Realse Beta.
When I start my web server, my app throws the following:
Exception sending context initialized event to listener instance of class
com.sun.faces.config.ConfigListener -- java.lang.NullPointerException
I started removed stuff from my faces config and the application started up fine when I removed the managed beans that do not reference other managed beans(see below)?
TIA,
Juby
Example
<!-- =================== Managed Bean Facility ============== -->
<managed-bean>
<description>
User Bean. This will hold the user info from ldap.
</description>
<managed-bean-name>levitonUserLdap</managed-bean-name>
<managed-bean-class>leviton.ldap.Names</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<description>
User Bean. This will hold the user info for the application.
</description>
<managed-bean-name>levitonUser</managed-bean-name>
<managed-bean-class>leviton.FEOP.beans.User</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>firstName</property-name>
<value-ref>levitonUserLdap.firstName</value-ref>
</managed-property>
<managed-property>
<property-name>lastName</property-name>
<value-ref>levitonUserLdap.lastName</value-ref>
</managed-property>
<managed-property>
<property-name>domainUserId</property-name>
<value-ref>levitonUserLdap.userId</value-ref>
</managed-property>
</managed-bean>I beileve this is the cuase of my error.
Why did the <value-ref> tag get removed from the web-facesconfig_1_0.dtd?
How can I reference another managed bean now?
OLD web-facesconfig_1_0.dtd
<!--
The "managed-property" element represents an individual property of a
managed bean that will be configured to the specified value (or value set)
if the corresponding managed bean is automatically created.
-->
<!ELEMENT managed-property (description*, display-name*, icon*, property-name, property-class?, (map-entries|null-value|value|value-ref|values))>
NEW web-facesconfig_1_0.dtd
<!--
The "managed-property" element represents an individual property of a
managed bean that will be configured to the specified value (or value set)
if the corresponding managed bean is automatically created.
-->
<!ELEMENT managed-property (description*, display-name*, icon*, property-name, property-class?, (map-entries|null-value|value|list-entries))> -
Common Beans Faces Config (File Location)
If you have a project with multiple JHeadstart App Definitions, what is the consequence of setting the 'Common Beans Faces Config' to a diffrent location for each App Def?
e.g./WEB-INF/<subsystem>/JhsCommon-beans.xml
Inside web.xml, javax.faces.CONFIG_FILES lists each of the separate JhsCommon-beans.xml files.
I note that the help says this property should be set to the 'same across all application definition files'.
JHeadstart 10.1.3Tom,
1) On pressing find we notice the following (debug
mode)
-performs count hits query (e.g. 6 secs, a slow
query!)
-performs the main VO query with order by (again 6
secs)
-ripples through the label fetching (from bundles 3
including jhs and javax)
-once again, after the clear button label and before
save button label (i.e. where table would be
rendered), another count hits query (again 6 secs)
total about 18 secs
Any idea how to prevent the count hits (both)?Tom, I did the following: overwrite method getQueryHitCount in my ViewObjectImpl class, and set a breakpoint on the call to super. When I click find in a page, the method gets called through JhsSearchBean.executeAdvancedSearchBinding to determine whether any rows will be returned ro conditionally show the "Now Rows found"message, and whether the number of rows does not exceed the max number of query hits allowed.
Then, if the query returns more rows than the rangeSize, the ADF Faces Table renderer calls the method again.
So, I have either 1 or 2 calls to this method, not 3. The ADF Faces call canot be prevented, you could overwrite JhsSearchBean.executeAdvancedSearchBinding and remove the functionality that uses the getEstainmtaedRowCount call.
To figure out why in your situation the method gets called 3 times, you can do the same as I did, overwrite getQueryHitCount and put a breakpoint on it.
>
2) For label fetching I note that the query labels
are fetched twice (consequtively). Not sure what
calls getMessage, but puzzled that it calls these
labels twice, only once for the table column labels.This ADF Faces table rendering internals, nothing we can do about that.
>
3) One of the fields, FIND_STATUS is an
af:selectOneChoice, with
unselectedLabel="#{nls['UNSELECTED_LABEL']}", so this
is translated.
In addition the table has a field TABLE_STATUS, with
same configuration.
This second field as just displayed (not updateable),
but if blank then the 'UNSELECTED_LABEL' translation
is attempted for each row.
Can JHeadstart control this to avoid this translate?
i.e. the amount of translation is now row count and
data dependent.Same as 20, This ADF Faces table rendering internals, nothing we can do about that.
Steven Davelaar,
JHeadstart Team. -
Errors with jMaki faces-config.xml - Application won't run.
I'm getting a couple errors when trying to run my jMaki enabled applications. I tried for a week to find a solution, but not luck. Below is the server log. Does anyone have any ideas?
validateJarFile(C:\Documents and Settings\grover\netbeans\6.0\workspace\dAdmin\build\web\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/dAdmin'
Attempt to set unsupported feature on XMLReader necessary for validation. Validation will bedisabled.
WebModule[/dAdmin]PWC1275: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
javax.faces.FacesException: Can't parse configuration file: jar:file:/C:/Documents%20and%20Settings/j/netbeans/6.0/workspace/dAdmin/build/web/WEB-INF/lib/jsfcompounds-core-0.0.6.jar!/META-INF/faces-config.xml: Error at line 4 column 99: Element type 'faces-config' was not declared
at com.sun.faces.config.ConfigureListener.parse(ConfigureListener.java:1438)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:348)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4515)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
[REMOVED LINES]
at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
PWC1306: Startup of context /dAdmin failed due to previous errorsok, I changed the value to false. This all started when I updated my plugins. The original offending plugin appeared to jMaki.
Here is the version information for glassfish:
Starting Sun Java System Application Server 9.1 (build b58g-fcs) ...
CORE5098: AS Socket Service Initialization has been completed.
MBeanServer started: com.sun.enterprise.interceptor.DynamicInterceptor
CORE5076: Using [Java HotSpot(TM) Client VM, Version 1.6.0_06] from [Sun Microsystems Inc.] Here is my original post, so you can see the evolution of this problem:
[http://forums.java.net/jive/thread.jspa?threadID=43941&tstart=0|http://forums.java.net/jive/thread.jspa?threadID=43941&tstart=0]
Here is the error after making the suggested changes to domain-web.xml:
validateJarFile(C:\Documents and Settings\grover\netbeans\6.0\workspace\dAdmin\build\web\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/dAdmin'
WebModule[/dAdmin]PWC1275: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
javax.faces.FacesException: Can't parse configuration file: jndi:/server/dAdmin/WEB-INF/faces-config.xml: Error at line 17 column 9: Error at (17, 9: already parsing
at com.sun.faces.config.ConfigureListener.parse(ConfigureListener.java:1438)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:376)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4515)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5176)
at com.sun.enterprise.web.WebModule.start(WebModule.java:327)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:957)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1581)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:182)
at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:278)
at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:974)
at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:961)
at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:464)
at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:591)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:635)
at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:744)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:69)
at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:155)
at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:122)
at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:193)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:196)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
PWC1306: Startup of context /dAdmin failed due to previous errors -
Problem in faces-config.xml cycle detection
Hi,
I'm having the following problem in my jsf application. I have a loginMangager bean which holds a reference to the logged user and which is used by many other beans in my application. But in a particular situation I'm getting the following error:
SEVERE: JSF will be unable to create managed bean listaChecagemBean when it is requested. The following problems where found:
- Managed bean mesaTarefasBean contains cyclic references. Evaluation path: mesaTarefasBean -> loginManager -> listaChecagemBean -> loginManager.My faces-config.xml looks like this:
<managed-bean>
<managed-bean-name>loginManager</managed-bean-name>
<managed-bean-class>
br.gov.pgfn.efdv.mesa.view.login.LoginManagerBean
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>listaChecagemBean</managed-bean-name>
<managed-bean-class>
br.gov.pgfn.efdv.mesa.view.ListaChecagemBean
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>loginManager</property-name>
<value>#{loginManager}</value>
</managed-property>
<managed-property>
<property-name>mesaTarefasBean</property-name>
<value>#{mesaTarefasBean}</value>
</managed-property>
<managed-property>
<property-name>listaChecagemFacade</property-name>
<value>#{listaChecagemFacade}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>mesaTarefasBean</managed-bean-name>
<managed-bean-class>br.gov.pgfn.efdv.mesa.view.MesaTarefasBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>loginManager</property-name>
<value>#{loginManager}</value>
</managed-property>
<managed-property>
<property-name>mesaTarefasFacade</property-name>
<value>#{mesaTarefasFacade}</value>
</managed-property>
</managed-bean>As you can see, there is not really a cycle here since the loginManagerBean does not depend on any other bean. If you think of it as directed graph, listaChecagemBean is connected to mesaTarefasBean and both of them are connected to the loginManagerBean, which is not connected to any other bean, it's a sink node.
I'm a missing something? Is this a bug?
I'm using JSF 1.2 RI 1.2_05 and Tomcat 6.0.
Thanks in advance,
Andr� RodriguesHi Ryan,
I still problems with the release 1.2_07 which works fine with 1.2_04 when I use external beans through a custom el-resolver.
<?xml version="1.0" encoding="UTF-8"?>
<faces-config 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-facesconfig_1_2.xsd"
version="1.2">
<application>
<el-resolver>net.t_mobile.test.resolver.TestELResolver</el-resolver>
</application>
<managed-bean>
<managed-bean-name>sessionBean</managed-bean-name>
<managed-bean-class>net.t_mobile.test.beans.SessionBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>externalBean</property-name>
<value>#{externalBean}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>dummyA</managed-bean-name>
<managed-bean-class>net.t_mobile.test.beans.DummyBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>sessionBean</property-name>
<value>#{sessionBean}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>dummyB</managed-bean-name>
<managed-bean-class>net.t_mobile.test.beans.DummyBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>sessionBean</property-name>
<value>#{sessionBean}</value>
</managed-property>
<managed-property>
<property-name>parentBean</property-name>
<value>#{dummyA}</value>
</managed-property>
</managed-bean>
</faces-config>
The dependencies are like follows:
dummyB.parentBean = dummyA
dummyB.sessionBean = sessionBean
dummyA.sessionBean = sessionBean
sessionBean.externalBean = externalBean (resolved through external el-resolver)
If I remove "dummyB" or the reference to externalBean no cycles are detected anymore.
Could you confirm this bug?
Regards,
Marc -
Internal DNS - emailsrvr.mydomain won't resolve, IP does - www works.
Internal Mail won't resolve to emailserver domain, but LAN ip is fine
Hey gang, longtime reader first time poster.
After wrestling with this issue, i'm about out of ideas.
Here's my setup.
Leopard server 10.5.4, running OD master (all rocking),
AFP, Firewall, DNS, (mobile) network home directories.
I'll call this "xserve.mydomain.com "
Its NAT'd IP is 192.168.1.102.
It's a FQDN, kerberos is running and happy, all is well.
There are about 12
clients, each with a desktop (imac) and laptop (macbook).
I have a second (windows 2003 sbe) server hosting the following
services: Exchange and Web (for now).
I'll call this winsbe.mydomain.com
Its NAT'd IP is 192.168.1.101
My External DNS setup is this.
Our DNS hosting is done by our registrar (network solutions).
We own 4 static IPs from our ISP.
One IP is for our router/firewall providing NAT
to internal clients, and the xserve is on DMZ, with
its OSX firewall service turned on.
One IP is for the
windows server. (the last two, if you've been counting, are unused .
Via Network Solutions "advanced DNS", I have our zone
configured. "xserve.mydomain.com" points to its WAN
IP (66.xxx.xxx.198).
www points to 66.xxx.xxx.194.
MX records refer to "winsbe.mydomain.com" via
WAN IP 66.xxx.xxx.194 as well.
All outside services resolve correctly.
IE, i can hit the website and send/receive email from mydomain.com.
My internal DNS as setup as this:
primary zone= mydomain.com
nameserver= xserve.mydomain.com
mx record= winsbe.mydomain.com
xserve.mydomain.com has an A record to LAN IP.
winsbe.mydomain.com has an A record to LAN IP.
www is a CNAME record to winsbe.mydomain.com. <----i'm not sure about this one but it works.....
My forwarder IP points back to my Router (which seems to give me better performance than using ISP
DNS from here..)
I know this is working fine insofar as the webserver, as
an nslookup (www.mydomain.com) internally resolves www to 192.168.1.101.
mydomain.com and www.mydomain.com hit the webserver internally
on client browsers. rock.
Again, forward AND reverse nslookups internally resolve to winsbe.mydmain.com/92.168.1.101
Here is my guess as to my problem,
my internal hostname + a record for the windows server the same as the MX record
which has an alias from www.
I think it's getting effed in there somewhere?
If I setup email clients with the windows server LAN IP rather than
the domain "winsbe.mydomain.com" it all works fine.
I'd frankly be willing to half-*** it with this solution,
but each client will require a mobile computer, so we can't have that
I feel like i'm on the right track, but
just can't make the breakthrough.
Am I barking up the wrong tree here?
Here is a last question,
I have my firewall/router as the "Forwarder IP Address"
in the last page of Settings in server admin. When i put
my ISP's DNS servers, i always get a 2 second delay
for any web query on any client.
I have "127.0.0.1" as the first DNS entry in xserve Network Preferences.
The xserve is the only DNS entry in the client computers.
This isn't a "bad practice" or anything is it?For the curious, my named.conf below (haven't messed with it):
// Include keys file
include "/etc/rndc.key";
// Declares control channels to be used by the rndc utility.
// It is recommended that 127.0.0.1 be the only address used.
// This also allows non-privileged users on the local host to manage
// your name server.
// Default controls
controls {
inet 127.0.0.1 port 54 allow {any; }
keys { "rndc-key"; };
options {
include "/etc/dns/options.conf.apple";
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
// query-source address * port 53;
// a caching only nameserver config
logging {
include "/etc/dns/loggingOptions.conf.apple";
// Public view read by Server Admin
include "/etc/dns/publicView.conf.apple";
// Server Admin declares all zones in a view. BIND therefore dictates
// that all other zone declarations must be contained in views. -
Access Another Class' Property Value That is Defined in the faces-config?
I have a private property "dataTransferType" with public getter and setter in the DataFile class. The initial value of the "dataTransferType" is defined in the faces-config.xml file. I want to get the "initial value" of the "dataTransferType" in another class and the compiler does not like the way I access this property.
Here is the snippet of the DataFile class, which shows the declaration and the getter and setter for the property:
public class DataFile implements java.io.Serializable
private String dataTransferType;
public DataFile(){}
public DataFile( String aDataTransferType )
this.dataTransferType = aDataTransferType;
public String getDataTransferType()
return dataTransferType;
public void setDataTransferType( String dataTransferType )
this.dataTransferType = dataTransferType;
}Here is the way that the initial value of the "dataTransferPropery" is set in the faces-config.xml file:
<managed-bean>
<managed-bean-name>dataFile</managed-bean-name>
<managed-bean-class>propertyBeans.DataFile</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>dataTransferType</property-name>
<property-class>java.lang.String</property-class>
<value>importFile</value>
</managed-property>
</managed-bean>Now, in another class FileManagementBean, I first instantiate the DataFile class
private DataFile datafile;and then in the constructor of the FileManagementBean I tried to access the initial value of the property "dataTransferType":
this.recordItems = this.getRecordsList( datafile.dataTransferType );The compiler did not like it at all.
But, if I arbitrary introduced a String in the FileManagementBean:
String defaultSelectedDataTransferType = "importFile";
this.recordItems = this.getRecordsList( defaultSelectedDataTransferType );My code worked as I had expected without any problem.Thanks for all your attention.
The runtime error is rather strange:
>
javax.servlet.ServletException: javax.faces.FacesException: javax.faces.FacesException: Can't instantiate class: 'actions.DataManagementBean'.. class actions.DataManagementBean : java.lang.NullPointerException
The DataManagementBean is the class that accesses the property "dataTransferType" in the DataFile class. And the initial value of the "dataTransferType" is defined in the faces-config.xml file.
If I arbitrarily introduced a String value in the DataManagementBean:
String defaultSelectedDataTransferType = "importFile"and in the DataManagementBean's constructor, I use this statement:
this.recordItems = this.getRecordsList( defaultSelectedDataTransferType );Things worked as I had expected without problem. But, I think this is not an elegant way of coding it. Because there is a pre-defined value of dataTransferType in the faces-config.xml file, I should access it from there.
But, when I specify:
this.recordItems = this.getRecordsList( datafile.getDataTransferType() );The DataManagementBean cannot even be instantiated!
In my faces-config.xml file, I have:
<managed-bean>
<managed-bean-name>dataManagementBean</managed-bean-name>
<managed-bean-class>actions.DataManagementBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>datafile</property-name>
<property-class>propertyBeans.DataFile</property-class>
<value>#{dataFile}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>dataFile</managed-bean-name>
<managed-bean-class>propertyBeans.DataFile</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>dataTransferType</property-name>
<property-class>java.lang.String</property-class>
<value>importFile</value>
</managed-property>
</managed-bean>
...... -
Error message in adf-faces-config.xml file in myEclipse
hello,
i'm trying to customize appearance of my JSF/ADF Faces app (which worked fine until now), and tried to insert a adf-faces-config.xml file in my WEB-INF directory, this is it (copied from a tutorial) :
<?xml version="1.0"?>
<adf-faces-config xmlns="http://xmlns.oracle.com/adf/view/faces/config">
<!-- Enable debug output -->
<debug-output>true</debug-output>
<!-- Pick accessibility options based on a per-user managed bean -->
<accessibility-mode>#{user.accessibilityMode}</accessibility-mode>
<!-- A silly use of EL: English users get one appearance, -->
<!-- others get another -->
<skin-family>
#{view.locale.language=='en' ? 'minimal' : 'oracle'}
</skin-family>
</adf-faces-config>
after saving the file (in myEclipse) i get the following error message on the second line :
cvc-elt.1 : Cannot find the declaration of element 'adf-faces-config'
what does that mean and what should i do ?
thx...hello,
i'm trying to customize appearance of my JSF/ADF
Faces app (which worked fine until now), and tried to
insert a adf-faces-config.xml file in my WEB-INF
directory, this is it (copied from a tutorial) :
<?xml version="1.0"?>
<adf-faces-config
xmlns="http://xmlns.oracle.com/adf/view/faces/config">
<!-- Enable debug output -->
<debug-output>true</debug-output>
<!-- Pick accessibility options based on a per-user
managed bean -->
<accessibility-mode>#{user.accessibilityMode}</accessi
bility-mode>
<!-- A silly use of EL: English users get one
appearance, -->
<!-- others get another -->
<skin-family>
#{view.locale.language=='en' ? 'minimal' : 'oracle'}
</skin-family>
</adf-faces-config>
after saving the file (in myEclipse) i get the
following error message on the second line :
cvc-elt.1 : Cannot find the declaration of element
'adf-faces-config'
what does that mean and what should i do ?
thx...Hello again,
i'm still stuck with this, could somebody PLEASE give me a hint ?
thx,
dom. -
When To Use redirect/ In faces-config.xml
In what situations should I use <redirect/> in faces-config. I understand what that using it causes it to generate a HTTP redirect instead of redirection through the view handler.
I have ran into situations where if I don't use redirect, evein in a request scoped bean data isn't completely cleared out of a form. IE I have a list of users with a list of their addresses. If I look at an address on user 1 I see the right details, if I then move to user2 and look at one of his addresses it reflects the information from user1. As soon as I add <redirect/> the problem disappears.You normally use it to fire a brand new request.
If I look at an address on user 1 I see the right details, if I then move to user2 and look at one of his addresses it reflects the information from user1. As soon as I add <redirect/> the problem disappears.This rather sounds like faulty code logic. Debug it.
Maybe you are looking for
-
HOW TO GET DARK UNDERLINE IN SAP SCRIPT
HI ALL , My requirement is Order Management--Synopsys International Limited -> after this i have put dark under line . anybody can tell em how to use box command for this. Thanks, Maheedhar.T
-
Adding new characteristics and value fields in COPA
I have recently added several new characteristics and one new value field to the operating concern in the development system. I am not exactly sure how to create the transport. This is the first time I have done a transport in COPA so I was hoping s
-
Pages 09 not printing graphics since updating to snow leopard
I've updated to 10.6.2 but I am unable to print templates with graphics to my Xerox 6520 DP printer. Reloaded the drivers but still not working. Will go ck with Xerox to see if they are issuing a new release driver or not. I tried opening a template
-
Display pr which is not linked with po in report
Hi , ALL SAP EXPERTS, I HAVE PREPARE A QUERY BY USING *INPUT* 1) MATERIAL NO 2) PLANT 3)PROCESSING STATUS OF PURCHASE REQUISITION OR P.O. OUTPUT ARE 1) PUR. ITEM NO 2) P.R. NO 3)QTY REQUESTED IN PR 4 P.O. ITEM NO 5)P..O NUMBER 6)P.O. QUANTITY 7) GR
-
Trouble displaying all rows in classic report
Hi, I have a classic report which pulls out data based on item in bind variable (which is a select list). Some entries should have about 200 rows but the page only shows 15 rows. I have tried setting pagination to none still dont get to see all rows.