Deltaspike 0.7, Primefaces 5.0, tomee 1.6.0 and NPE - jsf-2

I have a quite large web project which has been running fine with deltaspike 0.5 and the os890 #viewaccesscoped implementation.
Now, I've been trying to upgrade to DS 0.7 but have met quite a challenge.
I've tried to reproduce the error in another project but I'm not been able to get the NPE.
anyway, I was just wondering if someone has seen anything similar or could give me a hint where to start debugging:
The stacktrace:
java.lang.NullPointerException
org.apache.deltaspike.jsf.impl.injection.AbstractBeanStorage.add(AbstractBeanStorage.java:35)
org.apache.deltaspike.jsf.impl.injection.RequestDependentBeanStorage.add(RequestDependentBeanStorage.java:24)
org.apache.deltaspike.jsf.impl.injection.ManagedArtifactResolver.getContextualReference(ManagedArtifactResolver.java:87)
org.apache.deltaspike.jsf.impl.injection.ManagedArtifactResolver.resolveManagedConverter(ManagedArtifactResolver.java:53)
org.apache.deltaspike.jsf.impl.injection.InjectionAwareApplicationWrapper.managedOrDefaultConverter(InjectionAwareApplicationWrapper.java:74)
org.apache.deltaspike.jsf.impl.injection.InjectionAwareApplicationWrapper.createConverter(InjectionAwareApplicationWrapper.java:54)
org.primefaces.config.ConfigContainer.initConfig(ConfigContainer.java:100)
org.primefaces.config.ConfigContainer.<init>(ConfigContainer.java:82)
org.primefaces.context.DefaultApplicationContext.<init>(DefaultApplicationContext.java:35)
org.primefaces.context.DefaultRequestContext.getApplicationContext(DefaultRequestContext.java:227)
org.primefaces.metadata.ComponentMetadataTransformerListener.processEvent(ComponentMetadataTransformerListener.java:40)
javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2493)
org.apache.myfaces.application.ApplicationImpl.access$000(ApplicationImpl.java:120)
org.apache.myfaces.application.ApplicationImpl$SystemListenerEntry.publish(ApplicationImpl.java:2684)
org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:601)
org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:616)
javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336)
javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336)
org.apache.deltaspike.jsf.impl.injection.InjectionAwareApplicationWrapper.publishEvent(InjectionAwareApplicationWrapper.java:121)
org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:283)
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Best regards,
hw

Related

CableReady (Rails) Basic case giving mystifying error message

