я бегу в Exception при добавлении зависимости OmniFaces Maven к существующему рабочему проекту:Исключение при объединении Omnifaces и PrimeFaces LazyDataModel на скумбриевидный гидролик Micro
[2016-06-28T17:19:09.280+0200] [Payara Micro 4.1] [SEVERE] [AS-WEB-CORE-00037] [javax.enterprise.web.core] [tid: _ThreadID=17 _ThreadName=http-listener(7)] [timeMillis: 1467127149280] [levelValue: 1000] [[An exception or error occurred in the container during the request processing
java.lang.ClassCastException: cannot assign instance of java.lang.String to field org.primefaces.model.LazyDataModel.data of type java.util.List in instance of org.primefaces.showcase.view.data.datatable.LazyCarDataModel
at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2083)
at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1261)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1995)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at java.util.HashMap.readObject(HashMap.java:1155)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at java.util.HashMap.readObject(HashMap.java:1155)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at org.apache.catalina.session.StandardSession.readRemainingObject(StandardSession.java:2079)
at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1987)
at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at org.apache.catalina.session.StandardSession.deserialize(StandardSession.java:1274)
at org.apache.catalina.session.StoreBase.readSession(StoreBase.java:296)
at org.glassfish.web.ha.session.management.ReplicationStore.getSession(ReplicationStore.java:567)
at org.glassfish.web.ha.session.management.ReplicationStore.getSession(ReplicationStore.java:519)
at org.glassfish.web.ha.session.management.ReplicationStore.loadFromBackingStore(ReplicationStore.java:433)
at org.glassfish.web.ha.session.management.ReplicationStore.load(ReplicationStore.java:416)
at org.apache.catalina.session.PersistentManagerBase.doSwapIn(PersistentManagerBase.java:1215)
at org.apache.catalina.session.PersistentManagerBase.swapIn(PersistentManagerBase.java:1175)
at org.glassfish.web.ha.session.management.ReplicationManagerBase.findSession(ReplicationManagerBase.java:161)
at org.apache.catalina.connector.Request.isRequestedSessionIdValid(Request.java:2996)
at org.apache.catalina.connector.Request.parseSessionCookiesId(Request.java:4113)
at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:672)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:354)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:526)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Thread.java:724)
]]
Я могу воспроизвести Exception с PrimeFaces 6.0 Showcase, так это похоже, что причина не в моем коде.
Это как воспроизвести с PrimeFaces витрине:
Скачать PrimeFaces 6.0 showcase источники из GitHub.
Добавить OnmiFaces зависимости в
pom.xml
:<dependency> <groupId>org.omnifaces</groupId> <artifactId>omnifaces</artifactId> <version>2.3</version> </dependency>
Добавьте код Maven для создания скумбриевидного гидролика Micro Uber Jar от http://blog.payara.fish/creating-uber-jar-with-payara-micro к
pom.xml
Строите с
mvn package
, а затем начать сjava -jar showcase-6.0.jar
Теперь запустите витрину на локальном хосте и откройте DataTable Laz y Пример загрузки, и вы должны получить исключение.
Исключение не происходит, когда зависимость OmniFaces удалена. И это не происходит на сервере приложений Payara, но только на Payara Micro.
Так что я не уверен, является ли ошибка в OmniFaces, Payara Micro, PrimeFaces или где угодно.
Это может быть ошибка в Payara Micro, если то же самое работает на сервере Payara. У вас есть несколько экземпляров программы Payara Micro (в кластере), или вы используете один экземпляр? Лучше поднять вопрос на [Tracka вопрос трекера] (https://github.com/payara/Payara/issues). – OndrejM
Создана проблема Payara: https://github.com/payara/Payara/issues/884 –
Проблема не возникает при запуске Payara Micro с опцией -noCluster. Поэтому, если кластеризация не требуется, это временное решение, пока проблема не будет устранена. –