I suspect that Spring-data-neo4j 2.1.0-BUILD-SNAPSHOT isn't really compatible with some versions of Scala.
I use scala 2.10.0 and using a Play! web application based on scala 2.10.0 too.
While running a test involving a Neo4jTemplate autowired by Spring, I obtain this error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'mappingInfrastructure' defined in class
org.springframework.data.neo4j.config.Neo4jConfiguration: Invocation of init method failed;
nested exception is java.lang.NoSuchMethodError:
scala.collection.JavaConverters$.mapAsScalaMapConverter(Ljava/util/Map;)Lscala/collection/JavaConverters$AsScala
Does a fix exist or would be scheduled?
Related
After refactoring some projects, I I got the following Exception when calling a scala class that implements a trait from a Spring Boot application
8/06/22 13:32:26 ERROR SpringApplication: Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'MLController' defined in URL [jar:file:/home/xxxx/environment/spark-2.2.1-bin-hadoop2.7/./xxxx/ikodaanalysis-mlserver-0.1.0.jar!/xxx/mlserver/MLController.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [xxx.mlserver.MLController]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: ikoda.utilobjects.SparkConfProviderWithStreaming.$init$(Lxxx/utilobjects/SparkConfProviderWithStreaming;)V
I checked the dependencies and everything appeared to be present in the jar.
So why was I getting the Exception?
I found the answer here. I felt it was probably a fairly common issue and worth reporting on SO.
I assume it's down to Java 8 and Scala 2.12 expecting to find the "init" method in the ScalaDsl.class file (new style Traits as interfaces) rather than in ScalaDsl$class.class file (old style Traits as interface and supporting class).
......
I think the Scala 2.12 package needs to be compiled (not just run)
under Java 8 to avoid this problem.
I added a dependency to the scala reflect library version 2.11.8 to one of my existing project such that I could use TypeTag's but strangely I face some error when running. Here is my error:
Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java (0x10a3ab4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10b4ce4e0). One of the two will be used. Which one is undefined.
Exception in thread "main" java.lang.AbstractMethodError: Method com/my/csvparser/CSVParser$.scala$App$_setter_$executionStart_$eq(J)V is abstract
at com.my.csvparser.CSVParser$.scala$App$_setter_$executionStart_$eq(CSVParser.scala)
at scala.App$class.$init$(App.scala:44)
at com.my.csvparser.CSVParser$.<init>(CSVParser.scala:13)
at com.my.csvparser.CSVParser$.<clinit>(CSVParser.scala)
at com.my.csvparser.CSVParser.main(CSVParser.scala)
Did anyone face a similar issue? My Scala version is 2.11.8
I have a Jhipster Generated with v3.4.0 (using Gradle).
I'm attempting to run and debug unit tests from STS.
From documentation:
Those tests can be run directly in your IDE, by right-clicking on each
test class, or by running mvn clean test (or ./gradlew test if you run
Gradle).
While the gradle task $.gradlew test executes as expected, when I attempt to "right click" and Run As Junit Test or Debug As Junit test - I get exceptions around the database:
Small part of stacktrace:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration':
Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire method: public void
org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.setFilterChainProxySecurityConfigurer(org.springframework.security.config.annotation.ObjectPostProcessor,java.util.List)
throws java.lang.Exception; nested exception is
org.springframework.beans.factory.BeanExpressionException: Expression
parsing failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'securityConfiguration': Injection of
autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire field: private
org.springframework.security.core.userdetails.UserDetailsService
web.myapp.core.config.SecurityConfiguration.userDetailsService;
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'userDetailsService': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire field: private web.myapp.core.repository.UserRepository
web.myapp.core.security.UserDetailsService.userRepository; nested
exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'userRepository': Cannot create inner
bean '(inner bean)#1c752902' of type
[org.springframework.orm.jpa.SharedEntityManagerCreator] while setting
bean property 'entityManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '(inner bean)#1c752902': Cannot resolve
reference to bean 'entityManagerFactory' while setting constructor
argument; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in class path
resource
[org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]:
Invocation of init method failed; nested exception is
org.hibernate.cache.NoCacheRegionFactoryAvailableException:
Second-level cache is used in the application, but property
hibernate.cache.region.factory_class is not given; please either
disable second level cache or set correct region factory using the
hibernate.cache.region.factory_class setting and make sure the second
level cache provider (hibernate-infinispan, e.g.) is available on the
classpath.
My assumption is that the correct profile for the test-database is not initialized: src/test/resources/application.yml
Any advice on setting this profile in STS?
Update
I have updated with some screen-shops per the https://jhipster.github.io/configuring-ide-eclipse-gradle/:
No Resource Filters Project Properties > Resource > Resource Filters (none were added by STS when I imported the project
Checked to make sure the build/generated/source/apt/main is added to my Java Build Path settings under Project Properties > Java Build Path
I had the same problem and this is how I got it working:
1. You need to initially run the test at least once as part of the gradle build task before you can then run it interactively with JUnit
2. JHipster generates the build.gradle file by default to only run tests that are named *UnitTest or *IntTest. If you have this default configuration, but have named your test differently, then step 1 above won't work because although the build may complete successfully it hasn't actually run your test and as a result it still can't be run in JUnit.
3. Follow the steps given in the screenshots that have been added above as an update to the original question.
Now trying running as JUnit Test.
I'm trying to integrate Spring Boot Vaadin (https://github.com/peholmst/vaadin4spring) with Vaadin's Dashboard Demo Code (https://github.com/vaadin/dashboard-demo). The only thing modification I made was add the annotation "#VaadinUI" in the DashboardUI class. I checked in my code using the branch "integrate-vaadin-dashboard-demo-project".
I get the error message:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider.
I'm not really sure what the message means. Can somebody explain it and come up with a resolution to the error message?
Gist Error Output:
https://gist.github.com/anonymous/43d602c1105e00d4d7d6
Clone Url:
https://github.com/caritos/pangolin.git
Branch:
integrate-vaadin-dashboard-demo-project
You pack javax validation api 1.0 in your jar. This is the version the GWT compiler needs (when you build a widgetset). But spring-boot depends on version 1.1. Usually the problem is the other way around...
Eclipse Platform.getOS is throwing null Pointer Exception.
Even any kind of operation with Platform is throing exception.
Exception in thread "main"
java.lang.NullPointerException at
org.eclipse.core.internal.runtime.InternalPlatform.getOS(InternalPlatform.java:454)
at
org.eclipse.core.runtime.Platform.getOS(Platform.java:1185)
at Test.main(Test.java:6)
Are you running your classes on top of OSGi or just accessing the Platform class within a plain java application?