Skip to main content

Error Rendering View[/categorias.xhtml] java.lang.IllegalArgumentException

6 replies [Last post]
josealvarezdelara
Offline
Joined: 2008-12-26

Hello,

I am newer in JSF. I am developping a web app that load the first page. This page has a command button to load the second page categorias.xml. And it is at this point where the app throws the exception,

Error Rendering View[/categorias.xhtml]
java.lang.IllegalArgumentException
at javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:523)
at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:333)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:151)
at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)
at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
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:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(CometEngine.java:547)
at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngine.java:299)
at com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:87)
at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:175)
at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:153)
at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:92)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@1e72466) threw exception
java.lang.IllegalArgumentException
at javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:523)
at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:333)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:151)
at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)
at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
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:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(CometEngine.java:547)
at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngine.java:299)
at com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:87)
at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:175)
at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:153)
at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:92)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
etc...

This is the backing bean,

public class CategoriasBean implements Serializable {

private CategoriaJpaController controller;
protected List categorias;
protected DetalleCategoria detalleCategoria;
protected String selectedItem;

public CategoriasBean() {
getListCategorias();
}

private void getListCategorias() {
controller = new CategoriaJpaController();
List list = controller.findCategoriaEntities();
this.categorias = list;
}

public void prepareForEdit(ActionEvent anEvent) {

CategoriasBean tmpBean = null;
try {
UIComponent tmpComponent = anEvent.getComponent();

while (null != tmpComponent && !(tmpComponent instanceof UIData)) {
tmpComponent = tmpComponent.getParent();
}

if (tmpComponent != null && (tmpComponent instanceof UIData)) {
Object tmpRowData = ((UIData) tmpComponent).getRowData();
if (tmpRowData instanceof CategoriasBean) {
tmpBean = (CategoriasBean) tmpRowData;
}
}
//TODO Exception Handling if UIData not found or tmpRowBean of wrong type
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Se jodio!!! " + e.getMessage());
}
}

public List getSelectItems() {
List selectItems = new ArrayList();
Iterator it = categorias.iterator();
while (it.hasNext()){
DetalleCategoria dc = (DetalleCategoria) it.next();
selectItems.add(new SelectItem(dc.getIdCategoria().toString(), dc.getCategoria()));
}
// The values are the keys passed to the selectItem property.
// The labels are those what you see on the menu.

return selectItems;
}

/**
* @return the categorias
*/
public List getCategorias() {
return categorias;
}

/**
* @param categorias the categorias to set
*/
public void setCategorias(List categorias) {
this.categorias = categorias;
}

public DetalleCategoria getDetalleCategoria() {
return detalleCategoria;
}

/**
* @param detailCategoria the detailCategoria to set
*/
public void setDetalleCategoria(DetalleCategoria detalleCategoria) {
this.detalleCategoria = detalleCategoria;
}

public String getSelectedItem() {
if (selectedItem == null) {
selectedItem = "1"; // This will be the default selected item.
}
return selectedItem;
}
}

and this is the jsf,

What is going wrong?

Thnaks in advance,
Jose Alvarez de Lara

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
josealvarezdelara
Offline
Joined: 2008-12-26

Thanks for your amiability. I was studying your code, but at the end I tried my way.

I used an html table instead of the DataModel, so it did it easiest.

My problem was I had to know if the DataModel was empty before deploy it into the JSF and that is EL Flash.

At the end I used the List that a query returns to load the DataModel. I used a property that held the rows returned by the query.

Thank you anyway.

josealvarezdelara
Offline
Joined: 2008-12-26

Thanks all of you.

Jim was right. I forgot to put an id to the form. It solved the issue.

Now I have another question. I have some database POJO and I am going selecting an item from a list. I drop the first list and select an item. Remaining the item selected I drop another list and select the second item and so on. At the end, depending on every item I have selected, I draw a table with the data of the configured selection.

Every step is managed by a backing bean. How coud I get this backig bean?

