jeffev 30 de ago. de 2012
Ao tentar efetuar o upload ele apresenta alguma mensagem de erro?
MaiqueL 30 de ago. de 2012
finalmente apareceu o erro
Advertência : Illegal character in path at index 18 : file : / C : / Documents and Settings / cassioev / Meus documentos / NetBeansProjects / portalAd / build / web / WEB - INF / lib / commons - fileupload - 1.2.2 . jar
java . net . URISyntaxException : Illegal character in path at index 18 : file : / C : / Documents and Settings / cassioev / Meus documentos / NetBeansProjects / portalAd / build / web / WEB - INF / lib / commons - fileupload - 1.2.2 . jar
at java . net . URI $ Parser . fail ( URI . java : 2827 )
at java . net . URI $ Parser . checkChars ( URI . java : 3000 )
at java . net . URI $ Parser . parseHierarchical ( URI . java : 3084 )
at java . net . URI $ Parser . parse ( URI . java : 3032 )
at java . net . URI . < init > ( URI . java : 595 )
at java . net . URL . toURI ( URL . java : 936 )
at com . sun . enterprise . v3 . server . SnifferManagerImpl . getURIs ( SnifferManagerImpl . java : 268 )
at com . sun . enterprise . v3 . server . SnifferManagerImpl . getApplicableSniffers ( SnifferManagerImpl . java : 202 )
at com . sun . enterprise . v3 . server . SnifferManagerImpl . getSniffers ( SnifferManagerImpl . java : 150 )
at com . sun . enterprise . v3 . server . ApplicationLifecycle . setupContainerInfos ( ApplicationLifecycle . java : 606 )
at com . sun . enterprise . v3 . server . ApplicationLifecycle . deploy ( ApplicationLifecycle . java : 368 )
at com . sun . enterprise . v3 . server . ApplicationLifecycle . deploy ( ApplicationLifecycle . java : 240 )
at org . glassfish . deployment . admin . DeployCommand . execute ( DeployCommand . java : 382 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ 1. execute ( CommandRunnerImpl . java : 360 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 370 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 1064 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . access $ 1200 ( CommandRunnerImpl . java : 96 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1244 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1232 )
at org . glassfish . deployment . admin . ReDeployCommand . execute ( ReDeployCommand . java : 126 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ 1. execute ( CommandRunnerImpl . java : 355 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 370 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 1064 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . access $ 1200 ( CommandRunnerImpl . java : 96 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1244 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1232 )
at com . sun . enterprise . v3 . admin . AdminAdapter . doCommand ( AdminAdapter . java : 459 )
at com . sun . enterprise . v3 . admin . AdminAdapter . service ( AdminAdapter . java : 209 )
at com . sun . grizzly . tcp . http11 . GrizzlyAdapter . service ( GrizzlyAdapter . java : 168 )
at com . sun . enterprise . v3 . server . HK2Dispatcher . dispath ( HK2Dispatcher . java : 117 )
at com . sun . enterprise . v3 . services . impl . ContainerMapper . service ( ContainerMapper . java : 238 )
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 )
Informações : Inicializando Mojarra 2.1.3 ( FCS b02 ) para o contexto '/portalAd'
Informações : Instantiated an instance of org . hibernate . validator . engine . resolver . JPATraversableResolver .
Informações : WEB0671 : Loading application [ portalAd ] at [ /portalAd ]
Informações : portalAd foi implementado com êxito em 12.548 milisegundos .
alguem sabe o que esta faltando ai ?
jweibe 30 de ago. de 2012
post o código do seu form completo ai
MaiqueL 30 de ago. de 2012
jweibe:
post o código do seu form completo ai
& lt ; ? xml version = '1.0' encoding = 'UTF-8' ? & gt ;
& lt ; ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" & gt ;
& lt ; html xmlns = "http://www.w3.org/1999/xhtml"
xmlns : p = "http://primefaces.prime.com.tr/ui"
xmlns : h = "http://java.sun.com/jsf/html" & gt ;
& lt ; h : head & gt ;
& lt ; title & gt ; Facelet Title & lt ; / title & gt ;
& lt ; / h : head & gt ;
& lt ; h : body & gt ;
& lt ; h : form id = "formid" & gt ;
& lt ; p : fileUpload id = "fileupload"
cancelLabel = "#{msg['cancel']}" update = "someComponent"
fileUploadListener = "#{horaExtraManagedBean.handleFileUpload}"
multiple = "false" sizeLimit = "1000000"
allowTypes = "/(\.|\/)(gif|jpe?g|png)$/" /& gt ;
& lt ; / h : form & gt ;
& lt ; / h : body & gt ;
& lt ; / html & gt ;
jweibe 30 de ago. de 2012
MaiqueL:
jweibe:
post o código do seu form completo ai
& lt ; ? xml version = '1.0' encoding = 'UTF-8' ? & gt ;
& lt ; ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" & gt ;
& lt ; html xmlns = "http://www.w3.org/1999/xhtml"
xmlns : p = "http://primefaces.prime.com.tr/ui"
xmlns : h = "http://java.sun.com/jsf/html" & gt ;
& lt ; h : head & gt ;
& lt ; title & gt ; Facelet Title & lt ; / title & gt ;
& lt ; / h : head & gt ;
& lt ; h : body & gt ;
& lt ; h : form id = "formid" & gt ;
& lt ; p : fileUpload id = "fileupload"
cancelLabel = "#{msg['cancel']}" update = "someComponent"
fileUploadListener = "#{horaExtraManagedBean.handleFileUpload}"
multiple = "false" sizeLimit = "1000000"
allowTypes = "/(\.|\/)(gif|jpe?g|png)$/" /& gt ;
& lt ; / h : form & gt ;
& lt ; / h : body & gt ;
& lt ; / html & gt ;
No seu h:form faça o seguinte.
& lt ; h : form enctype = "multipart/form-data" & gt ;
... ..
& lt ; / h : form & gt ;
MaiqueL 30 de ago. de 2012
Pessoal,
esta dando este erro agora
Advertência : Illegal character in path at index 18 : file : / C : / Documents and Settings / cassioev / Meus documentos / NetBeansProjects / portalAd / build / web / WEB - INF / lib / commons - fileupload - 1.2.2 . jar
java . net . URISyntaxException : Illegal character in path at index 18 : file : / C : / Documents and Settings / cassioev / Meus documentos / NetBeansProjects / portalAd / build / web / WEB - INF / lib / commons - fileupload - 1.2.2 . jar
at java . net . URI $ Parser . fail ( URI . java : 2827 )
at java . net . URI $ Parser . checkChars ( URI . java : 3000 )
at java . net . URI $ Parser . parseHierarchical ( URI . java : 3084 )
at java . net . URI $ Parser . parse ( URI . java : 3032 )
at java . net . URI . < init > ( URI . java : 595 )
at java . net . URL . toURI ( URL . java : 936 )
at com . sun . enterprise . v3 . server . SnifferManagerImpl . getURIs ( SnifferManagerImpl . java : 268 )
at com . sun . enterprise . v3 . server . SnifferManagerImpl . getApplicableSniffers ( SnifferManagerImpl . java : 202 )
at com . sun . enterprise . v3 . server . SnifferManagerImpl . getSniffers ( SnifferManagerImpl . java : 150 )
at com . sun . enterprise . v3 . server . ApplicationLifecycle . setupContainerInfos ( ApplicationLifecycle . java : 606 )
at com . sun . enterprise . v3 . server . ApplicationLifecycle . deploy ( ApplicationLifecycle . java : 368 )
at com . sun . enterprise . v3 . server . ApplicationLifecycle . deploy ( ApplicationLifecycle . java : 240 )
at org . glassfish . deployment . admin . DeployCommand . execute ( DeployCommand . java : 382 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ 1. execute ( CommandRunnerImpl . java : 360 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 370 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 1064 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . access $ 1200 ( CommandRunnerImpl . java : 96 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1244 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1232 )
at org . glassfish . deployment . admin . ReDeployCommand . execute ( ReDeployCommand . java : 126 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ 1. execute ( CommandRunnerImpl . java : 355 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 370 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 1064 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . access $ 1200 ( CommandRunnerImpl . java : 96 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1244 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1232 )
at com . sun . enterprise . v3 . admin . AdminAdapter . doCommand ( AdminAdapter . java : 459 )
at com . sun . enterprise . v3 . admin . AdminAdapter . service ( AdminAdapter . java : 209 )
at com . sun . grizzly . tcp . http11 . GrizzlyAdapter . service ( GrizzlyAdapter . java : 168 )
at com . sun . enterprise . v3 . server . HK2Dispatcher . dispath ( HK2Dispatcher . java : 117 )
at com . sun . enterprise . v3 . services . impl . ContainerMapper . service ( ContainerMapper . java : 238 )
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 )
Informações : Inicializando Mojarra 2.1.3 ( FCS b02 ) para o contexto '/portalAd'
Informações : Instantiated an instance of org . hibernate . validator . engine . resolver . JPATraversableResolver .
Informações : WEB0671 : Loading application [ portalAd ] at [ /portalAd ]
Informações : portalAd foi implementado com êxito em 13.939 milisegundos .
alguem tem alguma idéia ?
jweibe 30 de ago. de 2012
MaiqueL:
Pessoal,
esta dando este erro agora
Advertência : Illegal character in path at index 18 : file : / C : / Documents and Settings / cassioev / Meus documentos / NetBeansProjects / portalAd / build / web / WEB - INF / lib / commons - fileupload - 1.2.2 . jar
java . net . URISyntaxException : Illegal character in path at index 18 : file : / C : / Documents and Settings / cassioev / Meus documentos / NetBeansProjects / portalAd / build / web / WEB - INF / lib / commons - fileupload - 1.2.2 . jar
at java . net . URI $ Parser . fail ( URI . java : 2827 )
at java . net . URI $ Parser . checkChars ( URI . java : 3000 )
at java . net . URI $ Parser . parseHierarchical ( URI . java : 3084 )
at java . net . URI $ Parser . parse ( URI . java : 3032 )
at java . net . URI . < init > ( URI . java : 595 )
at java . net . URL . toURI ( URL . java : 936 )
at com . sun . enterprise . v3 . server . SnifferManagerImpl . getURIs ( SnifferManagerImpl . java : 268 )
at com . sun . enterprise . v3 . server . SnifferManagerImpl . getApplicableSniffers ( SnifferManagerImpl . java : 202 )
at com . sun . enterprise . v3 . server . SnifferManagerImpl . getSniffers ( SnifferManagerImpl . java : 150 )
at com . sun . enterprise . v3 . server . ApplicationLifecycle . setupContainerInfos ( ApplicationLifecycle . java : 606 )
at com . sun . enterprise . v3 . server . ApplicationLifecycle . deploy ( ApplicationLifecycle . java : 368 )
at com . sun . enterprise . v3 . server . ApplicationLifecycle . deploy ( ApplicationLifecycle . java : 240 )
at org . glassfish . deployment . admin . DeployCommand . execute ( DeployCommand . java : 382 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ 1. execute ( CommandRunnerImpl . java : 360 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 370 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 1064 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . access $ 1200 ( CommandRunnerImpl . java : 96 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1244 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1232 )
at org . glassfish . deployment . admin . ReDeployCommand . execute ( ReDeployCommand . java : 126 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ 1. execute ( CommandRunnerImpl . java : 355 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 370 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . doCommand ( CommandRunnerImpl . java : 1064 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl . access $ 1200 ( CommandRunnerImpl . java : 96 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1244 )
at com . sun . enterprise . v3 . admin . CommandRunnerImpl $ ExecutionContext . execute ( CommandRunnerImpl . java : 1232 )
at com . sun . enterprise . v3 . admin . AdminAdapter . doCommand ( AdminAdapter . java : 459 )
at com . sun . enterprise . v3 . admin . AdminAdapter . service ( AdminAdapter . java : 209 )
at com . sun . grizzly . tcp . http11 . GrizzlyAdapter . service ( GrizzlyAdapter . java : 168 )
at com . sun . enterprise . v3 . server . HK2Dispatcher . dispath ( HK2Dispatcher . java : 117 )
at com . sun . enterprise . v3 . services . impl . ContainerMapper . service ( ContainerMapper . java : 238 )
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 )
Informações : Inicializando Mojarra 2.1.3 ( FCS b02 ) para o contexto '/portalAd'
Informações : Instantiated an instance of org . hibernate . validator . engine . resolver . JPATraversableResolver .
Informações : WEB0671 : Loading application [ portalAd ] at [ /portalAd ]
Informações : portalAd foi implementado com êxito em 13.939 milisegundos .
alguem tem alguma idéia ?
Veja Advertência: Illegal character in path at index 18 isso acontece devido ao espaço no caminho do arquivo.
MaiqueL 30 de ago. de 2012
Veja Advertência: Illegal character in path at index 18 isso acontece devido ao espaço no caminho do arquivo.
espaço no caminho de qual arquivo ?
jweibe 30 de ago. de 2012
cara seguinte veja.
Advertência: Illegal character in path at index 18: file:/C:/Documents and Settings/cassioev/Meus documentos/NetBeansProjects/portalAd/build/web/WEB-INF/lib/commons-fileupload-1.2.2.jar
java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/cassioev/Meus documentos/NetBeansProjects/portalAd/build/web/WEB-INF/lib/commons-fileupload-1.2.2.jar
como você ta adicionando essas bibliotecas no seu projeto?
MaiqueL 30 de ago. de 2012
jweibe:
cara seguinte veja.
Advertência: Illegal character in path at index 18: file:/C:/Documents and Settings/cassioev/Meus documentos/NetBeansProjects/portalAd/build/web/WEB-INF/lib/commons-fileupload-1.2.2.jar
java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/cassioev/Meus documentos/NetBeansProjects/portalAd/build/web/WEB-INF/lib/commons-fileupload-1.2.2.jar
como você ta adicionando essas bibliotecas no seu projeto?
eu to simplesmente adicionando pelo netBeans e no xml fico assim
& lt ; filter & gt ;
& lt ; filter - name & gt ; PrimeFaces . FileUpload . Filter & lt ; / filter - name & gt ;
& lt ; filter - class & gt ; org . primefaces . webapp . filter . FileUploadFilter & lt ; / filter - class & gt ;
& lt ; / filter & gt ;
jweibe 30 de ago. de 2012
o problema está ao adicionar esta biblioteca commons-fileupload-1.2.2.jar .
Sugestão mude ela de diretorio.
MaiqueL 30 de ago. de 2012
resolvi este problema, mas agora apareceu um novo problema
o log ta aqui
Grave : service exception
java . lang . RuntimeException : ClientAbortException : java . nio . channels . ClosedChannelException
at com . sun . enterprise . v3 . admin . AdminAdapter . service ( AdminAdapter . java : 243 )
at com . sun . grizzly . tcp . http11 . GrizzlyAdapter . service ( GrizzlyAdapter . java : 168 )
at com . sun . enterprise . v3 . server . HK2Dispatcher . dispath ( HK2Dispatcher . java : 117 )
at com . sun . enterprise . v3 . services . impl . ContainerMapper . service ( ContainerMapper . java : 238 )
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 )
Caused by : ClientAbortException : java . nio . channels . ClosedChannelException
at com . sun . grizzly . tcp . http11 . GrizzlyOutputBuffer . doFlush ( GrizzlyOutputBuffer . java : 439 )
at com . sun . grizzly . tcp . http11 . GrizzlyOutputBuffer . flush ( GrizzlyOutputBuffer . java : 405 )
at com . sun . grizzly . tcp . http11 . GrizzlyOutputStream . flush ( GrizzlyOutputStream . java : 140 )
at com . sun . enterprise . v3 . admin . AdminAdapter . service ( AdminAdapter . java : 240 )
... 17 more
Caused by : java . nio . channels . ClosedChannelException
at sun . nio . ch . SocketChannelImpl . ensureWriteOpen ( SocketChannelImpl . java : 249 )
at sun . nio . ch . SocketChannelImpl . write ( SocketChannelImpl . java : 440 )
at com . sun . grizzly . util . OutputWriter . flushChannel ( OutputWriter . java : 108 )
at com . sun . grizzly . util . OutputWriter . flushChannel ( OutputWriter . java : 76 )
at com . sun . grizzly . http . SocketChannelOutputBuffer . flushChannel ( SocketChannelOutputBuffer . java : 326 )
at com . sun . grizzly . http . SocketChannelOutputBuffer . flushBuffer ( SocketChannelOutputBuffer . java : 398 )
at com . sun . grizzly . http . SocketChannelOutputBuffer . flush ( SocketChannelOutputBuffer . java : 376 )
at com . sun . grizzly . http . ProcessorTask . action ( ProcessorTask . java : 1247 )
at com . sun . grizzly . tcp . Response . action ( Response . java : 268 )
at com . sun . grizzly . tcp . http11 . GrizzlyOutputBuffer . doFlush ( GrizzlyOutputBuffer . java : 434 )
... 20 more
jweibe 30 de ago. de 2012
public void handleFileUpload ( FileUploadEvent event ) {
FacesMessage msg = new FacesMessage ( "Succesful" , event . getFile (). getFileName () + " is uploaded." );
FacesContext . getCurrentInstance (). addMessage ( null , msg );
try {
File file = new File ( "c:\\test.txt" );
InputStream is = event . getFile (). getInputstream ();
OutputStream out = new FileOutputStream ( file );
byte buf [] = new byte [ 1024 ] ;
int len ;
while (( len = is . read ( buf )) > 0 ) {
out . write ( buf , 0 , len );
}
is . close ();
out . close ();
System . out . println ( "passei aqui" );
} catch ( IOException ex ) {
ex . printStackTrace ();
}
}
mude seu código para:
public void handleFileUpload ( FileUploadEvent event ) {
FacesMessage msg = new FacesMessage ( "Succesful" , event . getFile (). getFileName () + " is uploaded." );
FacesContext . getCurrentInstance (). addMessage ( null , msg );
try {
File file = new File ( "c:\\test.txt" );
InputStream is = event . getFile (). getInputstream ();
IOUtils . copyLarge ( is , new FileOutputStream ( file ));
System . out . println ( "passei aqui" );
} catch ( IOException ex ) {
ex . printStackTrace ();
}
}
MaiqueL 30 de ago. de 2012
valeu pela ajuda resolvido.
jweibe 30 de ago. de 2012
edite o primeiro tópico e coloque no título [RESOLVIDO]