An Import-Package could not be resolved Error in Deploying Flex UI project - eclipse

I am developing simple VSphere Web Client plugin in Eclipse Juno with Vijava 5.5 and Vsphere sdk 5.5.. My project was working fine till yesterday. Today I tried to change the sdk to Vsphere sdk 6.0. From that onwards I am getting Following Error while deploying my UI project in Virgo Server.
Later, I again reverted to my Vsphere sdk 5.5 itself. But still i am getting this error. I don't know what I missed. Why it showing in my UI project? Is there anything i can change my dependencies there?
Error is,
2015-06-11 19:27:26.160] [INFO ] TCP Connection(11)-127.0.0.1 <DE0004I> Starting bundle 'test-provider' version '0.0.0'.
[2015-06-11 19:27:26.160] [INFO ] start-signalling-1 <DE0005I> Started bundle 'test-provider' version '0.0.0'.
[2015-06-11 19:27:26.957] [INFO ] TCP Connection(11)-127.0.0.1 <DE0000I> Installing bundle 'com.mycompany.testui.testui' version '1.0.0'.
[2015-06-11 19:27:27.051] [INFO ] TCP Connection(11)-127.0.0.1 <ME0003I> Dump 'C:\ProgramData\vmware\vSphere Web Client\serviceability\dump\2015-06-11-19-27-051' generated
[2015-06-11 19:27:27.066] [ERROR] TCP Connection(11)-127.0.0.1 <DE0002E> Installation of bundle 'com.mycompany.testui.testui' version '1.0.0' failed. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.mycompany.testui.testui' at version '1.0.0': Cannot resolve: com.mycompany.testui.testui
Resolver report:
An Import-Package could not be resolved. Resolver error data <Import-Package: com.mycompany.testprovider; version="0.0.0">. Caused by missing constraint in bundle <com.mycompany.testui.testui_1.0.0>
constraint: <Import-Package: com.mycompany.testprovider; version="0.0.0">
at org.eclipse.virgo.kernel.install.pipeline.stage.resolve.internal.QuasiResolveStage.process(QuasiResolveStage.java:46)
at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessGraph(StandardPipeline.java:62)
at org.eclipse.virgo.kernel.install.pipeline.internal.CompensatingPipeline.doProcessGraph(CompensatingPipeline.java:73)
at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessGraph(StandardPipeline.java:62)
at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.driveInstallPipeline(PipelinedApplicationDeployer.java:359)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.doInstall(PipelinedApplicationDeployer.java:185)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.install(PipelinedApplicationDeployer.java:140)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:253)
at org.eclipse.virgo.kernel.deployer.management.StandardDeployer.deploy(StandardDeployer.java:52)
at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75)
at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279)

When you deploy your UI, you must deploy your service com.mycompany.testprovide previously

Service provider is not linked with Plugin UI project. In order to do that,
need to do the following..
Right-click on the Plugin UI project and select vSphere SDK Tools > Package vSphere Client plugin.
In that, select your service provider project. That's it.

To make sure the service bundle is deployed before the ui bundle use the <bundlesOrder> tag in the plugin-package.xml.
vSphere Client (HTML) versions 6.5U1 and above improve on this by introducing a dedicated scope for each plugin (OSGi sandboxing feature).

Related

NoSuchMethodError: org.eclipse.jetty.util.MultiMap.add

