Why JBoss's jsf implementation doesnt have javax.faces.model.DataModel? - jsf-2

I'm trying to migrate an app to JBoss 7.1.1 Final. I was using mojarra 2.0.2 version, as can be seen in pom.xml:
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.0.2</version>
<scope>provided</scope>
</dependency>
Using JBoss 7.1.1 Final jsf embedded version (jsf-impl-2.1.7-jbossorg-2), the AS show this Exception:
09:21:16,456 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.subunit."Projeto316Aplicacao.ear"."Projeto316Apresentacao-1.0.0-SNAPSHOT.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."Projeto316Aplicacao.ear"."Projeto316Apresentacao-1.0.0-SNAPSHOT.war".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "Projeto316Apresentacao-1.0.0-SNAPSHOT.war" of deployment "Projeto316Aplicacao.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]
Caused by: java.lang.NoClassDefFoundError: javax/faces/model/DataModel
at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.6.0_07]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) [rt.jar:1.6.0_07]
at java.lang.Class.getConstructor0(Class.java:2699) [rt.jar:1.6.0_07]
at java.lang.Class.getConstructor(Class.java:1657) [rt.jar:1.6.0_07]
at org.jboss.as.web.deployment.jsf.JsfManagedBeanProcessor.deploy(JsfManagedBeanProcessor.java:108)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: java.lang.ClassNotFoundException: javax.faces.model.DataModel from [Module "deployment.Projeto316Aplicacao.ear:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) [rt.jar:1.6.0_07]
... 11 more
Someone, please, knows why this occours and how to solve it?
Thanks

The solution for the java.lang.NoClassDefFoundError: javax/faces/model/DataModel exception in JBoss AS 7.1.1.Final is exactly what #BalusC said before:
Look like a bug in JBoss classloading:
community.jboss.org/thread/177061 If you provide JSF API/impl in
EAR/lib (which is actually the wrong place), then it's solved. –
BalusC Jan 24 at 12:09
If you are using maven, just put
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<scope>compile</scope>
</dependency>
....
<defaultLibBundleDir>lib</defaultLibBundleDir>
An another solution (It is not a good practice) is replace the jar in jboss-as-7.1.1.Final\modules\com\sun\jsf-impl\main to another implementation of jsf specification.

Related

Swagger-Springfox + WebFlux + JavaX validation (JSR 303) support

I am trying to implement Swagger for documentation, so that it picks both JSR 303 validation annotations and Spring Webflux based classes.
In Spring Boot project, I am currently using:
Spring Webflux framework for some classes
JSR 303 annotations on domain classes for Bean Validations and Constraints
Swagger integration with Spring Fox framework for generating OpenAPI documentation.
In build.gradle, following dependencies are used and I am able to make Spring Webflux + SpringFox work but only JSR 303 is giving issues:
springBootVersion = '2.0.2.RELEASE'
//JavaX-validation
'javax.validation:validation-api:2.0.0.Final',
'javax.el:javax.el-api:3.0.0',
'org.glassfish.web:javax.el:2.2.6'
//SpringFox-Swagger
'io.springfox:springfox-swagger2:2.9.2',
'io.springfox:springfox-spring-webflux:3.0.0-SNAPSHOT',
'io.github.swagger2markup:swagger2markup-gradle-plugin:1.3.3'
Here is the issue :
When below dependency is added to achieve "Spring Webflux + SpringFox + JSR 303",
**'io.springfox:springfox-bean-validators:2.9.2'**
I am getting the following error,
[WARN ] 2018-11-01 10:16:50.535 [main] SpringApplication - Unable to close ApplicationContext
java.lang.IllegalStateException: Failed to introspect Class
springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration] from ClassLoader [sun.misc.Launcher$AppClassLoader#764c12b6]
at
org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:659) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at
org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:556 ) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.ge tTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:724) ~[spring- beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at
org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:861) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at
org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:810) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
Caused by: java.lang.NoClassDefFoundError:
org/springframework/web/servlet/HandlerMapping
at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_92]
at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[?:1.8.0_92]
at java.lang.Class.getDeclaredMethods(Unknown Source) ~[?:1.8.0_92]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:641) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]
... 20 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.HandlerMapping
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_92]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_92]
Several blogs say that,SpringBoot version 2x doesn't support JSR 303. I am not sure but I tried to see it doesn't work.
Please advise.
Also, If JSR 303 is not supported currently, what other Validation annotations can be used apart from JSR 303 ?
I don't want to use Swagger core annotations, only because it is messing up code readability.
Add in your pom.xml:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
<scope>compile</compile>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-spring-webflux</artifactId>
<version>3.0.0</version>
</dependency>
And use the annotation:
#EnableSwagger2
In you swagger configuration.
Officially springfox doesn't support spring webflux(more informations you can read here: springfox issues).
But you can try SNAPSHOT version like this: webflux-swagger.
As I can see version greater than 2.3.2, support for bean validation annotations:pringfox-support-for-jsr-303.

