rodrigo.uchoa 7 de nov. de 2014
Cola aqui a pilha de erros. Mas se eu tivesse que arriscar em um problema, diria que é o tamanho da heap. Tenta aumentar o tamanho da heap usando os parâmetros -Xmx e -Xms.
Ataxexe 7 de nov. de 2014
Você pode usar um Scanner.
Tem alguns exemplos neste link:
sciuba 10 de nov. de 2014
2014 - 11 - 10 T13 : 56 : 41.551 - 0200 | Grave : java . lang . IllegalStateException : Queue full
at java . util . Abs tractQueue . add ( Abs tractQueue . java : 98 )
at java . util . concurrent . ArrayBlockingQueue . add ( ArrayBlockingQueue . java : 283 )
at com . sun . common . util . log ging . Log gingOutputStream . flush ( Log gingOutputStream . java : 116 )
at java . io . Print Stream . write ( Print Stream . java : 482 )
at com . sun . common . util . log ging . Log gingOutputStream$ Log gingPrintStream . write ( Log gingOutputStream . java : 392 )
at sun . nio . cs . StreamEncoder . writeBytes ( StreamEncoder . java : 221 )
at sun . nio . cs . StreamEncoder . implFlushBuffer ( StreamEncoder . java : 291 )
at sun . nio . cs . StreamEncoder . flushBuffer ( StreamEncoder . java : 104 )
at java . io . OutputStreamWriter . flushBuffer ( OutputStreamWriter . java : 185 )
at java . io . Print Stream . write ( Print Stream . java : 527 )
at java . io . Print Stream . print ( Print Stream . java : 669 )
at com . sun . common . util . log ging . Log gingOutputStream$ Log gingPrintStream . print ( Log gingOutputStream . java : 297 )
at java . io . Print Stream . print ln ( Print Stream . java : 806 )
at com . sun . common . util . log ging . Log gingOutputStream$ Log gingPrintStream . print ln ( Log gingOutputStream . java : 279 )
at or g . apache . felix . gogo . run time . threadio . ThreadPrintStream . print ln ( ThreadPrintStream . java : 200 )
at br . com . saboia . utils . ImportMaterial . importMaterial ( ImportMaterial . java : 33 )
at br . com . saboia . cont roller . ImportBBean . importXLS ( ImportBBean . java : 97 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl . java : 57 )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 43 )
at java . lang . reflect . Method . invoke ( Method . java : 606 )
at com . sun . el . parser . AstValue . invoke ( AstValue . java : 275 )
at com . sun . el . MethodExpressionImpl . invoke ( MethodExpressionImpl . java : 304 )
at or g . jboss . weld . util . el . For wardingMethodExpression . invoke ( For wardingMethodExpression . java : 40 )
at or g . jboss . weld . el . WeldMethodExpression . invoke ( WeldMethodExpression . java : 50 )
at com . sun . faces . facelets . el . TagMethodExpression . invoke ( TagMethodExpression . java : 105 )
at javax . faces . component . MethodBindingMethodExpressionAdapter . invoke ( MethodBindingMethodExpressionAdapter . java : 87 )
at com . sun . faces . application . ActionListenerImpl . processAction ( ActionListenerImpl . java : 102 )
at javax . faces . component . UICommand . broadcast ( UICommand . java : 315 )
at javax . faces . component . UIViewRoot . broadcastEvents ( UIViewRoot . java : 790 )
at javax . faces . component . UIViewRoot . processApplication ( UIViewRoot . java : 1282 )
at com . sun . faces . lifecycle . InvokeApplicationPhase . execute ( InvokeApplicationPhase . java : 81 )
at com . sun . faces . lifecycle . Phase . doPhase ( Phase . java : 101 )
at com . sun . faces . lifecycle . LifecycleImpl . execute ( LifecycleImpl . java : 198 )
at javax . faces . webapp . FacesServlet . service ( FacesServlet . java : 646 )
at or g . apache . catalina . core . StandardWrapper . service ( StandardWrapper . java : 1682 )
at or g . apache . catalina . core . StandardWrapperValve . invoke ( StandardWrapperValve . java : 318 )
at or g . apache . catalina . core . StandardContextValve . invoke ( StandardContextValve . java : 160 )
at or g . apache . catalina . core . StandardPipeline . doInvoke ( StandardPipeline . java : 734 )
at or g . apache . catalina . core . StandardPipeline . invoke ( StandardPipeline . java : 673 )
at com . sun . enterprise . web . WebPipeline . invoke ( WebPipeline . java : 99 )
at or g . apache . catalina . core . StandardHostValve . invoke ( StandardHostValve . java : 174 )
at or g . apache . catalina . connector . CoyoteAdapter . doService ( CoyoteAdapter . java : 357 )
at or g . apache . catalina . connector . CoyoteAdapter . service ( CoyoteAdapter . java : 260 )
at com . sun . enterprise . v3 . services . impl . Cont ainerMapper . service ( Cont ainerMapper . java : 188 )
at or g . glassfish . grizzly . http . server . HttpHandler . run Service ( HttpHandler . java : 191 )
at or g . glassfish . grizzly . http . server . HttpHandler . doHandle ( HttpHandler . java : 168 )
at or g . glassfish . grizzly . http . server . HttpServerFilter . handleRead ( HttpServerFilter . java : 189 )
at or g . glassfish . grizzly . filterchain . ExecutorResolver$ 9. execute ( ExecutorResolver . java : 119 )
at or g . glassfish . grizzly . filterchain . Def aultFilterChain . executeFilter ( Def aultFilterChain . java : 288 )
at or g . glassfish . grizzly . filterchain . Def aultFilterChain . executeChainPart ( Def aultFilterChain . java : 206 )
at or g . glassfish . grizzly . filterchain . Def aultFilterChain . execute ( Def aultFilterChain . java : 136 )
at or g . glassfish . grizzly . filterchain . Def aultFilterChain . process ( Def aultFilterChain . java : 114 )
at or g . glassfish . grizzly . ProcessorExecutor . execute ( ProcessorExecutor . java : 77 )
at or g . glassfish . grizzly . nio . transport . TCPNIOTransport . fireIOEvent ( TCPNIOTransport . java : 838 )
at or g . glassfish . grizzly . strategies . Abs tractIOStrategy . fireIOEvent ( Abs tractIOStrategy . java : 113 )
at or g . glassfish . grizzly . strategies . WorkerThreadIOStrategy . run 0 ( WorkerThreadIOStrategy . java : 115 )
at or g . glassfish . grizzly . strategies . WorkerThreadIOStrategy . access$ 100 ( WorkerThreadIOStrategy . java : 55 )
at or g . glassfish . grizzly . strategies . WorkerThreadIOStrategy$WorkerThreadRunnable . run ( WorkerThreadIOStrategy . java : 135 )
at or g . glassfish . grizzly . threadpool . Abs tractThreadPool$Worker . doWork ( Abs tractThreadPool . java : 564 )
at or g . glassfish . grizzly . threadpool . Abs tractThreadPool$Worker . run ( Abs tractThreadPool . java : 544 )
at java . lang . Thread . run ( Thread . java : 745 )
sciuba 10 de nov. de 2014
[quote=Ataxexe]Você pode usar um Scanner.
Tem alguns exemplos neste link:
Kra obrigado pela dica, tentei todas as opções que este link que passou dava, e ainda recebo a mesmo erro. Detalhe é uma aplicação Web que estou usando o glassfish como servidor de aplicação!
Esta erro de Queue full acredito que seja do glassfish 4. Tem como configurar isso para não estourar. pois é somente texto porém são arquivos grandes em torno de 300mb.
Terei de fazer um batch para importar isso?
Obrigado
Ataxexe 10 de nov. de 2014
[quote=sciuba]
Ataxexe:
Você pode usar um Scanner.
Tem alguns exemplos neste link:
Kra obrigado pela dica, tentei todas as opções que este link que passou dava, e ainda recebo a mesmo erro. Detalhe é uma aplicação Web que estou usando o glassfish como servidor de aplicação!
Esta erro de Queue full acredito que seja do glassfish 4. Tem como configurar isso para não estourar. pois é somente texto porém são arquivos grandes em torno de 300mb.
Terei de fazer um batch para importar isso?
Obrigado
Olhando o log parece que é o “System.out.println(linha);” que está dando problema. Você realmente precisa cuspir cada linha do arquivo? Tente executar a operação sem esse “System.out.println(linha);”.
Se você estiver usando o GlassFish 4.0, mude para o 4.1 pois tem um bug que parece se aplicar ao seu caso:
https://java.net/jira/browse/GLASSFISH-21029
sciuba 11 de nov. de 2014
Resolvido
no Glassfish em configurações - > server
alterei os valores máximos das threads para -1 ou seja "sem limite de tamanho" e resolveu o meu problema, e sim eu removi também os "System.out" do código.
Obrigado pela opinião e atenção de todos.