I'm trying to make my logging from log4j to go to the Eclipse Error Log view in my plugin.
I've got two external bundles:
Bundle 1: created a Plugin Development project based on existing JARs, containing the log4j library.
Bundle 2: created an empty Plugin Development project. Added a log4j.properties to it and a new class "VirtualConsole", which extends "ConsoleAppender".
This is how my log4j.properties looks like:
# Set root logger level to debug and its only appender to default.
log4j.rootLogger=debug, default
# default is set to be a ConsoleAppender.
log4j.appender.default=VirtualConsole
# default uses PatternLayout.
log4j.appender.default.layout=org.apache.log4j.PatternLayout
log4j.appender.default.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
And this is how my VirtualConsole looks like:
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Level;
import org.apache.log4j.spi.LoggingEvent;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.statushandlers.StatusManager;
public class VirtualConsole extends ConsoleAppender {
#Override
public void append(LoggingEvent event) {
int level = IStatus.INFO;
if (event.getLevel().equals(Level.ERROR))
level = IStatus.ERROR;
IStatus status = new Status(level, "myplugin",
event.getMessage().toString());
StatusManager.getManager().handle(status, StatusManager.LOG);
//and the normal logging
super.append(event);
}
}
This works. I've got my first bundle included as a dependency in the other bundles and when I run my plugin from within Eclipse by "right click > run as > Eclipse Application", I can run my plugin and when I (purposedly) do something where I now it is logging, the logs appear where they should - in the Error Log view.
As soon as I export my plugin, run a clean and fresh install of Eclipse and install the plugin via the "install software" system, it doesn't work anymore... nothing appears anywhere. I cannot get it to work and I honestly can't see where I'm going wrong.
Anyone able to give me some pointers?
Thanks.
Update So this is how everything looks like now:
Manifest.MF from the bundle "bundle.log4jProperties":
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Log4jProperties
Fragment-Host: bundle.slf4j
Bundle-SymbolicName: bundle.log4jProperties
Bundle-Version: 1.0.1
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
bundle.slf4j
Eclipse-RegisterBuddy: bundle.slf4j
log4j.properties file in the bundle "bundle.log4jProperties":
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1
log4j.logger.org.hibernate.type=ERROR
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=bundle.log4jProperties.ErrorLogAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
ErrorLogAppender.java in the bundle "bundle.log4jProperties" (in a package "bundle.log4jProperties" as well, in the src folder):
package bundle.log4jProperties;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.Level;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.spi.ThrowableInformation;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
public class ErrorLogAppender extends AppenderSkeleton {
#Override
public void close() {}
#Override
public boolean requiresLayout() {
return false;
}
#Override
protected void append(LoggingEvent event) {
//get the platform log
ILog log = Platform.getLog(Platform.getBundle
("bundle.log4jProperties"));
//create an IStatus status
IStatus status = new Status(getLevel(event.getLevel()),
"myPlugin",
getCode(event),
getMessage(event),
getThrowable(event));
//log the status
log.log(status);
}
private int getLevel(Level level) {
int severity;
if (level.equals(Level.ALL) ||
level.equals(Level.ERROR) ||
level.equals(Level.FATAL))
severity = IStatus.ERROR;
else if (level.equals(Level.WARN))
severity = IStatus.WARNING;
else if (level.equals(Level.INFO))
severity = IStatus.INFO;
else severity = IStatus.INFO;
return severity;
}
private int getCode(LoggingEvent event) {
return (int) event.getTimeStamp();
}
private String getMessage(LoggingEvent event) {
return event.getMessage().toString();
}
private Throwable getThrowable(LoggingEvent event) {
ThrowableInformation info = event.getThrowableInformation();
if (info != null)
return info.getThrowable();
else return null;
}
}
Over to the bundle "bundle.slf4j", which contains 3 jar files: Manifest.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Slf4j
Bundle-SymbolicName: bundle.slf4j
Bundle-Version: 1.0.1
Bundle-ClassPath: slf4j-api-1.7.5.jar,
slf4j-log4j12-1.7.5.jar,
log4j-1.2.17.jar
Bundle-Vendor: apache
Export-Package: org.apache.log4j,
org.apache.log4j.chainsaw,
org.apache.log4j.config,
org.apache.log4j.helpers,
org.apache.log4j.jdbc,
org.apache.log4j.jmx,
org.apache.log4j.lf5,
org.apache.log4j.lf5.util,
org.apache.log4j.lf5.viewer,
org.apache.log4j.lf5.viewer.categoryexplorer,
org.apache.log4j.lf5.viewer.configure,
org.apache.log4j.net,
org.apache.log4j.nt,
org.apache.log4j.or,
org.apache.log4j.or.jms,
org.apache.log4j.or.sax,
org.apache.log4j.pattern,
org.apache.log4j.rewrite,
org.apache.log4j.spi,
org.apache.log4j.varia,
org.apache.log4j.xml,
org.slf4j,
org.slf4j.helpers,
org.slf4j.impl,
org.slf4j.spi
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-BuddyPolicy: registered
Still all working when running from inside Eclipse as an Eclipse application, but not working when deploying to an update site and installing from there. I reckon this might have to do with the properties file not being found, but what do I have to change if I want the file to be found??
Note: feature.xml, which I'm exporting to the updatesite, contains this as well (truncated and left out what's not necessary):
<requires>
<import plugin="bundle.slf4j" version="1.0.1" match="greaterOrEqual"/>
</requires>
<plugin
id="bundle.slf4j"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="bundle.log4jProperties"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
I couldn't add the bundle.log4jProperties to the required plugins as that gives me the warning that that plugin could not be resolved. Somehow I think this is related to my problem but how on earth am I supposed to make my feature.xml (in the bundle "feature", separate) "resolve" another bundle which is in the same workspace and working? Especially weird because that same feature.xml does revolve the plugin in the plugin-statement.
Please, anyone. Help.
It's pretty fantastic that I'm struggling with something that's done in almost every plugin out there, but I can't manage to find a solution anywhere. Bottom line: I want to log errors to the error log view. That's gotta be possible, right?
Related
Recently switch to Gradle from Maven.
Following this tutorial for continuous REST Doc build with Gradle. https://www.youtube.com/watch?v=k5ncCJBarRI&t=1490s
Snippets are generating just fine when running test. Its when I am trying to generate asciidoc where it seems like the /build directory gets recreated without the snippets. So my generated html always shows
Unresolved directive in index.adoc - include::{snippets}/home-json/curl-request.adoc[]
I am generating the asciidoc by the following command in the terminal
gradle asciidoctor -t
// Continuous build command
// Mentioned around #1:07:40 mark
// https://www.youtube.com/watch?v=k5ncCJBarRI&t=1490s
build.gradle
plugins {
id 'org.springframework.boot' version '2.4.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'org.asciidoctor.convert' version '1.5.8'
id 'java'
}
group = 'lab.restdocs'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '14'
repositories {
mavenCentral()
}
ext {
set('snippetsDir', file("build/generated-snippets"))
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'junit:junit:4.12'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
}
test {
outputs.dir snippetsDir
useJUnitPlatform()
}
asciidoctor {
inputs.dir snippetsDir
dependsOn test
}
bootJar {
dependsOn asciidoctor
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}
MyTest
#RunWith(SpringRunner.class)
#SpringBootTest
#AutoConfigureMockMvc
public class HelloControllerTest {
#Autowired
private MockMvc mockMvc;
#Rule
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
#InjectMocks
private HelloController helloController;
#Mock
private HelloService helloService;
#Before
public void setUp() throws Exception {
// create a mock environment of helloController
mockMvc = MockMvcBuilders.standaloneSetup(helloController)
.apply(documentationConfiguration(this.restDocumentation))
.build();
}
#Test
public void shouldReturnDefaultMessage() throws Exception {
this.mockMvc.perform(get("/hello/string"))
.andDo(print())
.andExpect(status().isOk())
.andExpect(content().string(containsString("hello there"))
)
.andDo(document("home-string"));
}
I also checked my build.gradle against https://spring.io/guides/gs/testing-restdocs/ and https://docs.spring.io/spring-restdocs/docs/2.0.5.RELEASE/reference/html5/#configuration-uris. I don't know what I am missing...
Thanks in advance.
Edited
Ran command gradle asciidoctor --console=plain
If it makes it easier I greated a Git repo
https://github.com/erich5168/edu.rest-doc
erichuang$ gradle asciidoctor --console=plain
> Task :compileJava
> Task :processResources
> Task :classes
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test
> Task :asciidoctor
asciidoctor: WARNING: api.adoc: line 3: include file not found: /Users/erichuang/Desktop/JE/00-Development/dev/lab/lab-rest-docs/lab.restdocs-gradlebuild/build/generated-snippets/home/curl-request.adoc
asciidoctor: WARNING: api.adoc: line 5: include file not found: /Users/erichuang/Desktop/JE/00-Development/dev/lab/lab-rest-docs/lab.restdocs-gradlebuild/build/generated-snippets/home/http-request.adoc
asciidoctor: WARNING: api.adoc: line 7: include file not found: /Users/erichuang/Desktop/JE/00-Development/dev/lab/lab-rest-docs/lab.restdocs-gradlebuild/build/generated-snippets/home/http-response.adoc
asciidoctor: WARNING: api.adoc: line 20: include file not found: /Users/erichuang/Desktop/JE/00-Development/dev/lab/lab-rest-docs/lab.restdocs-gradlebuild/build/generated-snippets/home-json/http-response.adoc
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 2s
5 actionable tasks: 5 executed
Apples-MBP:lab.restdocs-gradlebuild erichuang$
When run from the command line, you build isn't running any tests. The tests aren't being run as your tests are using JUnit 4 while the test task has been configured to use the JUnit Platform (JUnit 5):
test {
outputs.dir snippetsDir
useJUnitPlatform()
}
You can fix the problem either by updating your tests to use JUnit 5 or by removing useJUnitPlatform() from the test task's configuration so that it uses JUnit 4. The latter is the smaller change and leaves the test task looking like this:
test {
outputs.dir snippetsDir
}
I've just started using MapBox in react-native but I appear to be getting the following error
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
Enabling multidex with
multiDexEnabled true
I then get the following
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: okhttp3/internal/ws/RealWebSocket$1.class
Here's the config
build.gradle .../android
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
// Add jitpack repository (added by tipsi-stripe)
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
}
}
build.gradle ../app
dependencies {
compile project(':mapbox-react-native-mapbox-gl')
compile project(':react-native-branch')
compile project(':react-native-camera')
compile project(':tipsi-stripe')
compile project(':react-native-device-info')
compile project(':react-native-vector-icons')
compile project(':react-native-i18n')
compile project(':react-native-geocoder')
compile project(':react-native-fbsdk')
compile(project(':react-native-maps')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:25.0.0"
compile "com.facebook.react:react-native:+" // From node_modules
compile 'com.google.android.gms:play-services-base:11.+'
compile 'com.google.android.gms:play-services-maps:11.+'
}
settings.gradle
include ':mapbox-react-native-mapbox-gl'
project(':mapbox-react-native-mapbox-gl').projectDir = new File(rootProject.projectDir, '../node_modules/#mapbox/react-native-mapbox-gl/android/rctmgl')
include ':react-native-branch'
project(':react-native-branch').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-branch/android')
include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')
include ':tipsi-stripe'
project(':tipsi-stripe').projectDir = new File(rootProject.projectDir, '../node_modules/tipsi-stripe/android')
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-i18n'
project(':react-native-i18n').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-i18n/android')
include ':react-native-geocoder'
project(':react-native-geocoder').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-geocoder/android')
include ':react-native-fbsdk'
project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
include ':app'
MainApplication.java
import android.app.Application;
import android.content.Intent;
import com.facebook.CallbackManager;
import com.facebook.FacebookSdk;
import com.facebook.react.ReactApplication;
import com.mapbox.rctmgl.RCTMGLPackage;
import io.branch.rnbranch.RNBranchPackage;
import io.branch.referral.Branch;
import com.lwansbrough.RCTCamera.RCTCameraPackage;
import com.gettipsi.stripe.StripeReactPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.oblador.vectoricons.VectorIconsPackage;
import com.i18n.reactnativei18n.ReactNativeI18n;
import com.devfd.RNGeocoder.RNGeocoderPackage;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.airbnb.android.react.maps.MapsPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private static CallbackManager mCallbackManager = CallbackManager.Factory.create();
protected static CallbackManager getCallbackManager() {
return mCallbackManager;
}
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
#Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
#Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RCTMGLPackage(),
new RNBranchPackage(),
new RCTCameraPackage(),
new StripeReactPackage(),
new RNDeviceInfo(),
new MapsPackage(),
new VectorIconsPackage(),
new ReactNativeI18n(),
new RNGeocoderPackage(),
new FBSDKPackage(mCallbackManager)
);
}
};
#Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
#Override
public void onCreate() {
super.onCreate();
FacebookSdk.sdkInitialize(getApplicationContext());
SoLoader.init(this, /* native exopackage */ false);
// initialize the Branch object
Branch.setPlayStoreReferrerCheckTimeout(0);
Branch.getAutoInstance(this);
}
}
Stacktrace
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lokhttp3/internal/ws/WebSocketReader;
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lokhttp3/internal/ws/WebSocketReader;
at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 27 more
Caused by: com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lokhttp3/internal/ws/WebSocketReader;
at com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:230)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
... 39 more
Caused by: com.android.dex.DexException: Multiple dex files define Lokhttp3/internal/ws/WebSocketReader;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
148 actionable tasks: 4 executed, 144 up-to-date
I'm not sure if this is a matter of my current project config or what not, but i've not seen reports of this so far.
Update with adding in workaround enables app to launch but then another issue arises: NoClassDefFoundError: com.google.android.gms.wallet.MaskedWalletRequest
I've now added in configurations.all { resolutionStrategy.force 'com.squareup.okhttp3:okhttp:3.4.1' } as suggested by https://github.com/facebook/react-native/issues/12646 which enables the app to build succesfully but then there is an issue of NoClassDefFoundError: com.google.android.gms.wallet.MaskedWalletRequest
Just to clarify moving over to mapbox, I'll no longer need react-native-maps, and the reason for the move over is the greater level of detail i.e. in the buildings.
Thanks, appreciate you're help
Looks like a similar issue was raised against the repo and can probably be resolved if you...
exclude android.arch.core module from the mapbox project
compile 'com.google.android.gms:play-services-base:11.+'
compile 'com.google.android.gms:play-services-maps:11.+`
Version for com.google.android.gms:play-services should be same in build.gradle for app. and and in build.gradle of your packages installed.
-Here 11.+ version refers to any version greater then 11 which currently
available.i would suggest to make this version static and copy that version in build.gradle of your package in node-modules which gives error.
it is necessary to have same com.google.android.gms:play-services version throughout the app
Thankfully I was finally able to get mapbox in on my android version in react-native after resolving issues that popped up along the way: First of all my first attempt was on an older version of react-native 0.44.0, I later upgraded to the latest version of react native
"react-native": "^0.50.3",
and using react
"react": "^16.1.1",
Error
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
This was the first, the app exceeds the maximum number of methods so we go ahead and enable multiDex in app/gradle
android {
compileSdkVersion 25
defaultConfig {
...
multiDexEnabled true
The next issue was
* What went wrong:
Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: okhttp3/internal/ws/RealWebSocket$1.class
One approach to resolving this was found to use on the older version of react-native but this was not required it seems on the most recent version following the upgrade with react-native-git-upgrade
configurations.all { resolutionStrategy.force 'com.squareup.okhttp3:okhttp:3.4.1' }
Another issue that popped up was
Failed to resolve: android.arch.lifecycle:extension:1.0.0-alpha3
which was resolved by adding maven { url 'https://maven.google.com' } to
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
}
}
Then there was an Aapt exception error which was resolved by adding to gradle.properties
android.enableAapt2=false
The app would now build succesfully but on starting irrespective of whether upraded to the latest version or not would show the error
C++ Exception in 'NativeModules': java.lang.NoClassDefFoundError: com.google.android.gms.wallet.MaskedWalletRequest
which was resolved by adding
implementation 'com.google.android.gms:play-services-wallet:11.+'
to our gradle dependencies.
And then the app built and started succesfully with no errors.
I think upgrading to the latest version of react-native, react, helped a great deal with compatability, speed, and performance, as well as by using the latest version of gradle and for example when doing so
configurations.all { resolutionStrategy.force 'com.squareup.okhttp3:okhttp:3.4.1' }
was needed to be added assuming that conflict must have been resolved in a later version.
Anyway, hope this helps someone, and pleased to say I've finally got mapbox in the app.
Thanks to #nitaliano for helping out over at https://github.com/mapbox/react-native-mapbox-gl/issues/785, and providing guidance, a long with the references and help found on https://github.com/tipsi/tipsi-stripe/issues/18 https://github.com/facebook/react-native/issues/12646 https://github.com/mapbox/react-native-mapbox-gl/issues/767 and also the help from Chris Geirman and Rajat Gupta here.
The following references were also helpful
https://facebook.github.io/react-native/docs/upgrading.html
https://reactjs.org/blog/2017/04/07/react-v15.5.0.html
https://reactjs.org/blog/2017/09/26/react-v16.0.html
https://github.com/mlaursen/react-md/issues/325
https://www.npmjs.com/package/prop-types
https://github.com/mapbox/react-native-mapbox-gl/blob/master/example/src/App.js
https://github.com/mapbox/react-native-mapbox-gl/blob/master/example/src/components/ShowMap.js
Mapbox: Cant add LocationLayer plugin in gradle
https://github.com/tipsi/tipsi-stripe/issues/18
https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html
Thanks again 👍
I'm evaluating jboss fuse (using version 6.2.1.redhat-084), and i've run into the following issue:
I have a number of features in my project
Each feature has a configuration file
The feature repository file looks like this:
.
<?xml version="1.0" encoding="UTF-8"?>
<features name="myservice-features" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
<feature name="myservice-common" version="${project.version}">
<configfile finalname="etc/com.myorg.myservice_common.cfg" override="true">mvn:com.myorg/myservice-common/${project.version}/cfg/${build.environment}</configfile>
<bundle start-level="100" dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax-cache-api/1.0.0_1</bundle>
<bundle start-level="100" dependency="true">mvn:org.apache.camel/camel-velocity/${camel.version}</bundle>
<bundle start-level="110">mvn:com.myorg/myservice-common/${project.version}</bundle>
</feature>
<feature name="myservice-impl" version="${project.version}">
<feature>myservice-common</feature>
<configfile finalname="etc/com.myorg.myservice.cfg" override="true">mvn:com.myorg/myservice-impl/${project.version}/cfg/${build.environment}</configfile>
<bundle start-level="200">mvn:com.hazelcast/hazelcast/${hazelcast.version}</bundle>
<bundle start-level="200">mvn:com.hazelcast/hazelcast-client/${hazelcast.version}</bundle>
<bundle start-level="220">mvn:com.myorg/myservice-impl/${project.version}</bundle>
</feature>
</features>
The service uses blueprint property placeholder with the corresponding PID to initialize the properties in the camel context
The issue is that when deploying the features in a profile, the configuration files are picked up by org.apache.felix.fileinstall only after the bundles are attempted to be resolved, and I run into the following exception:
.
2016-12-15 10:07:38,384 | ERROR | oyer-49-thread-1 | BlueprintContainerImpl | 23 - org.apache.aries.blueprint.core - 1.4.4 | Unable to start blueprint container for bundle otc-trade-service-impl/1.0.0.SNAPSHOT
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean .camelBlueprint.factory.myservice-impl-context
at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:714)[23:org.apache.aries.blueprint.core:1.4.4]
...
Caused by: java.lang.IllegalArgumentException: Property placeholder key: xxxxx not found
at org.apache.camel.blueprint.BlueprintPropertiesParser.parseProperty(BlueprintPropertiesParser.java:164)
at org.apache.camel.component.properties.DefaultPropertiesParser$ParsingContext.doGetPropertyValue(DefaultPropertiesParser.java:306)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
at org.apache.camel.component.properties.DefaultPropertiesParser$ParsingContext.getPropertyValue(DefaultPropertiesParser.java:246)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
at org.apache.camel.component.properties.DefaultPropertiesParser$ParsingContext.readProperty(DefaultPropertiesParser.java:154)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
at org.apache.camel.component.properties.DefaultPropertiesParser$ParsingContext.doParse(DefaultPropertiesParser.java:113)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
at org.apache.camel.component.properties.DefaultPropertiesParser$ParsingContext.parse(DefaultPropertiesParser.java:97)[198:org.apache.camel.camel-core:2.15.1.redhat-621084]
at org.apache.camel.component.properties.DefaultPropertiesParser.parseUri(DefaultPropertiesParser.java:62)
at org.apache.camel.component.properties.PropertiesComponent.parseUri(PropertiesComponent.java:178)
at org.apache.camel.component.properties.PropertiesComponent.parseUri(PropertiesComponent.java:129)
at org.apache.camel.impl.DefaultCamelContext.resolvePropertyPlaceholders(DefaultCamelContext.java:1956)
at org.apache.camel.model.ProcessorDefinitionHelper.resolvePropertyPlaceholders(ProcessorDefinitionHelper.java:734)
at org.apache.camel.model.RouteDefinitionHelper.initRouteInputs(RouteDefinitionHelper.java:379)
... 47 more
This looks similar to issue https://issues.jboss.org/browse/ENTESB-593; however, looks like the 'fix' to that issue involved only having the configuration files copied into the ${karaf.base}/etc folder, but not actually triggering and synchronizing on karaf configuration manager before starting the bundles
I'm a bit stuck with this issue. Obviously I could just set 'start="false"' for my bundles and manually start all the camel context bundles after profile deployment, but I'd like to know if there is a more optimal solution.
I've come up up with the following hacky workaround so far:
Add a dependency for org.osgi:org.osgi.compendium:5.0.0 and org.osgi:org.osgi.core:5.0.0
Create the following BundleActivator class:
.
package com.myorg.common;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.cm.Configuration;
import org.osgi.service.cm.ConfigurationEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Dictionary;
public class ConfigurationActivator implements BundleActivator {
public static final String BUNDLE_CONFIGURATION_WATCH = "bundle.configuration.watch";
public static final String BUNDLE_SYMBOLIC_NAME = "bundle.symbolic.name";
private static final Logger LOG = LoggerFactory.getLogger(ConfigurationActivator.class);
private ServiceRegistration<org.osgi.service.cm.ConfigurationListener> listenerReg;
public void start(BundleContext context) throws Exception {
LOG.debug("Bundle " + context.getBundle().getSymbolicName() + " starting");
listenerReg = context.registerService(org.osgi.service.cm.ConfigurationListener.class,
new ConfigurationListener(context), null);
}
public void stop(BundleContext context) throws Exception {
LOG.debug("Bundle " + context.getBundle().getSymbolicName() + " stopping");
if (listenerReg != null) {
listenerReg.unregister();
}
}
public class ConfigurationListener implements org.osgi.service.cm.ConfigurationListener {
private BundleContext bundleContext;
public ConfigurationListener(BundleContext bundleContext) {
this.bundleContext = bundleContext;
}
public void configurationEvent(ConfigurationEvent configurationEvent) {
try {
if (configurationEvent.getType() == ConfigurationEvent.CM_UPDATED) {
LOG.debug("Configuration update event: " + configurationEvent.getPid());
Bundle bundle = bundleContext.getBundle();
LOG.trace("Bundle " + bundle.getSymbolicName() + " state: " + bundle.getState());
try {
Configuration configuration = bundleContext.getService(configurationEvent.getReference()).getConfiguration(configurationEvent.getPid());
if (configuration != null) {
Dictionary<String, Object> properties = configuration.getProperties();
if (properties != null) {
if (Boolean.TRUE.toString().equals(properties.get(BUNDLE_CONFIGURATION_WATCH))
&& bundle.getSymbolicName().equals(properties.get(BUNDLE_SYMBOLIC_NAME))) {
LOG.info("Updating bundle " + bundle.getSymbolicName() + " due to configuration change");
bundle.update();
}
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
} catch (IllegalStateException se) {
LOG.warn("Bundle context has been invalidated");
}
}
}
}
Add this bundle activator to the bundle manifest
Add the following properties to your configuration file:
bundle.configuration.watch=true
bundle.symbolic.name=<bundle-name>
Deploy the feature. If the configuration has changed after the bundle has already attempted to start, the bundle will be updated
This still feels inelegant to me due to two reasons:
Additional configuration properties
The original issue will still cause confusing error messages in the logs during deployment
Can anyone suggest a better answer?
I want to write an OSGI Bundle (Eclipse SmartHome Binding) for the GPIO's of a Raspberry Pi.
For the GPIO's i need to include the Pi4J libraries. I added them into a lib folder in my project folder and added the pi4j-core.jar to my Build Path.
This is my code:
/**
* Copyright (c) 2014 openHAB UG (haftungsbeschraenkt) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.openhab.binding.statusgpio.handler;
import static org.openhab.binding.statusgpio.StatusGPIOBindingConstants.*;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.eclipse.smarthome.core.library.types.StringType;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.Thing;
import org.eclipse.smarthome.core.thing.binding.BaseThingHandler;
import org.eclipse.smarthome.core.types.Command;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.PinPullResistance;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
/**
* The {#link StatusGPIOHandler} is responsible for handling commands, which are
* sent to one of the channels.
*
* #author Arjuna W. - Initial contribution
*/
public class StatusGPIOHandler extends BaseThingHandler {
ScheduledFuture<?> refreshJob;
public StatusGPIOHandler(Thing thing) {
super(thing);
}
#Override
public void initialize() {
// TODO Auto-generated method stub
super.initialize();
startAutomaticRefresh();
}
#Override
public void handleCommand(ChannelUID channelUID, Command command) {
// TODO Auto-generated method stub
// do nothing ;)
}
private void startAutomaticRefresh() {
final GpioController gpio = GpioFactory.getInstance();
// provision gpio pin #02 as an input pin with its internal pull down
// resistor enabled
final GpioPinDigitalInput myButton = gpio.provisionDigitalInputPin(
RaspiPin.GPIO_02, PinPullResistance.PULL_DOWN);
// create and register gpio pin listener
myButton.addListener(new GpioPinListenerDigital() {
#Override
public void handleGpioPinDigitalStateChangeEvent(
GpioPinDigitalStateChangeEvent event) {
// display pin state on console
updateState(new ChannelUID(getThing().getUID(), CHANNEL_LOADING_STATE), new StringType(event.getState().toString()));
}
});
try {
for (;;) {
Thread.sleep(1000);
}
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
The Class has no problem to find the Pi4J imports and export to a jar is also no problem. Only if I run it directly in the Eclipse OpenHab_runtime I geht the Error:
!Validation:
The following Problems were detected:
org.openhab.binding.statusgpio
Missing Constraint: Import-Package: com.pi4j.io.gpio; version="0.0.0"
When I start the OSGI Bundle on my Raspberry Pi (and on my Win PC) I get the message:
start 92
gogo: BundleException: Could not resolve module: org.openhab.binding.statusgpio [92]
Unresolved requirement: Import-Package: com.pi4j.io.gpio
I think I have to do something more with the Bundle to let OSGI find the Pi4J Libs???
Thanks for Help.
I found my own mistake:
I thought I hat to add "com.pi4j.io.gpio" to the includes in the Manifest file, but I don't want to import it from other OSGI Bundles, I want to import it from an alteady imported JAR. So I just had to delete this line and everything worked.
Edit:
I found the answer here: https://github.com/ECF/RaspberryPI/tree/master/bundles/com.pi4j
This is my manifest.mf:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: OutputGPIO Binding
Bundle-SymbolicName: org.openhab.binding.outputgpio;singleton:=true
Bundle-Vendor: openHAB
Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: lib/pi4j-core.jar,
lib/pi4j-device.jar,
lib/pi4j-gpio-extension.jar,
lib/pi4j-service.jar,
.
Import-Package: com.google.common.collect,
org.eclipse.smarthome.config.core,
org.eclipse.smarthome.config.discovery,
org.eclipse.smarthome.core.library.types,
org.eclipse.smarthome.core.thing,
org.eclipse.smarthome.core.thing.binding,
org.eclipse.smarthome.core.types,
org.slf4j
Service-Component: OSGI-INF/*
Export-Package: org.openhab.binding.outputgpio,
org.openhab.binding.outputgpio.handler
On the server side of my GWT app I use classes from the org.apache.commons.httpclient package. These classes are conveniently packaged in gwt-dev.jar distributed with GWT. I include this jar (along the gwt-servlet.jar) in the WEB-INF/lib of the war.
When deploying the produced war file on glassfish and calling the page I get the following exception in the server logs (and an RPC fail)
NoClassDefFoundError: org/apache/commons/httpclient/HttpException
What should I do so that glassfish finds the classes in the gwt-dev.jar?
-- more details --
As an SSCCE which reproduces the problem, I have modified class GreetingServiceImpl of the GWT example:
import org.apache.commons.httpclient.HttpException;
public String greetServer(String input) throws IllegalArgumentException {
try {
if(input.equals("hello")){
throw new HttpException();
}
} catch (HttpException e) {
throw new RuntimeException(e);
}
... the rest of the GWT example app
Here's the content of the war
> jar -tf mytest.war
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/com/
WEB-INF/classes/com/mytest/
WEB-INF/classes/com/mytest/client/
WEB-INF/classes/com/mytest/server/
WEB-INF/classes/com/mytest/shared/
WEB-INF/lib/
mytest/
mytest/gwt/
mytest/gwt/standard/
mytest/gwt/standard/images/
mytest/gwt/standard/images/ie6/
MyTest.css
MyTest.html
WEB-INF/classes/com/mytest/MyTest.gwt.xml
WEB-INF/classes/com/mytest/client/GreetingService.class
WEB-INF/classes/com/mytest/client/GreetingServiceAsync.cla
WEB-INF/classes/com/mytest/client/MyTest$1.class
WEB-INF/classes/com/mytest/client/MyTest$1MyHandler$1.clas
WEB-INF/classes/com/mytest/client/MyTest$1MyHandler.class
WEB-INF/classes/com/mytest/client/MyTest.class
WEB-INF/classes/com/mytest/server/GreetingServiceImpl.clas
WEB-INF/classes/com/mytest/shared/FieldVerifier.class
WEB-INF/lib/gwt-dev.jar
WEB-INF/lib/gwt-servlet.jar
WEB-INF/web.xml
mytest/0A9476898799A150D840F0B1C3672921.cache.png
mytest/2E5321B05D040C654474157464A1320D.cache.html
mytest/342DCE11554A2ED2AAE7C85966745477.cache.html
mytest/396F806CD63ABD414BFBB9D57429F05B.cache.png
mytest/505B1AEFC510FA6C8E519C08BD073CE0.cache.html
mytest/8C8B81BFBAD2494F16B95F537039AC9C.gwt.rpc
mytest/B33A642CF9F25C17BB1B43D744B059AE.cache.html
mytest/C8061F2305971473D1402197D362AAFE.cache.html
mytest/DF7764EEC1903CD03C9545B354D8D8E4.cache.png
mytest/E224554766C17094274FFD5F9B5E2DCC.cache.html
mytest/E44767377485D18D6B6864F65BA8EF73.cache.png
mytest/EDC7827FEEA59EE44AD790B1C6430C45.cache.png
mytest/clear.cache.gif
mytest/gwt/standard/images/corner.png
mytest/gwt/standard/images/corner_ie6.png
mytest/gwt/standard/images/hborder.png
mytest/gwt/standard/images/hborder_ie6.png
mytest/gwt/standard/images/ie6/corner_dialog_topleft.png
mytest/gwt/standard/images/ie6/corner_dialog_topright.png
mytest/gwt/standard/images/ie6/hborder_blue_shadow.png
mytest/gwt/standard/images/ie6/hborder_gray_shadow.png
mytest/gwt/standard/images/ie6/vborder_blue_shadow.png
mytest/gwt/standard/images/ie6/vborder_gray_shadow.png
mytest/gwt/standard/images/splitPanelThumb.png
mytest/gwt/standard/images/vborder.png
mytest/gwt/standard/images/vborder_ie6.png
mytest/gwt/standard/standard.css
mytest/gwt/standard/standard_rtl.css
mytest/hosted.html
mytest/mytest.nocache.js
And the full exception stacktrace
PWC1382: Allocate exception for servlet greetServlet java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpException at
java.lang.Class.getDeclaredConstructors0(Native Method) at
java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at
java.lang.Class.getConstructor0(Class.java:2699) at
java.lang.Class.newInstance0(Class.java:326) at
java.lang.Class.newInstance(Class.java:308) at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1132) at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:832) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202) at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at
com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206) at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150) at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272) at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637) at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568) at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813) at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263) at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214) at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Content of gwt-dev.jar, (total of 11000 classes and packages)
> jar -tf gwt-dev.jar
META-INF/MANIFEST.MF
LICENSE.txt
META-INF/
META-INF/LICENSE
...
com/gargoylesoftware/htmlunit/...
com/google/gwt/core/...
com/google/gwt/dev/...
com/steadystate/css/...
java_cup/runtime/...
javax/management/...
javax/servlet/...
javax/xml/...
mx4j/...
net/sourceforge/htmlunit/...
org/apache/bcel/...
org/apache/catalina/...
org/apache/commons/...
org/apache/commons/httpclient/
...
org/apache/commons/httpclient/HttpContentTooLargeException.class
org/apache/commons/httpclient/HttpException.class
org/apache/commons/httpclient/HttpHost.class
...
org/apache/coyote/...
org/apache/html/...
org/apache/jasper/...
org/apache/tomcat/...
etc...
You should add the commons-httpclient.jar (or httpclient-4.0.1.jar - depends on distribution) to your 'WEB-INF/lib directory'.
You can download it from here