Maven dependency issue for upgrading Neo4j from 2.2.3 to 2.3.3

I have a spring boot application which has rest call to the neo4j. I am using following maven dependency -
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j-rest</artifactId>
<version>3.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>3.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>1.10.2.RELEASE</version>
</dependency>
With Neo4j 2.2.3, Rest App was working fine. After i upgraded Neo4j to 2.3.3, Rest App is not woking. I am getting dependency issue. Maven is not able to download Neo4j 2.3.3 jars, even though i tried with latest version of artifacts for spring-data-neo4j-rest (3.4.4.RELEASE) and spring-data-neo4j(4.0.0.RELEASE).
Please let me know which artifact version of spring-data-neo4j-rest and spring-data-neo4j to use for Neo4j 2.3.3.
Here is the errors which i am getting -
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at com.tpgsi.marvin.graph.neo4j.SampleGraphApp.main(SampleGraphApp.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.boot.maven.RunMojo$LaunchRunner.run(RunMojo.java:418)
at java.lang.Thread.run(Thread.java:745)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:157)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.neo4j.core.TypeRepresentationStrategy]: Factory method 'nodeTypeRepresentationStrategy' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'typeRepresentationStrategyFactory' defined in class com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory]: Factory method 'typeRepresentationStrategyFactory' threw exception; nested exception is java.lang.RuntimeException: Error reading as JSON ''
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'typeRepresentationStrategyFactory' defined in class com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory]: Factory method 'typeRepresentationStrategyFactory' threw exception; nested exception is java.lang.RuntimeException: Error reading as JSON ''
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1119)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1014)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:322)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0.typeRepresentationStrategyFactory(<generated>)
at org.springframework.data.neo4j.config.Neo4jConfiguration.nodeTypeRepresentationStrategy(Neo4jConfiguration.java:146)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0.CGLIB$nodeTypeRepresentationStrategy$8(<generated>)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0$$FastClassBySpringCGLIB$$f1f67914.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0.nodeTypeRepresentationStrategy(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
Caused by: java.lang.RuntimeException: Error reading as JSON ''
at org.neo4j.rest.graphdb.util.JsonHelper.readJson(JsonHelper.java:57)
at org.neo4j.rest.graphdb.util.JsonHelper.jsonToSingleValue(JsonHelper.java:62)
at org.neo4j.rest.graphdb.RequestResult.toEntity(RequestResult.java:104)
at org.neo4j.rest.graphdb.RequestResult.toMap(RequestResult.java:113)
at org.neo4j.rest.graphdb.query.CypherRestResult.<init>(CypherRestResult.java:36)
at org.neo4j.rest.graphdb.RestAPIImpl.query(RestAPIImpl.java:756)
at org.neo4j.rest.graphdb.RestAPIImpl.query(RestAPIImpl.java:796)
at org.neo4j.rest.graphdb.query.RestCypherQueryEngine.query(RestCypherQueryEngine.java:50)
at org.springframework.data.neo4j.rest.SpringRestCypherQueryEngine.query(SpringRestCypherQueryEngine.java:48)
at org.springframework.data.neo4j.support.ReferenceNodes.executeQuery(ReferenceNodes.java:75)
at org.springframework.data.neo4j.support.ReferenceNodes.getReferenceNode(ReferenceNodes.java:79)
at org.springframework.data.neo4j.support.typerepresentation.SubReferenceNodeTypeRepresentationStrategy.isStrategyAlreadyInUse(SubReferenceNodeTypeRepresentationStrategy.java:95)
at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.chooseStrategy(TypeRepresentationStrategyFactory.java:52)
at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.<init>(TypeRepresentationStrategyFactory.java:35)
at org.springframework.data.neo4j.config.Neo4jConfiguration.typeRepresentationStrategyFactory(Neo4jConfiguration.java:151)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0.CGLIB$typeRepresentationStrategyFactory$2(<generated>)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0$$FastClassBySpringCGLIB$$f1f67914.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0.typeRepresentationStrategyFactory(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
Caused by: java.io.EOFException: No content to map to Object due to end of input
at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2775)
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2718)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1863)

