SRVE0777E: Exception thrown by application class 'org.apache.wink.common.internal.http.Accept.valueOf:139' - apache-wink

I'm hitting the following exception in my JAX-RS service on WLP 8.5.5 ApacheWink
(WebSphere Application Server 8.5.5.0/wlp-1.0.3.20130510-0831)
#POST
#Path("hello")
#Consumes(MediaType.APPLICATION_JSON)
public Response sayhello(Hello hi) {
String obj = "hello received";
return Response.ok().entity(obj).build();
}
Exception
[AUDIT ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.
[WARNING ] SRVE9967W: The manifest class path jaxb-api.jar can not be found in jar file wsjar:file:/C:/apps/wlp/usr/servers/defaultServer/dropins/WasLibertyJaxRS-1.0-SNAPSHOT.war!/WEB-INF/lib/jaxb-impl-2.2.3-1.jar or its parent.
[WARNING ] SRVE9967W: The manifest class path activation.jar can not be found in jar file wsjar:file:/C:/apps/wlp/usr/servers/defaultServer/dropins/WasLibertyJaxRS-1.0-SNAPSHOT.war!/WEB-INF/lib/jaxb-impl-2.2.3-1.jar or its parent.
[WARNING ] SRVE9967W: The manifest class path jsr173_1.0_api.jar can not be found in jar file wsjar:file:/C:/apps/wlp/usr/servers/defaultServer/dropins/WasLibertyJaxRS-1.0-SNAPSHOT.war!/WEB-INF/lib/jaxb-impl-2.2.3-1.jar or its parent.
[WARNING ] SRVE9967W: The manifest class path jaxb1-impl.jar can not be found in jar file wsjar:file:/C:/apps/wlp/usr/servers/defaultServer/dropins/WasLibertyJaxRS-1.0-SNAPSHOT.war!/WEB-INF/lib/jaxb-impl-2.2.3-1.jar or its parent.
[WARNING ] SRVE9967W: The manifest class path jaxb-api.jar can not be found in jar file wsjar:file:/C:/apps/wlp/usr/servers/defaultServer/dropins/WasLibertyJaxRS-1.0-SNAPSHOT.war!/WEB-INF/lib/jaxb-impl-2.2.3-1.jar or its parent.
[WARNING ] SRVE9967W: The manifest class path activation.jar can not be found in jar file wsjar:file:/C:/apps/wlp/usr/servers/defaultServer/dropins/WasLibertyJaxRS-1.0-SNAPSHOT.war!/WEB-INF/lib/jaxb-impl-2.2.3-1.jar or its parent.
[WARNING ] SRVE9967W: The manifest class path jsr173_1.0_api.jar can not be found in jar file wsjar:file:/C:/apps/wlp/usr/servers/defaultServer/dropins/WasLibertyJaxRS-1.0-SNAPSHOT.war!/WEB-INF/lib/jaxb-impl-2.2.3-1.jar or its parent.
[WARNING ] SRVE9967W: The manifest class path jaxb1-impl.jar can not be found in jar file wsjar:file:/C:/apps/wlp/usr/servers/defaultServer/dropins/WasLibertyJaxRS-1.0-SNAPSHOT.war!/WEB-INF/lib/jaxb-impl-2.2.3-1.jar or its parent.
[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/WasLibertyJaxRS-1.0-SNAPSHOT/
[AUDIT ] CWWKZ0001I: Application WasLibertyJaxRS-1.0-SNAPSHOT started in 3.589 seconds.
[ERROR ] An unhandled exception occurred which will be propagated to the container.
java.lang.NullPointerException
[ERROR ] SRVE0777E: Exception thrown by application class 'org.apache.wink.common.internal.http.Accept.valueOf:139'
java.lang.NullPointerException
at org.apache.wink.common.internal.http.Accept.valueOf(Accept.java:139)
at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptHeader(HttpHeadersImpl.java:151)
at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptableMediaTypes(HttpHeadersImpl.java:105)
at org.apache.wink.server.internal.registry.ResourceRegistry.filterByProduces(ResourceRegistry.java:573)
at org.apache.wink.server.internal.registry.ResourceRegistry.filterDispatchMethods(ResourceRegistry.java:497)
at org.apache.wink.server.internal.registry.ResourceRegistry.findSubResourceMethod(ResourceRegistry.java:391)
at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceMethod(FindResourceMethodHandler.java:168)
at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:110)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.handlers.FindRootResourceHandler.handleRequest(FindRootResourceHandler.java:95)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.handlers.HeadMethodHandler.handleRequest(HeadMethodHandler.java:53)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.handlers.OptionsMethodWADLHandler.handleRequest(OptionsMethodWADLHandler.java:51)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.handlers.SearchResultHandler.handleRequest(SearchResultHandler.java:33)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.log.ResourceInvocation.handleRequest(ResourceInvocation.java:92)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.log.Requests.handleRequest(Requests.java:76)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.handlers.AbstractHandlersChain.run(AbstractHandlersChain.java:60)
at org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:207)
at org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)
at org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1240)
at [internal classes]
[ERROR ] SRVE0315E: An execption occurred: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: java.lang.NullPointerException
at org.apache.wink.common.internal.http.Accept.valueOf(Accept.java:139)
at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptHeader(HttpHeadersImpl.java:151)
at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptableMediaTypes(HttpHeadersImpl.java:105)
at org.apache.wink.server.internal.registry.ResourceRegistry.filterByProduces(ResourceRegistry.java:573)
at org.apache.wink.server.internal.registry.ResourceRegistry.filterDispatchMethods(ResourceRegistry.java:497)
at org.apache.wink.server.internal.registry.ResourceRegistry.findSubResourceMethod(ResourceRegistry.java:391)
at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceMethod(FindResourceMethodHandler.java:168)
at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:110)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.handlers.FindRootResourceHandler.handleRequest(FindRootResourceHandler.java:95)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.handlers.HeadMethodHandler.handleRequest(HeadMethodHandler.java:53)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.handlers.OptionsMethodWADLHandler.handleRequest(OptionsMethodWADLHandler.java:51)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.handlers.SearchResultHandler.handleRequest(SearchResultHandler.java:33)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.log.ResourceInvocation.handleRequest(ResourceInvocation.java:92)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.internal.log.Requests.handleRequest(Requests.java:76)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:75)
at org.apache.wink.server.handlers.AbstractHandlersChain.run(AbstractHandlersChain.java:60)
at org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:207)
at org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)
at org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1240)
at [internal classes]
Caused by: java.lang.NullPointerException
... 43 more