Ed Burns

>>>>> On Wed, 05 Aug 2009 07:50:47 -0700 (PDT), webtier@javadesktop.org said:

JD> Jim was right. I forgot to put an id to the form. It solved the
JD> issue.

Chalk one up to Jim!

JD> Now I have another question. I have some database POJO and I am
JD> going selecting an item from a list. I drop the first list and
JD> select an item. Remaining the item selected I drop another list and
JD> select the second item and so on. At the end, depending on every
JD> item I have selected, I draw a table with the data of the configured
JD> selection.

JD> Every step is managed by a backing bean. How coud I get this backig bean?

This seems like a job for the Flash.

Seriously. The EL Flash concept is useful for just this situation.

We don't have a blog about it yet, but there's a demo in the mojarra
source code.

svn checkout https://mojarra.dev.java.net/svn/mojarra/trunk/jsf-ri/systest-per-webapp... flash-demo

I've added you as an observer on the project so you can check it out.

Ed

--
| ed.burns@sun.com | office: 408 884 9519 OR x31640
| homepage: | http://ridingthecrest.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

Jim Driscoll

Just as a hint, JSF 2 Facelets pages need to be valid XML.

That means that you can't have an id that's " ", or that's "". There
are other rules as well.

The hint is in the name of the method that threw the Exception - validateId.

I believe that we've added a couple error messages to help diagnose the
problem, in the latest versions of Mojarra.

Jim

On 8/2/09 9:56 AM, webtier@javadesktop.org wrote:
> Hello,
>
> I am newer in JSF. I am developping a web app that load the first page. This page has a command button to load the second page categorias.xml. And it is at this point where the app throws the exception,
>
> Error Rendering View[/categorias.xhtml]
> java.lang.IllegalArgumentException
> at javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:523)
> at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:333)
> at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:151)
> at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
> at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
> at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)
> at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
> at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
> at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
> at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
> at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
> at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
> at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
> at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
> at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
> at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
> at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
> at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
> at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
> at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
> at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
> at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
> at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
> at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
> at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
> 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:272)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
> at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(CometEngine.java:547)
> at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngine.java:299)
> at com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:87)
> at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:175)
> at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:153)
> at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:92)
> at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
> at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
> executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@1e72466) threw exception
> java.lang.IllegalArgumentException
> at javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:523)
> at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:333)
> at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:151)
> at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
> at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
> at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)
> at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
> at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
> at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
> at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
> at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
> at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
> at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
> at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
> at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
> at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
> at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
> at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
> at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
> at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
> at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
> at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
> at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
> at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
> at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
> 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:272)
> at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
> at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(CometEngine.java:547)
> at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngine.java:299)
> at com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:87)
> at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:175)
> at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:153)
> at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:92)
> at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
> at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
> etc...
>
> This is the backing bean,
>
> public class CategoriasBean implements Serializable {
>
> private CategoriaJpaController controller;
> protected List categorias;
> protected DetalleCategoria detalleCategoria;
> protected String selectedItem;
>
> public CategoriasBean() {
> getListCategorias();
> }
>
> private void getListCategorias() {
> controller = new CategoriaJpaController();
> List list = controller.findCategoriaEntities();
> this.categorias = list;
> }
>
> public void prepareForEdit(ActionEvent anEvent) {
>
> CategoriasBean tmpBean = null;
> try {
> UIComponent tmpComponent = anEvent.getComponent();
>
> while (null != tmpComponent&& !(tmpComponent instanceof UIData)) {
> tmpComponent = tmpComponent.getParent();
> }
>
> if (tmpComponent != null&& (tmpComponent instanceof UIData)) {
> Object tmpRowData = ((UIData) tmpComponent).getRowData();
> if (tmpRowData instanceof CategoriasBean) {
> tmpBean = (CategoriasBean) tmpRowData;
> }
> }
> //TODO Exception Handling if UIData not found or tmpRowBean of wrong type
> } catch (IllegalArgumentException e) {
> throw new IllegalArgumentException("Se jodio!!! " + e.getMessage());
> }
> }
>
> public List getSelectItems() {
> List selectItems = new ArrayList();
> Iterator it = categorias.iterator();
> while (it.hasNext()){
> DetalleCategoria dc = (DetalleCategoria) it.next();
> selectItems.add(new SelectItem(dc.getIdCategoria().toString(), dc.getCategoria()));
> }
> // The values are the keys passed to the selectItem property.
> // The labels are those what you see on the menu.
>
> return selectItems;
> }
>
> /**
> * @return the categorias
> */
> public List getCategorias() {
> return categorias;
> }
>
> /**
> * @param categorias the categorias to set
> */
> public void setCategorias(List categorias) {
> this.categorias = categorias;
> }
>
> public DetalleCategoria getDetalleCategoria() {
> return detalleCategoria;
> }
>
> /**
> * @param detailCategoria the detailCategoria to set
> */
> public void setDetalleCategoria(DetalleCategoria detalleCategoria) {
> this.detalleCategoria = detalleCategoria;
> }
>
> public String getSelectedItem() {
> if (selectedItem == null) {
> selectedItem = "1"; // This will be the default selected item.
> }
> return selectedItem;
> }
> }
>
> and this is the jsf,
>
>
> > xmlns:ui="http://java.sun.com/jsf/facelets"
> xmlns:h="http://java.sun.com/jsf/html"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:c="http://java.sun.com/jstl/core">
>
>


