sunspot solr complains bout unsupported major.minor version 51.0 - solr

2.5 and ruby 2.1.6, with the latest version of sunspot_solr and sunspot_rails, when I run
rake sunspot:solr:run
it gives this error:
rake sunspot:solr:run
Please require the stackprof gem falling back to fast_stack
Starting Solr on port 8982 from /Users/nikso/.rvm/gems/ruby-2.1.6#sync/gems/sunspot_solr-2.2.3/solr/server
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/jetty/start/Main : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I read a few posts and followed their suggestion of updating JAVA to the latest version 8 update 20, and JRE version 8 update 71, to no avail. Any anyone shed some light on this please?

I addition to updating Java to latest version, I had to also set a correct path for JAVA_HOME environment variable.
In my case I edited ~/.bash_profile and added:
export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk.i386/
Make sure the path matches the Java version you're running.

Related

Karaf feature:install throws Unsupported 'Bundle-ManifestVersion' value: 1

I am new to Karaf and trying to learn how to handle it.
On the way I tried to add Camunda features.
Like described on https://github.com/camunda/camunda-bpm-platform-osgi/tree/master/camunda-bpm-karaf-feature
at first, I added the repo:
feature:repo-add mvn:org.camunda.bpm.extension.osgi/camunda-bpm-karaf-feature/4.1.0/xml/features
then I tried to install them;
feature:install camunda-bpm-karaf-feature-full
unfortunately I got this Exception
org.osgi.framework.BundleException: Unable to build resource for mvn:xmlpull/xmlpull/1.1.3.1: Unsupported 'Bundle-ManifestVersion' value: 1
at org.apache.felix.utils.resource.ResourceBuilder.build(ResourceBuilder.java:82)
at org.apache.felix.utils.resource.ResourceBuilder.build(ResourceBuilder.java:67)
at org.apache.karaf.features.internal.region.SubsystemResolver.prepare(SubsystemResolver.java:180)
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:379)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.osgi.framework.BundleException: Unsupported 'Bundle-ManifestVersion' value: 1
at org.apache.felix.utils.resource.ResourceBuilder.doBuild(ResourceBuilder.java:90)
at org.apache.felix.utils.resource.ResourceBuilder.build(ResourceBuilder.java:80)
... 9 more
Error executing command: Unable to build resource for mvn:xmlpull/xmlpull/1.1.3.1: Unsupported 'Bundle-ManifestVersion' value: 1
I am using Karaf version 4.2.1
Does somebody know what I am doing wrong?
One of the features depend on xmlpull 1.1.3.1 which has Manifest-Version: 1.0 in MANIFEST.MF thus making it an OSGi R3 bundle.
Apache Felix supports bundles conforming the OSGi Release 4 (or newer) only (Manifest-Version: 2.0) which is why it rejects xmlpull. See the Felix source for reference.
If you control the source consider wrapping xmlpull and installing the wrapped bundle from the features. You can also play around with the Karaf console; for example, install -s wrap:mvn:xmlpull/xmlpull/1.1.3.1.

Getting a java.util.nosuchelementexception error when launching GUI designer

I've created a new Codename One project. In the src folder I've created a Codename One Form:
image showing project hierarchy
When I right-click the form and select Codename One > GUI Builder I get this message:
null
java.util.NoSuchElementException
at java.util.StringTokenizer.nextToken(StringTokenizer.java:349)
at com.codename1.plugin.intellij.actions.GUIBuilderAction.actionPerformed(GUIBuilderAction.java:48)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:215)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:232)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:309)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:929)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:136)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:299)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:116)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:86)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:109)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:118)
at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:116)
at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:513)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:45)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:533)
at java.awt.Component.processMouseEvent(Component.java:6541)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6306)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4897)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4719)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4719)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:737)
at java.awt.EventQueue$4.run(EventQueue.java:735)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:827)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:651)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
The GUI Builder does not launch.
I'm using Java 8, a completely fresh install of IntelliJ IDEA 2017.1.1 with the Codename One plugin installed, version 3.6.0. And I can't find a single thing on the net to help me solve this. (I tested uninstalling the plugin and instead installing the previously available version, 3.5.3, nothing changed.)
Here's some more stats about my environment:
$ uname -a
Linux asus 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux
$ cat /etc/debian_version
8.7
$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
This appears to be a case of this issue. This has been fixed and should be part of the next plugin update on Friday.