From the stack trace, it looks like an Accept header was not sent by the client. However, NullPointerException is never an appropriate error for the server in my opinion, so I recommend opening a PMR with IBM.

I was missing the following JSOn config in my Jersey Client
ClientConfig config = new DefaultClientConfig();
config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
client = Client.create(config);

I've seen a similar exception when you have your own wink implementation and jars with the application. Resolve it by either
Removing the jax-rs feature from your server.xml - it conflicts with the libraries in the application.
OR
Configure the JAX-RS application according to the WebSphere spec, and remove wink jars from your application
http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.multiplatform.doc/ae/twbs_jaxrs_implejaxrsapps_step3.html

Related

Omnifaces ValidateOrder throws null pointer exception when end date is null

I am using omnifaces validate order component in JSF application to validate start date and end date similar to one show cased. But, when end date is null in my application this throws null pointer exception below. How to handle this.
<app:calendar label="#{msg['gang.effectiveDate']}" property="effectiveDate" required="true"/>
<app:calendar label="#{msg['gang.expiryDate']}" property="expiryDate"/>
<o:validateOrder id="order" type="lte" components="effectiveDate expiryDate"
message="#{msg['startdate.lte.enddate']}" showMessageFor="effectiveDate" />
Exception thrown
java.lang.NullPointerException
at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:290)
at java.util.ComparableTimSort.sort(ComparableTimSort.java:157)
at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
at java.util.Arrays.sort(Arrays.java:472)
at java.util.Collections.sort(Collections.java:155)
at org.omnifaces.component.validator.ValidateOrder$Type$2.invoke(ValidateOrder.java:75)
at org.omnifaces.component.validator.ValidateOrder$Type$2.invoke(ValidateOrder.java:71)
at org.omnifaces.component.validator.ValidateOrder$Type.validateOrder(ValidateOrder.java:105)
at org.omnifaces.component.validator.ValidateOrder.validateValues(ValidateOrder.java:141)
at org.omnifaces.component.validator.ValidateMultipleFields.validateComponents(ValidateMultipleFields.java:187)
at org.omnifaces.component.validator.ValidatorFamily.processValidators(ValidatorFamily.java:63)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at org.primefaces.component.panel.Panel.processValidators(Panel.java:287)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIForm.processValidators(UIForm.java:253)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at org.primefaces.component.dialog.Dialog.processValidators(Dialog.java:385)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1195)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
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 org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at
You can either check for expiryDate value before submit to prevent nullPointerException or add this code to your <o:validateOrder> to disable it when expiryDate is null :
<o:validateOrder ... disabled="#{empty param['yourForm:yourNullableField']}" />
See : OmniFaces validateOrder disabling