>
>
>

>
>
>
>

>

>

>
>

>
>
>
>
>

>

>

>

>
>

>

>
>
>
> What is going wrong?
>
> Thnaks in advance,
> Jose Alvarez de Lara
> [Message sent by forum member 'josealvarezdelara' (josealvarezdelara)]
>
> http://forums.java.net/jive/thread.jspa?messageID=358515
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

Lincoln Baxter, III

Another possibility is that you are attempting to pass in an invalid
attribute type: a String instead of a MethodExpression, for example.
That would cause an IAE.

--Lincoln

On Sun, 2009-08-02 at 20:17 -0700, Jim Driscoll wrote:

> Just as a hint, JSF 2 Facelets pages need to be valid XML.
>
> That means that you can't have an id that's " ", or that's "". There
> are other rules as well.
>
> The hint is in the name of the method that threw the Exception - validateId.
>
> I believe that we've added a couple error messages to help diagnose the
> problem, in the latest versions of Mojarra.
>
>
> Jim
>
> On 8/2/09 9:56 AM, webtier@javadesktop.org wrote:
> > Hello,
> >
> > I am newer in JSF. I am developping a web app that load the first page. This page has a command button to load the second page categorias.xml. And it is at this point where the app throws the exception,
> >
> > Error Rendering View[/categorias.xhtml]
> > java.lang.IllegalArgumentException
> > at javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:523)
> > at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:333)
> > at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:151)
> > at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
> > at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
> > at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)
> > at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
> > at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
> > at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
> > at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
> > at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
> > at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
> > at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
> > at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
> > at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
> > at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
> > at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
> > at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
> > at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
> > at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
> > at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
> > at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
> > at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
> > at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> > at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
> > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
> > at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
> > at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
> > 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:272)
> > at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
> > at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(CometEngine.java:547)
> > at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngine.java:299)
> > at com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:87)
> > at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:175)
> > at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:153)
> > at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:92)
> > at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
> > at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
> > executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@1e72466) threw exception
> > java.lang.IllegalArgumentException
> > at javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:523)
> > at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:333)
> > at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:151)
> > at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
> > at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
> > at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)
> > at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
> > at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
> > at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
> > at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
> > at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
> > at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
> > at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
> > at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
> > at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
> > at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
> > at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
> > at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
> > at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
> > at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
> > at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
> > at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
> > at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
> > at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> > at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
> > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
> > at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
> > at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
> > 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:272)
> > at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
> > at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(CometEngine.java:547)
> > at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngine.java:299)
> > at com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:87)
> > at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:175)
> > at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:153)
> > at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:92)
> > at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
> > at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
> > etc...
> >
> > This is the backing bean,
> >
> > public class CategoriasBean implements Serializable {
> >
> > private CategoriaJpaController controller;
> > protected List categorias;
> > protected DetalleCategoria detalleCategoria;
> > protected String selectedItem;
> >
> > public CategoriasBean() {
> > getListCategorias();
> > }
> >
> > private void getListCategorias() {
> > controller = new CategoriaJpaController();
> > List list = controller.findCategoriaEntities();
> > this.categorias = list;
> > }
> >
> > public void prepareForEdit(ActionEvent anEvent) {
> >
> > CategoriasBean tmpBean = null;
> > try {
> > UIComponent tmpComponent = anEvent.getComponent();
> >
> > while (null != tmpComponent&& !(tmpComponent instanceof UIData)) {
> > tmpComponent = tmpComponent.getParent();
> > }
> >
> > if (tmpComponent != null&& (tmpComponent instanceof UIData)) {
> > Object tmpRowData = ((UIData) tmpComponent).getRowData();
> > if (tmpRowData instanceof CategoriasBean) {
> > tmpBean = (CategoriasBean) tmpRowData;
> > }
> > }
> > //TODO Exception Handling if UIData not found or tmpRowBean of wrong type
> > } catch (IllegalArgumentException e) {
> > throw new IllegalArgumentException("Se jodio!!! " + e.getMessage());
> > }
> > }
> >
> > public List getSelectItems() {
> > List selectItems = new ArrayList();
> > Iterator it = categorias.iterator();
> > while (it.hasNext()){
> > DetalleCategoria dc = (DetalleCategoria) it.next();
> > selectItems.add(new SelectItem(dc.getIdCategoria().toString(), dc.getCategoria()));
> > }
> > // The values are the keys passed to the selectItem property.
> > // The labels are those what you see on the menu.
> >
> > return selectItems;
> > }
> >
> > /**
> > * @return the categorias
> > */
> > public List getCategorias() {
> > return categorias;
> > }
> >
> > /**
> > * @param categorias the categorias to set
> > */
> > public void setCategorias(List categorias) {
> > this.categorias = categorias;
> > }
> >
> > public DetalleCategoria getDetalleCategoria() {
> > return detalleCategoria;
> > }
> >
> > /**
> > * @param detailCategoria the detailCategoria to set
> > */
> > public void setDetalleCategoria(DetalleCategoria detalleCategoria) {
> > this.detalleCategoria = detalleCategoria;
> > }
> >
> > public String getSelectedItem() {
> > if (selectedItem == null) {
> > selectedItem = "1"; // This will be the default selected item.
> > }
> > return selectedItem;
> > }
> > }
> >
> > and this is the jsf,
> >
> >
> > > > xmlns:ui="http://java.sun.com/jsf/facelets"
> > xmlns:h="http://java.sun.com/jsf/html"
> > xmlns:f="http://java.sun.com/jsf/core"
> > xmlns:c="http://java.sun.com/jstl/core">
> >
> >


> >
> >
> >

> >
> >
> >
> >

> >

> >

> >
> >

> >
> >
> >
> >
> >

> >

> >

> >

> >
> >

> >

> >
> >
> >
> > What is going wrong?
> >
> > Thnaks in advance,
> > Jose Alvarez de Lara
> > [Message sent by forum member 'josealvarezdelara' (josealvarezdelara)]
> >
> > http://forums.java.net/jive/thread.jspa?messageID=358515
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> > For additional commands, e-mail: webtier-help@glassfish.dev.java.net
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
[att1.html]

tzwoenn
Offline
Joined: 2005-07-01

How does your /template.xhtml look like?