connecting to neo4j 2.2.5 using Tinkerpop3

I have neo4j 2.2.5 community edition and java code on the same machine (windows 7), I an trying the following code to connect to neo4j (without HA)
Configuration config = new BaseConfiguration();
config.setProperty(Neo4jGraph.CONFIG_DIRECTORY, "C:\\Users\\mike\\Documents\\Neo4j");
config.setProperty("gremlin.neo4j.conf.cache_type", "none");
Graph toyGraph = Neo4jGraph.open(config);
but I am getting the following exception
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, C:\Users\mike\Documents\Neo4j
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:334)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:95)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:176)
at org.neo4j.tinkerpop.api.impl.Neo4jFactoryImpl.newGraphDatabase(Neo4jFactoryImpl.java:44)
at org.neo4j.tinkerpop.api.Neo4jFactory$Builder.open(Neo4jFactory.java:32)
at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.<init>(Neo4jGraph.java:130)
at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.open(Neo4jGraph.java:144)
at ca.concordia.orchestrator.test.TestNeo4j.main(TestNeo4j.java:33)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.KernelExtensions#7c0edd8f' failed to initialize. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:489)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:72)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:106)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:330)
... 9 more
Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/document/Fieldable
at org.neo4j.kernel.api.impl.index.NodeRangeDocumentLabelScanStorageStrategy.<init>(NodeRangeDocumentLabelScanStorageStrategy.java:71)
at org.neo4j.kernel.api.impl.index.LuceneLabelScanStoreExtension.newKernelExtension(LuceneLabelScanStoreExtension.java:73)
at org.neo4j.kernel.api.impl.index.LuceneLabelScanStoreExtension.newKernelExtension(LuceneLabelScanStoreExtension.java:39)
at org.neo4j.kernel.extension.KernelExtensions.init(KernelExtensions.java:66)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:483)
... 12 more
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.document.Fieldable
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 17 more
I have following dependencies in pom.xml
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-core</artifactId>
<version>3.0.1-incubating</version>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
<version>3.0.1-incubating</version>
</dependency>
<!-- Neo4j -->
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>neo4j-gremlin</artifactId>
<version>3.0.1-incubating</version>
</dependency>
<!-- neo4j-tinkerpop-api-impl is NOT Apache 2 licensed - more information
below -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-tinkerpop-api-impl</artifactId>
<version>0.1-2.2</version>
</dependency>
Any idea what could be the problem ? Does Thinkerpop3 work with neo4j 2.2.5?
Looks like that there are problems with dependency versions in your setup.
If you look at neo4j-tinkerpop-api-impl - you can see that there is currently release for Neo4j 2.2.5 in master. But maven central has 2.2 version.
Ensure that you are using correct version of Neo4j dependencies everywhere.
In maven dependency tree can be helpful.

