Wierd NoSuchMethodError for URLEncodedUtils.format - java

I am having a call to URLBuilder.build which has this call trace:
Servlet.service() for servlet authv0 threw exception:
java.lang.NoSuchMethodError: org.apache.http.client.utils.URLEncodedUtils.format(Ljava/lang/Iterable;Ljava/nio/charset/Charset;)Ljava/lang/String;
at org.apache.http.client.utils.URIBuilder.encodeQuery(URIBuilder.java:176) [httpclient-4.2.5.jar:4.2.5]
at org.apache.http.client.utils.URIBuilder.buildString(URIBuilder.java:140) [httpclient-4.2.5.jar:4.2.5]
at org.apache.http.client.utils.URIBuilder.build(URIBuilder.java:103) [httpclient-4.2.5.jar:4.2.5]
I see this even has been there since 4.2 and still it gives me a NoSuchMethodError. The jar version that is used is 4.2.5 as you see. Can someone point to what I am missing?
Here is my manifest file from 4.2.5 jar
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: oleg
Build-Jdk: 1.5.0_22
Implementation-Build: tags/4.2.5/httpclient#r1469939; 2013-04-19 18:29
:05+0200
Implementation-Title: HttpComponents HttpClient
Implementation-Vendor: The Apache Software Foundation
Implementation-Vendor-Id: org.apache
Implementation-Version: 4.2.5
Specification-Title: HttpComponents HttpClient
Specification-Vendor: The Apache Software Foundation
Specification-Version: 4.2.5
X-Compile-Source-JDK: 1.5
X-Compile-Target-JDK: 1.5
url: http://hc.apache.org/httpcomponents-client

Related

no master manifest attribute, in TagesdienstC.jar

I created an jar Data and now the cmd calls me this : no master manifest attribute, in TagesdienstC.jar. But my MANIFEST Data have all Informations which are needed.
Manifest-Version: 1.0
Main-Class: com.einsundeins.tagesdienst.Main
and if I unzip my jar data in the MANIFEST Data aren't this but this:Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven 3.3.9
Built-By: glorioso
Build-Jdk: 1.8.0_112-google-v7
Can anyone pls help me
Greetings

Nosuchmethoderror:org.glassfish.jersey.internal.l10n.LocalizableMessageFactory

I m working with jersey2.29 and Spring 4 to develop a web application. The following are my dependencies.
When starting Tomcat server 8 server, it doesn't start and I get the following error
Caused by: java.lang.NoSuchMethodError: org.glassfish.jersey.internal.l10n.LocalizableMessageFactory.(Ljava/lang/String;Lorg/glassfish/jersey/internal/l10n/LocalizableMessageFactory$ResourceBundleSupplier;)V
at org.glassfish.jersey.server.spring.LocalizationMessages.(LocalizationMessages.java:19)
at org.glassfish.jersey.server.spring.SpringWebApplicationInitializer.onStartup(SpringWebApplicationInitializer.java:46)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
I tried adding all the latest jar files in WEB-INF/lib
You not have minimal dependency for jersey-spring4 which is Spring 4.3.8
org.springframework spring-aop 4.3.8.RELEASE jar Apache License, Version 2.0
org.springframework spring-beans 4.3.8.RELEASE jar Apache License, Version 2.0
org.springframework spring-core 4.3.8.RELEASE jar Apache License, Version 2.0
org.springframework spring-web 4.3.8.RELEASE jar Apache License, Version 2.0
You should use spring-jersey3 jar

Netbeans is cutting short my jars manifest

Netbeans is cutting off the Class-Path part of a manifest file that I am generating with maven. It turns out like this:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: alan
Build-Jdk: 1.7.0_45
Main-Class: com.alan.client.Main
Class-Path: /home/alan/NetBeansProjects/RemoteInterfaces/target/Remote
Interfaces-1.0.jar
It should be:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: alan
Build-Jdk: 1.7.0_45
Main-Class: com.alan.client.Main
Class-Path: /home/alan/NetBeansProjects/RemoteInterfaces/target/RemoteInterfaces-1.0.jar
I have bumped the margin value in the IDE to a bigger number and the red line has jumped to the right, but it's still not generating it correctly. Any ideas?

Dependency not installed when installing Eclipse

I am developing an Eclipse plugin. That is using UI and file resources. Which required org.eclipse.core.resources;bundle-version="3.8.101" and filed if this dependency is not available on target eclipse.
Eclipse version: Juno (for Android development).
I want to install this jar if not available on target Eclipse. So my plugin run without any issue for target Eclipse.
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ABC
Bundle-SymbolicName: ABC;singleton:=true
Bundle-Version: 1.0
Bundle-Activator: magic.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="3.8.101"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
libs/java-json.jar,
libs/json-lib-2.4-jdk15.jar
Here is the error I got while installation
Cannot complete the install because one or more required items could not be found.
Software being installed: Feature 1.0.0 (com.confiz.android.codegen.feature.feature.group 1.0.0)
Missing requirement: Feature 1.0.0 (com.confiz.android.codegen.feature.feature.group 1.0.0) requires 'org.eclipse.core.resources 3.8.101' but it could not be found

Apache Felix misses javax.sql.Datasource

i just migrated from Equinox to Apache Felix. Now there is the javax.sql.datasource class missing:
java.lang.NoClassDefFoundError: javax/sql/DataSource
My bundle is importing javax.sql in the manifest file and i tried to add the following line to the felix config:
org.osgi.framework.system.packages.extra=javax.sql
Is there any way to teach felix to export the bundle or is there a bundle that does it? It worked fine in Equinox even without the import statement in the manifest.
EDIT:
The manifest file:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Database
Bundle-SymbolicName: ...database
Bundle-Version: 1.0.0
Import-Package: javax.sql,
org.osgi.framework;version="1.3.0",
org.osgi.service.component;version="1.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: lib/mysql-connector-java-5.1.20-bin.jar,
.
Export-Package: ...database.model,
...database.service
Service-Component: OSGI-INF/component.xml
Thanks,
Daniel
Felix does already export this package.
More likely is that there may be something wrong with your Import-Package statement. You did state that your bundle imports the package, but please post a copy of your MANIFEST.MF to be sure.

Categories