Я получаю эту ошибку, когда пытаюсь добавить тег p: dataTable в мой проект:
An Error Occurred:
Byte non valido 1 della sequenza UTF-8 a 1 byte.
- Stack Trace
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Byte non valido 1 della sequenza UTF-8 a 1 byte.
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:687)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:557)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1750)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.peekChar(XMLEntityScanner.java:494)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2647)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:423)
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:399)
at com.sun.faces.facelets.compiler.Compiler.compile(Compiler.java:124)
at com.sun.faces.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:305)
at com.sun.faces.facelets.impl.DefaultFaceletFactory.access$100(DefaultFaceletFactory.java:93)
at com.sun.faces.facelets.impl.DefaultFaceletFactory$1.newInstance(DefaultFaceletFactory.java:160)
at com.sun.faces.facelets.impl.DefaultFaceletFactory$1.newInstance(DefaultFaceletFactory.java:158)
at com.sun.faces.facelets.impl.DefaultFaceletCache$1.newInstance(DefaultFaceletCache.java:83)
at com.sun.faces.facelets.impl.DefaultFaceletCache$1.newInstance(DefaultFaceletCache.java:78)
at com.sun.faces.util.ExpiringConcurrentCache$1.call(ExpiringConcurrentCache.java:99)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at com.sun.faces.util.ExpiringConcurrentCache.get(ExpiringConcurrentCache.java:114)
at com.sun.faces.facelets.impl.DefaultFaceletCache.getFacelet(DefaultFaceletCache.java:121)
at com.sun.faces.facelets.impl.DefaultFaceletCache.getFacelet(DefaultFaceletCache.java:62)
at com.sun.faces.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:256)
at com.sun.faces.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:201)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:764)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at it.cyborg.cdg.jsfClasses.util.MultipartFilter.doFilter(MultipartFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
- Component Tree
<UIViewRoot id="j_id1" inView="true" locale="it_IT" renderKitId="HTML_BASIC" rendered="true" transient="false" viewId="/progetti/List.xhtml"/>
- Scoped Variables
Request Parameters
Request Parameters
Name
Value
j_idt24
j_idt24
j_idt24:j_idt25
j_idt24:j_idt25
View Attributes
View Attributes
Name
Value
None
Request Attributes
Request Attributes
Name
Value
None
Flash Attributes
Flash Attributes
Name
Value
None
Session Attributes
Session Attributes
Name
Value
logicBean
it.cyborg.cdg.logic.LogicBean@9ba2b1
stiliPortaleController
it.cyborg.cdg.jsfClasses.StiliPortaleController@1d62330
userBean
it.cyborg.cdg.UserBean@1a04a2f
Application Attributes
Application Attributes
Name
Value
csfcff
com.sun.faces.context.flash.ELFlash@665898
5-mar-2012 12.34.10 - Generated by Mojarra/Facelets
<br/>
Где может быть проблема?Страница xhtml (которая содержала ah: dataTable) была изменена, заменив dataTable и тег столбца на теги PrimeFaces, класс был изменен, чтобы возвращать объект List, а не DataModel ...Я видел этот пример:http://www.primefaces.org/showcase-labs/ui/datatableSorting.jsfи кажется простым добавить опцию сортировки, потому что я не должен добавлять какой-либо конкретный код в класс Java ...Однако вот мой код:List.xhtml:
...
<p:dataTable value="#{progettiController.itemsList}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px" id="dataTable">
<p:column sortBy="#{item.id}">
<f:facet name="header">
<h:outputText value="#{bundle.ProgettiTitle_id}"/>
</f:facet>
<h:commandLink action="#{progettiController.prepareView}" value="#{item.id}"/>
</p:column>
<p:column sortBy="#{item.oggetto}">
<f:facet name="header">
<h:outputText value="#{bundle.ProgettiTitle_oggetto}"/>
</f:facet>
<h:outputText value="#{item.oggetto}"/>
</p:column>
...
ProgettiController.java:
...
private List itemsList;
...
public void setItemsList()
{
itemsList=logic.method.findProgettiByQuery(); //--- a method that returns a sublist of Progetti and that worked correctly
}
...
public List getProgetti()
{
return itemsList;
}
...
Спасибо за вашу помощь!
Обновление: Ладно, думаюЯ понимаю, в чем проблема ... Это не в p: datatable и не в p: column, а в моей способности копировать и вставлять из Интернета ... Иногда символ пробела не распознается правильно, поэтому я должен заменить все пробелыс новыми пробелами ...