Cargo remote deployment Glassfish 4.1 Fails GlassFish uses 100% CPU [duplicate]

I'm trying to deploy an app using cargo, this is the config for it:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.9</version>
<configuration>
<wait>true</wait>
<container>
<containerId>glassfish4x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.hostname>remote-IP-address</cargo.hostname>
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.password>######</cargo.remote.password>
<cargo.glassfish.admin.port>4848</cargo.glassfish.admin.port>
<cargo.glassfish.domain.name>domain1</cargo.glassfish.domain.name>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
<properties>
<context>/app</context>
</properties>
</deployable>
</deployables>
</configuration>
<dependencies>
<dependency>
<groupId>org.glassfish.deployment</groupId>
<artifactId>deployment-client</artifactId>
<version>3.2-b06</version>
</dependency>
</dependencies>
</plugin>
Unfortunately, the server throws this exception after after about 30s:
[2014-09-25T11:39:47.598+0200] [glassfish 4.1] [SEVERE] [NCLS-CORE-00003] [javax.enterprise.system.core] [tid: _ThreadID=339 _ThreadName=admin-listener(44)] [timeMillis: 1411637987598] [levelValue: 1000] [[
Exception while running a command
java.io.IOException: java.util.concurrent.TimeoutException
at org.glassfish.admin.payload.PayloadFilesManager.extractFile(PayloadFilesManager.java:584)
at org.glassfish.admin.payload.PayloadFilesManager.access$600(PayloadFilesManager.java:93)
at org.glassfish.admin.payload.PayloadFilesManager$DataRequestType$1.processPart(PayloadFilesManager.java:749)
at org.glassfish.admin.payload.PayloadFilesManager.processPartsExtended(PayloadFilesManager.java:618)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$UploadedFilesManager.extractFiles(CommandRunnerImpl.java:2074)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$UploadedFilesManager.<init>(CommandRunnerImpl.java:2046)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$UploadedFilesManager.<init>(CommandRunnerImpl.java:2025)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1155)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
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:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
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.portunif.PUFilter.handleRead(PUFilter.java:231)
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.portunif.PUFilter.handleRead(PUFilter.java:231)
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:561)
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:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: java.util.concurrent.TimeoutException
at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleRead(TCPNIOTransportFilter.java:90)
at org.glassfish.grizzly.filterchain.TransportFilter.handleRead(TransportFilter.java:173)
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.read(DefaultFilterChain.java:351)
at org.glassfish.grizzly.filterchain.FilterChainContext.read(FilterChainContext.java:695)
at org.glassfish.grizzly.portunif.BackChannelFilter.handleRead(BackChannelFilter.java:80)
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.read(DefaultFilterChain.java:351)
at org.glassfish.grizzly.filterchain.FilterChainContext.read(FilterChainContext.java:695)
at org.glassfish.grizzly.portunif.BackChannelFilter.handleRead(BackChannelFilter.java:80)
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.read(DefaultFilterChain.java:351)
at org.glassfish.grizzly.filterchain.FilterChainContext.read(FilterChainContext.java:695)
at org.glassfish.grizzly.http.io.InputBuffer.blockingRead(InputBuffer.java:1119)
at org.glassfish.grizzly.http.server.io.ServerInputBuffer.blockingRead(ServerInputBuffer.java:95)
at org.glassfish.grizzly.http.io.InputBuffer.fill(InputBuffer.java:1143)
at org.glassfish.grizzly.http.io.InputBuffer.read(InputBuffer.java:353)
at org.glassfish.grizzly.http.server.NIOInputStreamImpl.read(NIOInputStreamImpl.java:83)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at java.io.PushbackInputStream.read(PushbackInputStream.java:186)
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:238)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:193)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at org.glassfish.admin.payload.ZipPayloadImpl$Inbound$ZipEntryInputStream.read(ZipPayloadImpl.java:220)
at org.glassfish.admin.payload.PayloadFilesManager.extractFile(PayloadFilesManager.java:549)
... 46 more
Caused by: java.util.concurrent.TimeoutException
at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorReader.read(TemporarySelectorReader.java:126)
at org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorReader.read(TemporarySelectorReader.java:75)
at org.glassfish.grizzly.AbstractReader.read(AbstractReader.java:72)
at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleRead(TCPNIOTransportFilter.java:77)
... 80 more
when I'm trying to do the same localy(changing the host name), it works.The only difference between those two instances is the local is 4.0 and the remote is 4.1.
Can anyone tell me what am I doing wrong? I've tried also with setting the protocol to https by using the cargo.protocol property.
Best Regards,
Marek
I forgot to post the maven command I execute, here it is:
mvn package cargo:deploy
thanx in advance!
The bug is already tracked in JIRA as:
https://java.net/jira/browse/GLASSFISH-21180
https://java.net/jira/browse/GLASSFISH-21196
There exists a proposed solution now from oleksiys. Try replacing Grizzly with patched version from the following thread.
https://java.net/jira/browse/GRIZZLY-1713
I'm going to try it soon myself, then I'll confirm it here.
EDIT: Solution confirmed according to our own tests and also by other user in thread Cargo remote deployment Glassfish 4.1 Fails GlassFish uses 100% CPU
Direct download of patched grizzly from Oleksiy Stashok: https://dl.dropboxusercontent.com/u/7319744/glassfish-4.1/nucleus-grizzly-all.jar
Also Grizzly 2.3.16 and later fixes the bug.