cable_ready 4.5.0
rails 6.1.4.1
ruby 3.0.2p107
This is a simple example from the basic tutorial (https://www.youtube.com/watch?v=F5hA79vKE_E) I suspect the error I am getting is because either cable_ready or rails evolved a little and created a tiny incompatibility.
I get this error in the JS console:
It is triggered when in my controller I ask cable ready to:
cable_ready["timeline"].console_log(message: "***** cable ready post created")
Which leads to my timeline_channel to:
received(data) {
console.log("******** Received data:", data.operations)
if (data.cableReady) CableReady.perform(data.operations)
}
My interpretation is perform causes this line in cable_ready.js line 13:
operations.forEach(function (operation) {
if (!!operation.batch) batches[operation.batch] = batches[operation.batch] ? ++batches[operation.batch] : 1;
});
Is finding something in the received data that it doesn't like.
That's where my trail ends. Can someone see what I am doing wrong, or tell me what other code you'd like me to include?
Solution: downgrade the version of the cable_ready javascript library.
I previously (maybe a year ago) did this tutorial using CableReady 4.5, Ruby 2.6.5 and Rails 6.0.4 and it worked like a charm back then as well as today.
But today, I tried this tutorial again on a duplicate project--same versions of CR, Ruby, and Rails and now I get java console errors similar to yours.
TypeError: undefined is not a function (near '...operations.forEach...')
perform -- cable_ready.js:13
received -- progress_bar_channel.js:8
I looked at the output of yarn list and saw that cable_ready was version 5.0.0-pre8 on the bad project and it was 5.0.0-pre1 on the good project. The downgrade could be accomplished with yarn add cable_ready#^5.0.0-pre1 in the bad project folder and now both projects work.
FYI for other newbies like me trying to understand how CableReady works: This tutorial gives another example of CableReady, and was also fixed the same way.

ResourceAcquisitionFailedException while creating a new node

Users of an application that I work on are reporting this particular exception with neo4j 2.1.1. This appears to be sporadic and difficult to reproduce. Is this a known issue, or is it associated with any particular misuse or error? I would love to provide more information on how to reproduce this, but I cannot.
The code that creates this stacktrace is really dead simple:
Node n = null;
try (Transaction tx = db.beginTx()) {
n = db.createNode();
// Lots of extra code snipped here because it never makes it that far...
}
The exception seems to be thrown on the createNode() method:
SEVERE: Servlet.service() for servlet [Jersey REST Service] in context with path [/plus] threw exception
org.neo4j.kernel.impl.persistence.ResourceAcquisitionFailedException: TM encountered an unexpected error condition.
at org.neo4j.kernel.impl.persistence.PersistenceManager$ResourceHolder.enlist(PersistenceManager.java:412)
at org.neo4j.kernel.impl.persistence.PersistenceManager$ResourceHolder.forWriting(PersistenceManager.java:394)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.ensureWriteTransaction(KernelTransactionImplementation.java:190)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.upgradeToDataTransaction(KernelTransactionImplementation.java:220)
at org.neo4j.kernel.impl.api.KernelStatement.dataWriteOperations(KernelStatement.java:83)
at org.neo4j.kernel.InternalAbstractGraphDatabase.createNode(InternalAbstractGraphDatabase.java:1107)
at org.mitre.provenance.db.neo4j.Neo4JStorage.store(Neo4JStorage.java:1101)
(big stack of servlet related exceptions snipped out here that)
At the bottom, there is this:
Caused by: javax.transaction.RollbackException: Tx status is: STATUS_MARKED_ROLLBACK
at org.neo4j.kernel.impl.transaction.TransactionImpl.enlistResource(TransactionImpl.java:191)
at org.neo4j.kernel.impl.persistence.PersistenceManager$ResourceHolder.enlist(PersistenceManager.java:405)
... 45 more
A lot of fixes have been applied since 2.1.1, so make sure to run on the latest stable version (2.1.4 as of today). If the problem persists on 2.1.4, consider filing a github issue at https://github.com/neo4j/neo4j/issues/new

Can't find omnifaces.GenericEnumConverter after migrating to Tomcat 7 and MyFaces 2.2

For some reason after upgrading from Tomcat 6 -> Tomcat 7 and from MyFaces 2.0 -> MyFaces 2.2 (Using OmniFaces 1.7)
I began to get the following error
javax.faces.FacesException: Could not find any registered
converter-class by converterId : omnifaces.GenericEnumConverter
at org.apache.myfaces.application.ApplicationImpl.createConverter(ApplicationImpl.java:1533)
at org.omnifaces.application.OmniApplication.createConverter(OmniApplication.java:77)
at org.apache.myfaces.view.facelets.tag.jsf.ValueHolderRule$LiteralConverterMetadata.applyMetadata(ValueHolderRule.java:50)
at org.apache.myfaces.view.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:45)
at javax.faces.view.facelets.MetaTagHandler.setAttributes(MetaTagHandler.java:63)
at javax.faces.view.facelets.DelegatingMetaTagHandler.setAttributes(DelegatingMetaTagHandler.java:90)
at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:290)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:50)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:46)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:55)
The only way that I can use the omnifaces.GenericEnumConverter right now is by adding it manually to the faces-config.xml , like this:
<converter>
<converter-id>omnifaces.GenericEnumConverter</converter-id>
<converter-class>org.omnifaces.converter.GenericEnumConverter</converter-class>
</converter>
Any ideas why? and how can I resolve it?
Thanks.
This will happen if you have
<faces-config ... metadata-complete="true">
in your webapp's /WEB-INF/faces-config.xml. This way JSF won't scan JARs for additional JSF artifacts such as #FacesConverter and so on.
Jsut remove the whole metadata-complete attribute, it defaults to false already.
Unrelated to the concrete problem, MyFaces 2.2 has internally already fixed the problem for which the OmniFaces GenericEnumConverter was been introduced as the solution. You can actually safely remove it from your code.

neo4j batch import cache type issue