GAE 500 server error

I'm developing app on GAE, I test the website locally fine however, every time I tried to deploy it to the GAE it reports with
Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.
I searched a lot in google, seems no answer could solve my question. When I look for the log in the GAE app, following is the major problem I found so far. Initially, I thought it's due to JDK8 but when I set JDK8 I can't even run the app locally!
Uncaught exception from servlet
java.lang.UnsupportedClassVersionError: org/apache/jsp/index_jsp : Unsupported major.minor version 52.0
at com.google.appengine.runtime.Request.process-aea5c804a9f29902(Request.java)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:795)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.lang.ClassLoader.loadClass(ClassLoader.java:360)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:188)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
at java.lang.Thread.run(Thread.java:724)
This is the telltale: Unsupported major.minor version 52.0. This happens when you compile on higher version JDK (52 = java8) and then execute it on lower JRE version (GAE uses java7).
GAE does not yet support Java8, so you should compile under Java7.
I had the same problem on Windows when Java 8 was installed.
I tried modifying the project/workspace settings but it didn't help me.
So, I created the following batch file as a workaround for GAE projects:
eclipse_gae.bat:
SET JAVA_HOME="C:\Program Files\Java\jdk1.7.0_55"
SET PATH="%JAVA_HOME%\bin"
START eclipse.exe
there is no need to fully remove Java 8 from MacOS. Just reconfigure Eclipse as shown here to force it to compile JSPs as Java 7:
http://java.wildstartech.com/Java-Platform-Standard-Edition/mac-os-x-java-development/how-to-configure-eclipse-to-run-with-java-7-when-java-8-is-installed
Make sure, that the version of Project Properties -> Project Facets -> Java is set to 1.7 and not to 1.8.
This is also nicely explained in the plugin's documentation section 'Changing the JDK Compliance Level'
I ran into a similar issue now. My setup is OS X + JDKs 6, 7 and 8, and in my eclipse.ini I had:
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java
Apparently it will use that compiler no matter what you set in global/project preferences (I even removed JDK 8 from the Installed JRE list, no success).
Once I've changed that to use JDK 7 and redeployed my GAE app, it worked.
You have to compile with Java 1.7. But if you have *.jsp files, you should also completely remove Java 1.8 from the system. If you use Mac, here is how you can do it.
If you are using gradle (e.g. Android Studio) on a mac, you can work around this problem by adding the following lines to the top of your gradlew script:
# Insist on java 7
JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
Variations of this method should work on other platforms.
I'm sure this has been resolved, but here is the solution
GAE runs on java7 (as indicated by Mr. Knego) so maven must be compiling with java7. Do the following:
I prefer to do all this in the terminal
Edit bash profile:
touch ~/.bash_profile; open ~/.bash_profile
Set Java Home Directory
#set JAVA_HOME
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
export JAVA_HOME
# For Apache Maven Commands
export M2_HOME=/Users/your-username/your/path/to/maven/apache-maven-3.3.3
export PATH=$PATH:$M2_HOME/bin
Navigate to your project folder (with pom.xml) and reinstall a clean version of maven
mvn clean install
Navigate to EAR or WAR directory and deploy with a new runtime
mvn appengine:update
If you are using endpoints, you should update your endpoint libraries

clojure-solr-0.2.0 and solr4