How to get WrappingNeoServerBootstrapper working in Jython 2.7b3

I have an embedded neo4j database (2.1.3) that I am using with Jython 2.7b3. I would like to be able to use the web admin provided by WrappingNeoServerBootstrapper.
My current code is:
from org.neo4j.server import WrappingNeoServerBootstrapper
from org.neo4j.server.configuration import ServerConfigurator
from org.neo4j.graphdb.factory import GraphDatabaseFactory
graphDb = GraphDatabaseFactory().newEmbeddedDatabase('data/')
config = ServerConfigurator(graphDb)
WrappingNeoServerBootstrapper(graphDb, config).start()
However when I try to start WrappingNeoServerBootstrapper I get a very long stack trace which ends on:
Caused by: java.lang.ClassNotFoundException: org.neo4j.server.webadmin.rest.JmxService
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_67]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_67]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_67]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_67]
at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_67]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~[na:1.7.0_67]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[na:1.7.0_67]
at com.sun.jersey.api.core.ClassNamesResourceConfig.convertToSet(ClassNamesResourceConfig.java:118) ~[na:na]
... 51 common frames omitted
01:25:32.485 [main] WARN o.e.j.u.component.AbstractLifeCycle - FAILED org.eclipse.jetty.server.Server#53f6812e: javax.servlet.ServletException: org.neo4j.server.web.NeoServletContainer-1365105063#3cbbb0ac==org.neo4j.server.web.NeoServletContainer,-1,false
javax.servlet.ServletException: org.neo4j.server.web.NeoServletContainer-1365105063#3cbbb0ac==org.neo4j.server.web.NeoServletContainer,-1,false
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:563) ~[na:na]
at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:351) ~[na:na]
Thankful for any ideas on what I missing?
WrappingNeoServerBootstrapper is deprecated, according to this link. You won't find a word about NeoServerBootstrapper in recent manuals...
the solution should be writing extensions or plugins for neoserver.
You'll need to include these dependencies if you haven't already -
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>${neo4j.version}</version>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>${neo4j.version}</version>
<type>jar</type>
<classifier>static-web</classifier>
<scope>compile</scope>
</dependency>

Resources