You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Edu Garcia <gc...@cibinetonline.com> on 2013/07/31 05:04:25 UTC

Re: AW: AW: Trinidad: Null pointer exception in trinidad

First you need to have facelets configured.

After that, I would do this:


<?xml version="1.0" encoding="UTF-8" ?>
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:tr="http://myfaces.apache.org/trinidad"
	xmlns:f="http://java.sun.com/jsf/core">

	<tr:document mode="default" title="Test Form">
		<tr:form id="my_form" usesUpload="true">
                       ...<your stuff here>...
		</tr:form>
	</tr:document>
</f:view>

if this doesn't work, I suggest you to check your faces configurations 
and web.xml



El Thu 06 Jun 2013 01:54:15 AM CST, Sandeep Gupta escribió:
> Hi
>
> Yes, the Example 2 mentions what you have suggested. But as I
> mentioned, when I tried this , I got Facelet exception in faces servlet
>
> "The processing instruction target matching "[xX][mM][lL]" is not
> allowed"
>
> and dialog does not open.
>
> Regards
>
> Sandeep
>
> On 6/6/2013 1:13 PM, Krebs Roland / BWO Systems AG wrote:
>> Hi Sandeep
>>
>> I'm using JSP, not xhtml. But according to
>> http://en.wikipedia.org/wiki/XHTML , this should be a valid
>> statement. (See also 'Example 2')
>>
>> Regards
>> Roland
>> -----Ursprüngliche Nachricht-----
>> Von: Sandeep Gupta [mailto:sgupta@anantadvantages.com]
>> Gesendet: Donnerstag, 6. Juni 2013 09:29
>> An: users@myfaces.apache.org
>> Betreff: Re: AW: Trinidad: Null pointer exception in trinidad
>>
>> Hi
>>
>> I tried adding
>>
>> <?xml version="1.0" encoding="iso-8859-1" ?>
>>
>> on top of file and deployed the project.
>> On pressing coomandbutton to open dialog for file attachment, now it
>> gives error (and dialog does not open)
>>
>> It is giving Facelet exception "The processing instruction target
>> matching "[xX][mM][lL]" is not allowed"
>>
>> Thanks anyway for suggestion.
>>
>> regards
>>
>> Sandeep
>>
>>
>> On 6/6/2013 12:41 PM, Krebs Roland / BWO Systems AG wrote:
>>> Hello Sandeep
>>>
>>> The core dump says that no encoding has been set, so try to add on
>>> top of your xhtml file your encoding, so for example:
>>>     <?xml version="1.0" encoding="iso-8859-1" ?> or
>>>     <?xml version="1.0" encoding="UTF-8" ?>
>>>
>>> Regards,
>>> Roland
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Sandeep Gupta [mailto:sgupta@anantadvantages.com]
>>> Gesendet: Donnerstag, 6. Juni 2013 08:04
>>> An: users@myfaces.apache.org
>>> Betreff: Trinidad: Null pointer exception in trinidad
>>>
>>> Hi
>>>
>>> I am using trinidad 2.0 in Jboss AS7 environment (JSF builtin Jboss)
>>> on windows . I am trying to upload a file to server using trinidad
>>> fileupload (tr:inputFile) component.
>>>
>>> When the form is submitted to server on pressing a commandButton, I
>>> get Nullpointer exception. I have tried using tomahawk
>>> inputFileUpload component instaed of trinidad component for
>>> inputfile but the NPE remains same.
>>>
>>> Any help/pointers to resolve this issue will be greatly appreciated.
>>>
>>> rgds
>>>
>>> Sandeep Gupta
>>>
>>> java.lang.NullPointerException
>>>     org.apache.myfaces.trinidadinternal.config.upload.UploadRequestWrapper.setCharacterEncoding(UploadRequestWrapper.java:83)
>>>
>>>     com.sun.faces.context.ExternalContextImpl.setRequestCharacterEncoding(ExternalContextImpl.java:212)
>>>
>>>     javax.faces.context.ExternalContextWrapper.setRequestCharacterEncoding(ExternalContextWrapper.java:561)
>>>
>>>     javax.faces.context.ExternalContextWrapper.setRequestCharacterEncoding(ExternalContextWrapper.java:561)
>>>
>>>     javax.faces.application.ViewHandler.initView(ViewHandler.java:488)
>>>     com.sun.faces.application.view.MultiViewHandler.initView(MultiViewHandler.java:111)
>>>
>>>     javax.faces.application.ViewHandlerWrapper.initView(ViewHandlerWrapper.java:274)
>>>
>>>     javax.faces.application.ViewHandlerWrapper.initView(ViewHandlerWrapper.java:274)
>>>
>>>     com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:115)
>>>
>>>     com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
>>>
>>>     javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
>>>
>>>
>>>
>>> Here is my attachFile.xhtml
>>>
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>> <html xmlns="http://www.w3.org/1999/xhtml"
>>> xmlns:f="http://java.sun.com/jsf/core"
>>> xmlns:h="http://java.sun.com/jsf/html"
>>> xmlns:ui="http://java.sun.com/jsf/facelets"
>>>        xmlns:tr="http://myfaces.apache.org/trinidad"
>>> xmlns:t="http://myfaces.apache.org/tomahawk" >
>>>
>>>
>>> <head>
>>> <title>Choose File</title>
>>>
>>> </head>
>>> <body>
>>>
>>> <f:view>
>>> <tr:document>
>>> <h:form enctype="multipart/form-data"> <tr:panelPage id="pp1">
>>>
>>>                 <tr:panelHeader text="Select File Dialog">
>>>
>>>                <tr:panelBox id="pb1" text="Select File"
>>> inlineStyle="width:100%;">
>>>
>>>                        <tr:panelButtonBar id="pbb1" halign="end"
>>> inlineStyle="width:100%;">
>>>                        <tr:commandButton id="cb1" text="Done"
>>> action="#{PackageJSFBean.doneAttachFile}"></tr:commandButton>
>>>                        <tr:commandButton id="cb3" text="Cancel"
>>> action="#{PackageJSFBean.cancelAttachFile}"
>>> immediate="true"></tr:commandButton>
>>>                        </tr:panelButtonBar>
>>>
>>>
>>>                        <tr:panelFormLayout>
>>>
>>>
>>>
>>>                        <tr:inputFile id="HighLevelIdentifiers"
>>> label="Identifers file"
>>> valueChangeListener="#{PackageJSFBean.onSelecthlIdFile}">
>>>                        </tr:inputFile>
>>>
>>>
>>>                        </tr:panelFormLayout>
>>>                   </tr:panelBox>
>>>
>>>                </tr:panelHeader>
>>>                </tr:panelPage>
>>>                </h:form>
>>>                </tr:document>
>>> </f:view>
>>>
>>> </body>
>>>
>>> </html>
>>>
>>> Here is relevant portions of web.xml
>>>
>>> <filter>
>>>      <filter-name>trinidad</filter-name>
>>> <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filte
>>> r-class>
>>>
>>>      </filter>
>>>
>>>     <filter-mapping>
>>>      <filter-name>trinidad</filter-name>
>>>      <servlet-name>faces</servlet-name>
>>> </filter-mapping>
>>>
>>>
>>>
>>>     <servlet>
>>>      <servlet-name>Faces Servlet</servlet-name>
>>> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>>>      <load-on-startup>1</load-on-startup>
>>>      </servlet>
>>>
>>>     <servlet>
>>>      <servlet-name>faces</servlet-name>
>>> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>>>      </servlet>
>>>
>>>     <servlet>
>>>      <servlet-name>resources</servlet-name>
>>> <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</ser
>>> vlet-class>
>>>
>>>      </servlet>
>>>     <servlet>
>>>
>>>     <servlet-mapping>
>>>      <servlet-name>Faces Servlet</servlet-name>
>>>      <url-pattern>*.xhtml</url-pattern>
>>>     </servlet-mapping>
>>>
>>>      <servlet-mapping>
>>>      <servlet-name>Faces Servlet</servlet-name>
>>>      <url-pattern>*.jsf</url-pattern>
>>>      </servlet-mapping>
>>>
>>>     <servlet-mapping>
>>>      <servlet-name>resources</servlet-name>
>>>      <url-pattern>/adf/*</url-pattern>
>>>      </servlet-mapping>
>>>
>
>