I'm trying to get clojure-solr-0.2.0 working with solr4 (trunk nightly build). I'm getting the following exception:
Caused by: java.lang.RuntimeException: Invalid version or the data in not in 'javabin' format
at org.apache.solr.common.util.JavaBinCodec.unmarshal(JavaBinCodec.java:99)
at org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse(BinaryResponseParser.java:39)
at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:466)
at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:243)
at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:89)
I'm assuming this is because clojure-solr is using some version of solrj library that is from solr3 codebase and javabin format changed between versions.
Is there some easy way to get this to work?
EDIT:
I deleted solrj from my project's lib folder, and replaced it with lib/apache-solr-solrj-4.0-2012-05-15_08-20-37.jar. I was hoping that would just work since the same classes (should) be found on the classpath at runtime (the transitive dependency should only be required when lein deps is run to fetch dependencies (or so I reasoned). The result was a class not found at runtime:
Caused by: java.lang.ClassNotFoundException: org.apache.solr.client.solrj.impl.CommonsHttpSolrServer
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at clojure_solr$eval1423$loading__4414__auto____1424.invoke(clojure_solr.clj:1)
at clojure_solr$eval1423.invoke(clojure_solr.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 95 more
And the problem is that CommonsHttpSolrServer is no longer present in the jar:
$ jar tf lib/apache-solr-solrj-4.0-2012-05-15_08-20-37.jar |grep Http
org/apache/solr/client/solrj/impl/HttpSolrServer$1.class
org/apache/solr/client/solrj/impl/HttpSolrServer$2.class
org/apache/solr/client/solrj/impl/HttpSolrServer$3.class
org/apache/solr/client/solrj/impl/HttpSolrServer$DeflateDecompressingEntity.class
org/apache/solr/client/solrj/impl/HttpSolrServer$GzipDecompressingEntity.class
org/apache/solr/client/solrj/impl/HttpSolrServer$UseCompressionRequestInterceptor.class
org/apache/solr/client/solrj/impl/HttpSolrServer$UseCompressionResponseInterceptor.class
org/apache/solr/client/solrj/impl/HttpSolrServer.class
org/apache/solr/client/solrj/impl/LBHttpSolrServer$1.class
org/apache/solr/client/solrj/impl/LBHttpSolrServer$Req.class
org/apache/solr/client/solrj/impl/LBHttpSolrServer$Rsp.class
org/apache/solr/client/solrj/impl/LBHttpSolrServer$ServerWrapper.class
org/apache/solr/client/solrj/impl/LBHttpSolrServer.class
$ jar tf lib/apache-solr-solrj-4.0-2012-05-15_08-20-37.jar |grep CommonsHttp
$
you will very likely need to make your own build of clojure-solr and fix it to work with the latest solr4. This is actually not that hard.
clone it from the github project
lein install
add it as a dependency in your main project
hack and repeat.

Google app engine return error log: unsupported major.minor version 51.0

I've just build a sample application to test out google app engine and google web toolkit feature, using a RPC service and google app engine with JDO. The service works on local. But after i deploy it to GAE and run, it show me the error as title says.
I use JRE7 to complie the application.
Here is my error log:
Uncaught exception from servlet
java.lang.UnsupportedClassVersionError: com/gwt/myexample/server/EmployeeServiceImpl:
Unsupported major.minor version 51.0
at com.google.appengine.runtime.Request.process-e8c21a25e91f709f(Request.java)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext
(TraceContext.java:449)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run
(TraceContext.java:455)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.
runInInheritedContextNoUnref(TraceContext.java:333)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.
runInInheritedContext(TraceContext.java:325)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
at java.lang.Thread.run(Thread.java:679)
My application link: http://jdodemo02.appspot.com/
Any suggestion please ):
Compile your application with Java SE 6. GAE doesn't support Java SE 7. Locally it works, because the GAE simulator runs on top of your local JDK.
One thing is to set the JRE 6 to the Build Path and the Compiler as well.
Dont forget, once you created your GAE Web Application project with a different JRE or JDK, always check the java version in the org.eclipse.wst.common.project.facet.core.xml in your .settings folder.
instead of directly editing the org.eclipse.wst.common.project.facet.core.xml in your .settings folder It will be better review it in eclipse as bellow
Right click on your eclipse project
Select Properties
Select "Project Facets" in the left panel
Select the Java version appropriately
I've been fighting for days. I have a Mac and needed to use GCM developing an Android app. The only way I could get GAE working in Android Studio, and also compatible with the installed JVM that I had was:
Install Homebrew.
Customize it with Homebrew Cask (brew install caskroom/cask/brew-cask).
Install Java using homebrew cask (brew cask install java).
Install Android Studio using homebrew cask (brew cask install android-studio).
Update Studio to the latest version.
Go to settings of the project in Studio and change the target JDK to the one that homebrew installed (1.8 located in /Library/Java/Home, which is actually a symlink).
Hope non of you guys run in the same path as I did, One just doesn't walk into Mordor, It has been 5 long days of fighting.
Too run creatjs project from Flash devlop you must downlod:
google compiler from link:
https://developers.google.com/closure/compiler/
haxe compiler from
http://haxe.org/download
jave jre 7

Resources