Spring data neo4j 3 with embedded neo 2

im working on my scaffold and i can't seem to get Neo embedded to initialize. I am using Neo 2, so I am running spring data 3.0.0.m1. I can't get it to light up. Here is my context
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<context:annotation-config/>
<context:spring-configured />
<context:component-scan base-package="com.onuspride.wisdom" />
<tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/>
<import resource="spring-data-Neo4j.xml" />
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager">
<bean id="jotm" class="org.springframework.data.neo4j.transaction.JotmFactoryBean"/>
</property>
</bean>
<bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase" destroy-method="shutdown">
<constructor-arg value="target/test-db"/>
<constructor-arg>
<map>
<entry key="tx_manager_impl" value="spring-jta"/>
</map>
</constructor-arg>
</bean>
</beans>
But i get this exception
Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphDatabaseService' defined in class path resource [applicationContext.xml]: Unsatisfied dependency expressed through constructor argument with index 2 of type [java.lang.Iterable]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:724)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1075)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:979)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
I can't find anything anywhere saying there are more constructor parameters.
here's my dependencies
akka = '2.2.3'
akkaSeries = '_2.10'
apacheLog4jVersion = '2.0-beta9'
aspectjVersion = '1.7.2'
cglibVersion = '2.2.2'
commonsCodecVersion = '1.5'
commonsDigesterVersion = '2.1'
commonsFileuploadVersion = '1.3'
commonsLang3Version = '3.1'
elApiVersion = '1.0'
fasterxmlJacksonVersion = '2.3.0'
flexJsonVersion = '2.1'
ginVersion = '2.0.0'
googleAPIClient = '1.17.0-rc'
googleAPIDrive = 'v2-rev110-1.17.0-rc'
googleAPIOauth2 = 'v2-rev59-1.17.0-rc'
googleJackson = '1.15.0-rc'
guavaVersion = '14.0.1'
guiceVersion = '3.0'
gwtpVersion = '1.0.3'
gwtqueryVersion = '1.3.2'
gwtsecurityVersion = '1.2.3'
gwtVersion = '2.5.1'
hamcrestDateVersion = '0.9.5'
hibernateValidator = '5.0.2.Final'
ioSpray = '1.2.0'
javaxServletVersion = '3.0.1'
jedisVersion = '2.1.0'
jettyVersion = '9.1.0.v20131115'
jodaTimeVersion = '1.6'
json4sVersion = '3.2.6'
jspApiVersion = '2.1'
jstlApiVersion = '1.2'
jukitoVersion = '1.1'
junitVersion = '4.11'
lmaxDistruptorVersion = '3.2.0'
neo4jVersion = '2.0.0'
persistenceApiVersion = '1.0'
scalaLangVersion = '2.10.2'
slf4jVersion = '1.7.5'
socialSigninTwitterVersion = '1.1.0-SNAPSHOT'
//springDataNeo4jVersion = '2.3.3.RELEASE'
springDataNeo4jVersion = '3.0.0.M1'
springDataRedis = '1.1.0.RELEASE'
springJsResourcesVerison = '2.3.2.RELEASE'
springJsVersion = '2.3.2.RELEASE'
springScalaVersion = '1.0.0.RC1'
springSecurityVersion = '3.2.0.RELEASE'
springSocialGoogleVersion = '1.0.0.M3'
springSocialVersion = '1.1.0.M4'
springVersion = '3.2.6.RELEASE'
tilesJspVersion = '2.2.2'
compile "com.lmax:disruptor:$lmaxDistruptorVersion"
compile "com.typesafe.akka:akka-actor$akkaSeries:$akka"
compile "com.typesafe.akka:akka-slf4j$akkaSeries:$akka"
compile "io.spray:spray-can:$ioSpray"
compile "io.spray:spray-routing:$ioSpray"
compile "joda-time:joda-time:$jodaTimeVersion"
compile "org.apache.logging.log4j:log4j-api:$apacheLog4jVersion"
compile "org.apache.logging.log4j:log4j-core:$apacheLog4jVersion"
compile "org.apache.logging.log4j:log4j-slf4j-impl:$apacheLog4jVersion"
compile "org.hibernate:hibernate-validator:$hibernateValidator"
compile "org.json4s:json4s-native_2.10:$json4sVersion"
compile "org.scala-lang:scala-library:$scalaLangVersion"
compile "org.springframework.data:spring-data-neo4j-aspects:$springDataNeo4jVersion"
compile "org.springframework.data:spring-data-neo4j-tx:$springDataNeo4jVersion"
compile "org.springframework.data:spring-data-neo4j:$springDataNeo4jVersion"
compile "org.springframework.scala:spring-scala_2.10:$springScalaVersion"
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-aspects:$springVersion"
compile "org.springframework:spring-context:$springVersion"
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework:spring-tx:$springVersion"
compile group: 'org.neo4j', name: 'neo4j', version: "$neo4jVersion"
compile group: 'org.neo4j.app', name: 'neo4j-server', version: "$neo4jVersion", classifier: 'static-web'
testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-all:1.9.5"
testCompile "org.springframework:spring-test:$springVersion"
Spring Data Neo4j 3.0.M1 only works with Neo4j 2.0.0-M06
The next milestone is almost ready, which then will work with Neo4j 2.0.0
I had the same problem. Changing spring-data.xml to the following helped resolve the issue...
<tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/>
<bean class="org.springframework.data.neo4j.config.Neo4jConfiguration"/>
<bean class="org.springframework.context.annotation.ConfigurationClassPostProcessor"/>
<bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase"
destroy-method="shutdown" scope="singleton">
</bean>
<bean id="serverWrapper" class="org.neo4j.server.WrappingNeoServerBootstrapper" init-method="start" destroy-method="stop">
<constructor-arg index="0" ref="graphDatabaseService"/>
</bean>
<neo4j:config storeDirectory="target/db/data"/>
<neo4j:repositories base-package="org.example.repository"/>