I loaded my Spring/Maven project in Eclipse (Spring Tools Suite variant), installed Run Jetty Run, and clicked Run Jetty.
PROBLEM: Jetty does not start correctly:
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Running Jetty 9.0.0.M3
ParentLoaderPriority enabled
Enable config class:runjettyrun.webapp.RJRWebInfConfiguration
Enable config class:org.eclipse.jetty.webapp.WebXmlConfiguration
Enable config class:runjettyrun.webapp.RJRMetaInfoConfiguration
Enable config class:org.eclipse.jetty.webapp.FragmentConfiguration
Enable config class:runjettyrun.annotation.RJRAnnotationConfiguration
Enable config class:org.eclipse.jetty.webapp.JettyWebXmlConfiguration
Enable config class:org.eclipse.jetty.webapp.TagLibConfiguration
ProjectClassLoader: entry=/home/nico/src/nemaki/core/target/classes
ProjectClassLoader: entry=/home/nico/.m2/repository/javax/servlet/javax.servlet-api/3.0.1/javax.servlet-api-3.0.1.jar
[... many other JAR libraries, none being Jetty ...]
ProjectClassLoader: entry=/home/nico/.m2/repository/jp/aegif/nemakiware/nemakiware-common/2.3.10/nemakiware-common-2.3.10.jar
Excluded entry=/home/nico/src/nemaki/core/target/test-classes
2016-09-30 17:17:09.780:INFO:oejs.Server:main: jetty-9.0.0.M3
2016-09-30 17:17:12.121:WARN:oejuc.AbstractLifeCycle:main: FAILED o.e.j.w.WebAppContext#694e1548{/core,[file:/home/nico/src/nemaki/core/WebContent/],STARTING}: java.lang.NoSuchMethodError: org.eclipse.jetty.util.MultiMap.add(Ljava/lang/Object;Ljava/lang/Object;)V
java.lang.NoSuchMethodError: org.eclipse.jetty.util.MultiMap.add(Ljava/lang/Object;Ljava/lang/Object;)V
at org.eclipse.jetty.annotations.ClassInheritanceHandler.handle(ClassInheritanceHandler.java:56)
at org.eclipse.jetty.annotations.AnnotationParser$MyClassVisitor.visit(AnnotationParser.java:398)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
QUESTION: How can I fix it?
You are running an unstable version of Jetty.
Version 9.0.0.M3 is not a stable release (that's an experimental milestone release, a candidate for release, something to help integrators start to evolve their code for the eventual release).
Use a stable release, such as 9.3.12.v20160915 and you'll have a much better experience.
In 9.3.12.v20160915 the MultiMap class can be found in jetty-util-9.3.12.v20160915.jar
Also note, Jetty 9 is servlet 3.1, not 3.0.1 (seen in your output)
As explained by Joakim, 9.0.0.M3 is an old version of Jetty.
Fortunately, Run Jetty Run has been updated a few weeks ago.
Here is how to use the latest Run Jetty Run:
Uninstall from Eclipse any existing version of Run Jetty Run
Add this update site: http://xzer.github.io/run-jetty-run-updatesite/nightly/
Install from it the required component and the optional component 9.3.6
You now have Run Jetty Run using Jetty 9.3.6, which is a year old already but does not trigger the error above. Be sure to select it in Run configurations.

What version of httpclient is compatible with the Amazon SDK v 1.11.5?

I’m using the Amazon Java SDK, version 1.11.5 (I included the aws-java-sdk-1.11.5.jar in my WEB-INF/lib directory). What version of the Apache httpclient library do I need to include that is compatible with this version of the AWS SDK? I tried httpclient-4.3.4.jar, but I get the below error
15:34:25,366 ERROR [io.undertow.request] (default task-34) UT005023: Exception handling request to /pluginwiris_engine/app/service: java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V
at com.amazonaws.http.conn.ssl.SdkTLSSocketFactory.<init>(SdkTLSSocketFactory.java:56)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.getPreferredSocketFactory(ApacheConnectionManagerFactory.java:87)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:65)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:58)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:46)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:37)
at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:213)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:145)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:393)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:373)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:355)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:327)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:309)
Thanks for additional help, - Dave
Looking at the source for the Java AWS SDK, under tag 1.11.5, you can see the in the POM file they have specified the following:
<httpcomponents.httpclient.version>4.5.2</httpcomponents.httpclient.version>
So I'd say HTTP Client version 4.5.2 is compatible with the AWS SDK version 1.11.5. If you are using a dependency management tool like Maven you could always just let it pull in the version of HTTP Client specified the the AWS SDK.
Look at the compile dependencies at maven repo for aws-java-sdk-core
You can see it's dependent on org.apache.httpcomponents » httpclient -- 4.5.2. Further check if you've all the dependencies of httpclient-4.5.2. You might be missing correct version of httpcore

Push to Upstream to Heroku server from Eclipse failed