I am pretty new to neo4j and facing the following issue. When executing the batch-import (Micheal Hunger - batch importer) command I get this error about the cache_type settings. It is recommending gcr settings, but these are only available in the enterprise edition.
Help is very appreciated, thanks.
System Info:
win7 32bit 4G RAM (3G usable), jre7, neo4j-community-1.8.2
Data: (very small test data)
nodes.csv (tab-separated) 13 nodes
rels.csv (tab-separated) 16 relations
Execution and Error:
C:\Daten\Studium\LV HU Berlin\SS 2013\Datamanagement and BI\Neuer Ordner>java -server -Xmx1G -jar target\batch-import-jar-with-dependencies.jar target\db nodes.csv rels.csv
Using Existing Configuration File
Exception in thread "main" java.lang.IllegalArgumentException: Bad value 'none' for setting 'cache_type': must
be one of [gcr]
at org.neo4j.helpers.Settings$DefaultSetting.apply(Settings.java:788)
at org.neo4j.helpers.Settings$DefaultSetting.apply(Settings.java:708)
at org.neo4j.graphdb.factory.GraphDatabaseSetting$SettingWrapper.apply(GraphDatabaseSetting.ja va:215)
at org.neo4j.graphdb.factory.GraphDatabaseSetting$SettingWrapper.apply(GraphDatabaseSetting.ja va:189)
at org.neo4j.kernel.configuration.ConfigurationValidator.validate(ConfigurationValidator.java: 50)
at org.neo4j.kernel.configuration.Config.applyChanges(Config.java:121)
at org.neo4j.kernel.configuration.Config.<init>(Config.java:89)
at org.neo4j.kernel.configuration.Config.<init>(Config.java:79)
at org.neo4j.unsafe.batchinsert.BatchInserterImpl.<init>(BatchInserterImpl.java:83)
at org.neo4j.unsafe.batchinsert.BatchInserterImpl.<init>(BatchInserterImpl.java:67)
at org.neo4j.unsafe.batchinsert.BatchInserters.inserter(BatchInserters.java:60)
at org.neo4j.batchimport.Importer.createBatchInserter(Importer.java:40)
at org.neo4j.batchimport.Importer.<init>(Importer.java:26)
at org.neo4j.batchimport.Importer.main(Importer.java:54)
Batch.properties:
dump_configuration=false
cache_type=none
use_memory_mapped_buffers=true
neostore.propertystore.db.index.keys.mapped_memory=5M
neostore.propertystore.db.index.mapped_memory=5M
neostore.nodestore.db.mapped_memory=200M
neostore.relationshipstore.db.mapped_memory=500M
neostore.propertystore.db.mapped_memory=200M
neostore.propertystore.db.strings.mapped_memory=200M
ran into the same problem as you and i changed the line in batch.properties
cache_type=none to cache_type=gcr and it worked. not sure about how the speed changes for this. Not sure why the other options none, soft, weak, strong are not working.
Maybe Michael can give an answer to this?
Got the answer from the neo4j documentations
http://docs.neo4j.org/chunked/stable/configuration-caches.html#_object_cache

JSF 2 OpenJPA 2 Glassfish 3.1 WEB9031 Error

I got this error which according to Apache Support is an issue relating with Glassfish rather than OpenJPA:
java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.openjpa.util.LongId], because it has not yet been started, or was already stopped
The stacktrace is:
Caused by: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.openjpa.util.LongId], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1410)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1368)
at com.ckd.model.BookModel.pcNewObjectIdInstance(BookModel.java)
at org.apache.openjpa.enhance.PCRegistry.newObjectId(PCRegistry.java:138)
at org.apache.openjpa.meta.MetaDataRepository.processRegisteredClass(MetaDataRepository.java:1693)
at org.apache.openjpa.meta.MetaDataRepository.processRegisteredClasses(MetaDataRepository.java:1643)
... 112 more
Has anyone come across this before and how to resolve it? I have been stuck on this issue for the last several days.
Another of my post related to this issue can be found here: JSF 2: h:link and getrowdata.
The above error relates to a problem with the OpenJPA enhancer. When you execute Sun's JDK the OpenJPA's dynamic enhancer starts by default. This action, in turn, stuffs up Glassfish's classloader class - hence, the WEB9031 error.
For those who experience this same issue, a simple workaround is to do the enhancement at build time - which I did in ANT with org.apache.openjpa.ant.PCEnhancerTask - and add this property to your persistence.xml to shut off the dynamic enhancer: <property name="openjpa.DynamicEnhancementAgent" value="false"/>.
Also, it wouldn't hurt to throw this in your persistence.xml as well <property name="openjpa.RuntimeUnenhancedClasses" value="unsupported" />.

Resources