New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openstack4j 2.0.0-SNAPSHOT compatible with java 1.6?? #134
Comments
I just confirmed that Jersey 2 (2.7+) is no longer compiling with JDK 6 as the target and that JDK 7 is required. Couple questions:
If no to the above I could look into adding a connector for a pre Jersey 2.7 version for JDK6 usage. |
JDK 7 is no longer an option for us now, and we need to use Jersey and no longer a different connector. It will be helpful if you can add Jersey with JDK6 usage I did try okHttp and it also requires JDK 7 and when i use HTTPClient connector with openstack4j-core-2.0.0-SNAPSHOT I get below exception for image upload code
|
Ok I have added a JDK6 connector option which is using Jersey 2.6 (this should be 1.6 safe). You will need to modify your pom as far as openstack4j usage goes with the following: <dependency>
<groupId>org.pacesys</groupId>
<artifactId>openstack4j-core</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.pacesys.openstack4j.connectors</groupId>
<artifactId>openstack4j-jersey2-jdk16</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency> Let me know how this works out. |
Thanks a lot gondor; it works! Any idea why HttpClient did not work? Any idea of the exception in my previous reply? |
@vinodborole Thanks for the input. Actually you just found a bug with httpclient. 2.0.0-SNAPSHOT introduced options known as connectors (prior was only Jersey). The other connectors are still in beta and you just found a bug :) Thanks, I'll debug further and fix it. Regardless Jersey 2 is the most stable since it's been the default since I first started OpenStack4j and I had no issues adding a backwards compat JDK6 option for you. I'll fix the httpclient bug this evening. |
ok thanks |
The HttpClient connector issue is fixed? If yes, how should i pull the latest connector jar, can you help? |
If your using maven to run your project you can do a mvn -U compile via command line. If your in Eclipse use Maven -> Update Project (from there make sure Force Dependencies is checked) |
@gondor
|
…ed using only 64mb memory in the JDK and a 400mb image upload
Ok, this is now fixed. Tested by configuring my JDK to 64mb memory and uploading a 400mb image. (previous tests failed, now passed). You'll need to update your dependency in Maven or sync the new code |
It works thanks a lot |
I recently started working on writing a Openstack client and getting the same error that vinodborole mentioned above. Can someone please tell me how to get rid of this exception: Exception in thread "main" com.google.common.util.concurrent.ExecutionError: java.lang.UnsupportedClassVersionError: org/glassfish/jersey/jackson/JacksonFeature : Unsupported major.minor version 51.0 |
I am using openstack4j 2.0.0-Snapshot with java 1.6 and a basic authentication code is throwing me below jersey error
Exception in thread "main" com.google.common.util.concurrent.ExecutionError: java.lang.UnsupportedClassVersionError: org/glassfish/jersey/jackson/JacksonFeature : Unsupported major.minor version 51.0
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199)
at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
at org.openstack4j.connectors.jersey2.ClientFactory.create(ClientFactory.java:50)
at org.openstack4j.connectors.jersey2.HttpCommand.initialize(HttpCommand.java:50)
at org.openstack4j.connectors.jersey2.HttpCommand.create(HttpCommand.java:45)
at org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.invoke(HttpExecutorServiceImpl.java:53)
at org.openstack4j.connectors.jersey2.HttpExecutorServiceImpl.execute(HttpExecutorServiceImpl.java:33)
at org.openstack4j.core.transport.internal.HttpExecutor.execute(HttpExecutor.java:51)
at org.openstack4j.openstack.internal.OSAuthenticator.authenticateV2(OSAuthenticator.java:77)
at org.openstack4j.openstack.internal.OSAuthenticator.invoke(OSAuthenticator.java:41)
at org.openstack4j.openstack.client.OSClientBuilder$ClientV2.authenticate(OSClientBuilder.java:84)
at org.openstack4j.openstack.client.OSClientBuilder$ClientV2.authenticate(OSClientBuilder.java:65)
at com.osp4j.Osp4jApp.main(Osp4jApp.java:33)
Caused by: java.lang.UnsupportedClassVersionError: org/glassfish/jersey/jackson/JacksonFeature : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
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)
at org.openstack4j.connectors.jersey2.ClientFactory.buildClientFromConfig(ClientFactory.java:57)
at org.openstack4j.connectors.jersey2.ClientFactory.access$100(ClientFactory.java:31)
at org.openstack4j.connectors.jersey2.ClientFactory$1.load(ClientFactory.java:39)
at org.openstack4j.connectors.jersey2.ClientFactory$1.load(ClientFactory.java:36)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
... 14 more
Pom.xml
org.pacesys openstack4j 2.0.0-SNAPSHOTCode:
final OSClient os = OSFactory.builder().endpoint(serverUrl).credentials(username, credential).tenantName(tenant).authenticate();
The text was updated successfully, but these errors were encountered: