I'm trying to get Elasticsearch working in my Grails project. I'm using the Java Rest High-level client in Elasticsearch documented here [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/java-rest-high-getting-started-maven.html]. I'm using Elasticsearch 6.3.2 version, Java 8, Grails 2.4.4
I have created a service class and added an import statement at the beginning of the file. For eg: import org.elasticsearch.ElasticsearchException
And, when I start Grails I get the error below. But if I remove that import statement the application runs fine. So, what's happening in the import ?
Sep 12, 2018 3:05:29 PM org.springsource.loaded.agent.SpringLoadedPreProcessor preProcess
SEVERE: Unexpected problem transforming call sites
java.lang.IllegalStateException: Unexpected problem processing bytes for class
at org.springsource.loaded.ConstantPoolChecker2.readConstantPool(ConstantPoolChecker2.java:196)
at org.springsource.loaded.ConstantPoolChecker2.<init>(ConstantPoolChecker2.java:128)
at org.springsource.loaded.ConstantPoolChecker2.getReferences(ConstantPoolChecker2.java:102)
at org.springsource.loaded.MethodInvokerRewriter.rewrite(MethodInvokerRewriter.java:300)
at org.springsource.loaded.MethodInvokerRewriter.rewriteUsingCache(MethodInvokerRewriter.java:156)
at org.springsource.loaded.TypeRegistry.methodCallRewriteUseCacheIfAvailable(TypeRegistry.java:828)
Caused by: java.lang.IllegalStateException: Entry: 14 18
at org.springsource.loaded.ConstantPoolChecker2.processConstantPoolEntry(ConstantPoolChecker2.java:335)
at org.springsource.loaded.ConstantPoolChecker2.readConstantPool(ConstantPoolChecker2.java:186)
So, can someone help me understand what's happening here?
Thanks.
I got this error in versions of Java later than Java 7, but was able to get it to work in Java 7
Related
I am trying to get Cassandra v2.1.17 running using Java 11 (Oracle), but cannot get it to startup. I have updated all the JVM args in cassandra-env.sh to the Java 11 equivalents, but I now get the following error on startup:
ERROR 14:48:10 Exception encountered during startup
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: sun.misc.Unsafe.monitorEnter(Ljava/lang/Object;)V
at com.google.common.base.Throwables.propagate(Throwables.java:160) ~[guava-16.0.jar:na]
...
...
...
Caused by: java.lang.NoSuchMethodError: sun.misc.Unsafe.monitorEnter(Ljava/lang/Object;)V
I have done a good bit of looking about and it seems that this class was removed in Java 9, or at least deprecated, but was still accessible using --add-modules=jdk.unsupported. Adding this to my JVM args didn't help.
Is it possible to run Cassandra 2.1.17 on Oracle Java 11? I can see that the class is still in OpenJDK 11 (https://hg.openjdk.java.net/jdk/jdk11/file/6889f13694c6/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java) but I am stuck using Centos6 and cannot find an install for it.
#MeanwhileInHell, JDK 11 support for Apache Cassandra(R) was explored in the recent Cassandra 4.0 version only and I don't think it's available in very older and unsupported versions like 2.x. Please see https://cassandra.apache.org/doc/latest/cassandra/new/java11.html documentation for additional details.
https://issues.apache.org/jira/browse/CASSANDRA-9608 has details.
I'm working with a piece of code that's quite old. It works absolutely fine with the versions of Java older than 8u161.
This is the error I get on 8u161 and beyond releases.
[main] ******** - Failed to create JmxConnectInfo!
java.lang.AbstractMethodError
at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:150)
at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:135)
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:405)
This error is triggered from a class that extends javax.management.remote.rmi.RMIConnectorServer where I invoke the code
super.start()
I'm sure that this error is caused by JDK-8159377 but I'm unable to figure a way out!
Can someone pls advise?
Trying to interact with Google Cloud Bigtable via Java lib and after successfully creating connection object, send "list" command and I am getting the following error for command.run() method:
command.run(connection, argsList.subList(1, argsList.size()));
specifically:
Jul 06, 2015 1:12:15 PM io.grpc.transport.netty.ProtocolNegotiators$AbstractBufferingHandler fail
SEVERE: Transport failed during protocol negotiation
io.netty.channel.ChannelPipelineException: io.grpc.transport.netty.ProtocolNegotiators$1$1.handlerAdded() has thrown an exception; removed.
at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:600)
at io.netty.channel.DefaultChannelPipeline.callHandlerAdded(DefaultChannelPipeline.java:582)
at io.netty.channel.DefaultChannelPipeline.addFirst0(DefaultChannelPipeline.java:124)
at io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:108)
at io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:291)
at io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:246)
at io.grpc.transport.netty.ProtocolNegotiators$AbstractBufferingHandler.channelRegistered(ProtocolNegotiators.java:233)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelRegisteredNow(ChannelHandlerInvokerUtil.java:32)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRegistered(DefaultChannelHandlerInvoker.java:50)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRegistered(AbstractChannelHandlerContext.java:114)
at io.netty.channel.DefaultChannelPipeline.fireChannelRegistered(DefaultChannelPipeline.java:833)
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:487)
at io.netty.channel.AbstractChannel$AbstractUnsafe.access$100(AbstractChannel.java:401)
at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:461)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:322)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:356)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:703)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: NPN/ALPN extensions not installed
Just following;https://cloud.google.com/bigtable/docs/samples-simple-cli
Any help would be highly appreciated!
It is necessary to modify your eclipse java run to load the alpn-boot jar in front of all other classes / jars. Using the line:
-Xbootclasspath/p:$(pwd)/lib/bigtable/alpn-boot-${ALPN_VERSION}.jar
For more information, see ALPN.
For Unit Testing in Maven, you can look at our example
UPDATE You can now work w/o alpn-boot by using the Netty TCNative jar w/ BoringSSL we have two examples with that currently, the Managed-VM-Sample and the Quickstart. See the pom.xml for the details, the MVM sample shows how to setup your pom to compile locally and deploy. The Quickstart pom shows a compile and run on the same machine form. We hope to have all the Java samples using this soon.
Our J2EE/Spring/Mybatis web application has been running fine for some time on Java 7 (on Centos), but recently we tried updating our JVM to Java 8, and now we get the following stack-trace on start up:
java.lang.RuntimeException: XPathFactory#newInstance()
failed to create an XPathFactory for the default object model:
http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException:
java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory:jar:file:/usr/local/tomcats
/test/webapps/tms/WEB-INF/lib/saxon-xpath-8.7.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax
at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:102)
at org.apache.ibatis.parsing.XPathParser.commonConstructor(XPathParser.java:261)
at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:121)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:75)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:70)
at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.loadXmlResource(MapperAnnotationBuilder.java:158)
at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parse(MapperAnnotationBuilder.java:113)
at org.apache.ibatis.binding.MapperRegistry.addMapper(MapperRegistry.java:66)
at org.apache.ibatis.session.Configuration.addMapper(Configuration.java:651)
at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:97)
our Saxon9.jar version = 9.1.0.8 (latest).
There are many different jars/dependencies involved in parsing xml/xslt in our application, and I don't want to try guessing what changes to make by trial and error. Does anyone know what could be causing this, or where to look first?
This problem is described here.
If you want to use Saxon with Java 8 you need to upgrade Saxon to a version >= 9.5.1.5
I am learning Apache Cayenne, so I am new to it.
I am following the official guide http://cayenne.apache.org/docs/3.0/tutorial.html.
I am doing exactly the same as the guide says, but when I save the project, it's generating 2 xml files, instead of 3, and when I run the java app (using the classes generated) following error appears:
Exception in thread "main" org.apache.cayenne.ConfigurationException: [v.3.0RC2 Feb 03 2010 13:38:54] Error during Configuration initialization. [v.3.0RC2 Feb 03 2010 13:38:54] [org.apache.cayenne.conf.DefaultConfiguration] : Domain configuration file "cayenne.xml" is not found.
at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:168)
at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:141)
at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:121)
at org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:91)
at org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:143)
at org.example.cayenne.Main.main(Main.java:21)
Caused by: org.apache.cayenne.ConfigurationException: [v.3.0RC2 Feb 03 2010 13:38:54] [org.apache.cayenne.conf.DefaultConfiguration] : Domain configuration file "cayenne.xml" is not found.
at org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:141)
at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:159)
... 5 more
I don't know what happened
I think I know what's going on. If you look at the exception, your stack trace indicates Cayenne version being v.3.0RC2. This is a version of the runtime. 2 files (one of which is called something like "cayenne-project.xml"), were generated by the Modeler version 3.1. You need to ensure that both the Modeler and the runtime are of the same release.
3.1 Tutorial seems to be correct in respect to the actual files in the project:
http://cayenne.apache.org/docs/3.1/tutorial/ch02.html#create-new-project