I was able to commit the change but when i do push to upstream this is the message i get:
Repository git#heroku.com:protected-garden-XXXX.git
pre-receive hook declined
Compressing source files... done.
Building source:
-----> Java app detected
-----> Installing OpenJDK 1.6... done
-----> Installing Maven 3.3.1... done
-----> Executing: mvn -B -DskipTests=true clean install
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
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 java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:254)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
at org.codehaus.plexus.classworlds.launcher.Launcher.getMainClass(Launcher.java:144)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:266)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app
Verifying deploy...
! Push rejected to protected-garden-XXXX.
What might be the problem because I used the default example Eclipse >>> Project >>> :"Create Heroku App from Template" and chose the Embedded Jetty-Servlet Application and just changed the text in the HelloServlet line 20 and then commit.
Answer from heroku support team: (which solved my problem)
Maven 3, which Heroku uses to build projects with a pom.xml file, will not run on any version of Java 6. It requires Java 7 or later. Personally, I'd suggest going straight to the latest version, Java 8, since Java 7 is no longer supported by Oracle or the OpenJDK team.
You can upgrade Java in your app by specifying
java.runtime.version=1.8
in the:
system.properties
file in the root of your project, then pushing your app. You'll also want to install the same version of Java locally, so that you can test your app before you push it.

How to change Eclipse-Groovy plugin Groovy libraries?

I am using the newest version (2.8.0) of the Eclipse-Groovy plugin that ships with groovy-all-2.1.5.jar. I added Guice to my Groovy project, and when I go to run them from inside Eclipse I get the following error in the console output:
Caught: java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling
java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling
at net.me.myapp.utils.restclient.RestClient.<init>(RestClient.groovy:57)
at net.me.myapp.inject.UserServiceClientModule.configure(UserServiceClientModule.groovy:34)
at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
at com.google.inject.spi.Elements.getElements(Elements.java:101)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at net.me.myapp.UserServiceClient.<init>(UserServiceClient.groovy:37)
at net.me.myapp.UserServiceClient.main(UserServiceClient.groovy:45)
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.typehandling.ShortTypeHandling
... 12 more
According to this answer it's because ShortTypeHandling wasn't added until 2.3.x. So I would now like to attach groovy-all-2.3.3.jar to my Eclipse project's classpath.
The problem is that I don't seem to have edit permissions to change what library the Groovy Libraries library uses under the hood. And when I manually add the 2.3.3 JAR to my build path, I get the following error:
Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.1.5 and you are trying to load version 2.3.3
What are my options?
Groovy-eclipse versions have its own compilers and are "locked" to them. You may change the versions to whatever is listed under Window > Preferences > Groovy > Compilers, but, AFAIK, you can't change to an arbitrary version of the compiler by simply changing the groovy-all jar in the guts of the plugin dir.
You can install new compiler versions using the update site or eclipse marketplace
Update: install additional compiler versions through Help > Install new Software, select Groovy update site and expand the Extra Groovy Compilers session:
Note i'm using snapshot update site, because i like to live dangerously.

jboss 5.1 cannot startup after deployment migrate from 4.0.3sp1

I am trying to migrate deployment from 4.0.3sp1 to 5.1. I just copied the file under /opt/jboss/server to jboss 5.1 directory.
At first, it prompt failed to access server/conf/bootstrap.xml, etc, I copied them from /opt/jboss/server/default/conf/*.xml, then it come to the error:
14:27:19,785 ERROR [ScopedProfileServiceController] Error installing to Create: name=ProfileKey#92eb76[domain=default, server=default, name=bindings] state=Configured mode=On Demand requiredState=Installed
java.lang.reflect.InvocationTargetException
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:585)
Caused by: java.io.IOException: Child not found bindingservice.beans/ for FileHandler#15606014[path= context=file:/opt/jboss-5.1.0.GA/server/...
Failed to boot JBoss:
java.lang.IllegalStateException: Incompletely deployed:
*** PROFILES IN ERROR: Name -> Error
Profile: ProfileKey#92eb76[domain=default, server=default, name=bindings] in error due to java.lang.reflect.InvocationTargetException
is there any difference on configuration files between 4.0.3sp1 and 5.1? anything I need to add in jboss 5.1 server//conf?
I don't know if I undarstand you correctly but you cannot just copy profile between JBoss version. Between version 4.0.3 and 5.1 was a lot of changes and I really doubt if something like that can work (for example theres is a lot of different services, configuration changes, completely different kernel and so one).
Since JBoss 5 there is new way for setting port bindings and I believe that JBoss cannot find these configuration file.
If you want migrate to knew version of JBoss you should use for some JBoss 5.1 profile: default or all and in that profile install your application, data sources and other things.
This issue is because of missing myserver/conf/bindingservice.beans, i copied this folder from jboss 5.1 server/default/conf/bindingservice.beans, now this issue is gone.