Error Inflating Mvx.MvxImageView

I am having a problem with inflating MvxImageView inside a custom control.
from the research I did I found several suspects
Should I add if so to what? (i saw this in regards to the android map view inflate error.
Am I creating the User control all wrong? I saw a recommendation to use SetContentView() instead of inflate because it passes the indlate request through the mvvmcross mechanisem but there is no such method in a custom view.
Here is the custom control layout:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res/Com.TasteITAndroidClient"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Mvx.MvxImageView android:scaleType="centerCrop"
android:id="#+id/Image"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
And here is the UserControl implementation:
public class UserControl : LinearLayout
{
public UserControl(Context context, IAttributeSet attrs) : base(context,attrs)
{
LayoutInflater inflater = LayoutInflater.From(context);
inflater.Inflate (Resource.Layout.UserControl, this);
}
}
Here is where I am using it:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="#+id/myButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/hello" />
<TestApp.UserControl
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
I am getting the following exception:
Android.Views.InflateException: Binary XML file line #1: Error inflating class Mvx.MvxImageView
at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00024] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/9486a4ec/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:145
at Android.Views.LayoutInflater.Inflate (int,Android.Views.ViewGroup) [0x00043] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/9486a4ec/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.Views.LayoutInflater.cs:422
at TestApp.UserControl..ctor (Android.Content.Context,Android.Util.IAttributeSet) [0x00011] in c:\Users\Amit\Documents\Projects\TestApp\TestApp\UserControl.cs:20
at at (wrapper dynamic-method) object.bd915d4e-f205-49cd-a1e8-a0532b2db313 (intptr,object[])
at Java.Interop.TypeManager.n_Activate (intptr,intptr,intptr,intptr,intptr,intptr) [0x00070] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/9486a4ec/source/monodroid/src/Mono.Android/src/Java.Interop/TypeManager.cs:141
at at (wrapper native-to-managed) Java.Interop.TypeManager.n_Activate (intptr,intptr,intptr,intptr,intptr,intptr)
at at (wrapper managed-to-native) object.wrapper_native_0x40819b9d (intptr,intptr,intptr,Android.Runtime.JValue[]) <0x00047>
at at (wrapper delegate-invoke) .invoke_intptr_this__intptr_intptr_intptr_JValue[] (intptr,intptr,intptr,Android.Runtime.JValue[])
at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00005] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/9486a4ec/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:141
at Android.Views.LayoutInflater.Inflate (int,Android.Views.ViewGroup) [0x00043] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/9486a4ec/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.Views.LayoutInflater.cs:422
at Cirrious.MvvmCross.Binding.Droid.BindingContext.MvxAndroidBindingContext.CommonInflate (int,Android.Views.ViewGroup,Cirrious.MvvmCross.Binding.Droid.Binders.MvxBindingLayoutInflatorFactory) [0x0003c] in c:\Projects\Misc\MVVMCROSS\Cirrious\Cirrious.MvvmCross.Binding.Droid\BindingContext\MvxAndroidBindingContext.cs:58
at Cirrious.MvvmCross.Binding.Droid.BindingContext.MvxAndroidBindingContext.BindingInflate (int,Android.Views.ViewGroup) [0x00001] in c:\Projects\Misc\MVVMCROSS\Cirrious\Cirrious.MvvmCross.Binding.Droid\BindingContext\MvxAndroidBindingContext.cs:37
at Cirrious.MvvmCross.Binding.Droid.BindingContext.MvxBindingContextOwnerExtensions.BindingInflate (Cirrious.MvvmCross.Binding.BindingContext.IMvxBindingContextOwner,int,Android.Views.ViewGroup) [0x0000d] in c:\Projects\Misc\MVVMCROSS\Cirrious\Cirrious.MvvmCross.Binding.Droid\BindingContext\MvxBindingContextOwnerExtensions.cs:18
at Cirrious.MvvmCross.Droid.Views.MvxActivity.SetContentView (int) [0x00001] in c:\Projects\Misc\MVVMCROSS\Cirrious\Cirrious.MvvmCross.Droid\Views\MvxActivity.cs:51
at TestApp.Main.InnerViewModelSet () [0x00001] in c:\Users\Amit\Documents\Projects\TestApp\TestApp\MainActivity.cs:21
at at TestApp.BaseActivity1<TestApp.LoginPageViewModel>.OnViewModelSet () <0x00087>
at Cirrious.MvvmCross.Droid.Views.MvxActivity.set_ViewModel (Cirrious.MvvmCross.ViewModels.IMvxViewModel) [0x00009] in c:\Projects\Misc\MVVMCROSS\Cirrious\Cirrious.MvvmCross.Droid\Views\MvxActivity.cs:38
at Cirrious.MvvmCross.Views.MvxViewExtensionMethods.OnViewCreate (Cirrious.MvvmCross.Views.IMvxView,System.Func1) [0x00055] in c:\Projects\Misc\MVVMCROSS\Cirrious\Cirrious.MvvmCross\Views\MvxViewExtensionMethods.cs:35
at Cirrious.MvvmCross.Droid.Views.MvxActivityViewExtensions.OnViewCreate (Cirrious.MvvmCross.Droid.Views.IMvxAndroidView,Android.OS.Bundle) [0x0006b] in c:\Projects\Misc\MVVMCROSS\Cirrious\Cirrious.MvvmCross.Droid\Views\MvxActivityViewExtensions.cs:50
at Cirrious.MvvmCross.Droid.Views.MvxActivityAdapter.EventSourceOnCreateCalled (object,Cirrious.CrossCore.Core.MvxValueEventArgs1<Android.OS.Bundle>) [0x00001] in c:\Projects\Misc\MVVMCROSS\Cirrious\Cirrious.MvvmCross.Droid\Views\MvxActivityAdapter.cs:85
at at (wrapper delegate-invoke) System.EventHandler11<Android.OS.Bundle>>.invoke_void__this___object_TEventArgs (object,Cirrious.CrossCore.Core.MvxValueEventArgs1) <0x00067>
at at Cirrious.CrossCore.Droid.Views.MvxDelegateExtensionMethods.Raise (System.EventHandler1<Cirrious.CrossCore.Core.MvxValueEventArgs1>,object,Android.OS.Bundle) <0x00113>
at Cirrious.CrossCore.Droid.Views.MvxEventSourceActivity.OnCreate (Android.OS.Bundle) [0x00009] in c:\Projects\Misc\MVVMCROSS\CrossCore\Cirrious.CrossCore.Droid\Views\MvxEventSourceActivity.cs:23
at at TestApp.BaseActivity`1.OnCreate (Android.OS.Bundle) <0x0005b>
at TestApp.Main.OnCreate (Android.OS.Bundle) [0x00001] in c:\Users\Amit\Documents\Projects\TestApp\TestApp\MainActivity.cs:16
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/9486a4ec/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.App.Activity.cs:1561
at at (wrapper dynamic-method) object.302eab70-b743-4322-bd6e-c04ded2426ec (intptr,intptr,intptr)
at
at --- End of managed exception stack trace ---
at android.view.InflateException: Binary XML file line #1: Error inflating class Mvx.MvxImageView
at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
at at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at at mono.android.TypeManager.n_activate(Native Method)
at at mono.android.TypeManager.Activate(TypeManager.java:7)
at at testapp.UserControl.(UserControl.java:29)
at at java.lang.reflect.Constructor.constructNative(Native Method)
at at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at at testapp.Main.n_onCreate(Native Method)
at at testapp.Main.onCreate(Main.java:28)
at at android.app.Activity.performCreate(Activity.java:5104)
at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at at android.app.ActivityThread.access$600(ActivityThread.java:141)
at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at at android.os.Handler.dispatchMessage(Handler.java:99)
at at android.os.Looper.loop(Looper.java:137)
at at android.app.ActivityThread.main(ActivityThread.java:5039)
at at java.lang.reflect.Method.invokeNative(Native Method)
at at java.lang.reflect.Method.invoke(Method.java:511)
at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at at dalvik.system.NativeStart.main(Native Method)
at Caused by: java.lang.ClassNotFoundException: Didn't find class "Mvx.MvxImageView" on path: /data/app/TestApp.TestApp-1.apk
at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at at android.view.LayoutInflater.createView(LayoutInflater.java:552)
at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at ... 31 more
at
I'm confused about what you are doing - you seem to be trying to inflate data-bound objects inside a non-data-bound environment.
These two tutorials on using sub-controls may help:
Writing custom Android controls in MvvmCross is covered in N=18 in https://mvvmcross.wordpress.com/
Using fragments and the MvxFrameControl in MvvmCross is covered in N=26 in https://mvvmcross.wordpress.com/
Alternatively, as your layout has no custom functionality - it's just XML - then maybe you could consider just using an Android <include> xml block? See http://developer.android.com/training/improving-layouts/reusing-layouts.html

java.lang.IllegalArgumentException: No SqlMapClient specified

I'm trying to JUnit a DAO which accesses iBatis. The problem is iBatis cannot read SqlMapClient although I specified it in applicationContext.xml. So I tried to set full path for it but I still get errors.
applicationContext.xml
<!-- Sql Map Client -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="file:C:/workspace/MyProject/WebContent/WEB-INF/sqlMapConfig.xml" />
<property name="dataSource" ref="dataSource"/>
</bean>
JUnit Code
#RunWith(SpringJUnit4ClassRunner.class)
#ContextConfiguration(
locations={
"file:C:/workspace/MyProject/WebContent/WEB-INF/sqlMapConfig.xml",
"file:C:/workspace/MyProject/WebContent/WEB-INF/applicationContext.xml",
"file:C:/workspace/MyProject/WebContent/WEB-INF/dataSource.xml",
}
)
// This doesn't work
//locations={
//"classpath:/WEB-INF/sqlMapConfig.xml",
//"classpath:/WEB-INF/applicationContext.xml",
//"classpath:/WEB-INF/dataSource.xml",
//}
public class ProductDaoTest {
/**
* Run the List<Product> getProductList(Product) method test.
*
* #throws Exception
*
* #generatedBy CodePro at 7/1/13 10:55 AM
*/
#Test
public void testGetProductList()
throws Exception {
ProductDao fixture = new ProductDao();
Product product = new Product();
List<Product> result = fixture.getProductList(product);
assertNotNull(result);
}
}
I get this error
java.lang.IllegalArgumentException: No SqlMapClient specified
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:166)
at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:296)
at net.rcba.dao.BrandDao.getBrandRankingSumViewList(BrandDao.java:19)
at net.rcba.dao.BrandDaoTest.testGetBrandRankingSumViewList_1(BrandDaoTest.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
I guess the error maybe in
ProductDao fixture = new ProductDao();
try to change it to
WebApplicationContext wac = WebApplicationContextUtils.
getRequiredWebApplicationContext( config.getServletContext());
ProductDao fixture = (ProductDao) wac.getBean("ProductDao" );

grails: add context to embedded tomcat in development

In production I have setup an external folder to upload and display
images from by editing server.xml:
<Service name="Catalina">
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context docBase="/opt/winmail_storage/imgs" path="/imgs"/>
</Host>
</Engine>
</Service>
I am trying to do the same thing in development by editing _Events.groovy :
eventConfigureTomcat = {tomcat ->
def ctx = tomcat.addContext("/imgs" , "/tmp/images")
}
I also tried
eventConfigureTomcat = {tomcat ->
def ctx = tomcat.addContext("/appName/imgs" , "/tmp/images")
}
this is not working, the imgs directory is not accessible via :
http://host/appName/imgs any idea how I can do this correctly?
finally got it thanks to the grails mailing list:
eventConfigureTomcat = {tomcat ->
def context = tomcat.addWebapp('/acrm/imgs' , '/tmp/images')
def loader = new WebappLoader(tomcat.class.classLoader)
loader.addRepository(new File('/home/mohadib/workspace/acrm/lib').toURI().toURL().toString())
loader.container = context
context.loader = loader
}

Resources