question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RxJavaHook onCreate throwing --> java.lang.NoSuchMethodError: rx.plugins.RxJavaPlugins.getCompletableExecutionHook()Lrx/plugins/RxJavaCompletableExecutionHook;

See original GitHub issue

Hi,

I am trying to use the Completable.fromAction() method. But getting exception in the RxJavaHook.onCreate method. Below are the details -

Code Snippet -

Completable completable1 = Completable.fromAction(() -> {
	try {
		assignActionsToUser(actions, newUserId, start.getTime(), end.getTime(), "EXTTMS");
		} catch (EUMException e) {
				e.printStackTrace();
		}
		}).subscribeOn(Schedulers.io());_


private void assignActionsToUser(List<String> actions, String newUserId, Date startTime,
										Date endTime, String lastUpdUserId) throws 
		externalUserManagementService.assignActionsToUser(actions, newUserId, startTime, endTime, 
	}

Maven dependency -

    <dependency>
        <groupId>io.reactivex</groupId>
        <artifactId>rxjava</artifactId>
        <version>1.3.6</version>
    </dependency>

Exception -

java.lang.NoSuchMethodError: rx.plugins.RxJavaPlugins.getCompletableExecutionHook()Lrx/plugins/RxJavaCompletableExecutionHook;

/**
 * Hook to call when a Completable is created.
 * @param onSubscribe the original OnSubscribe logic
 * @return the original or replacement OnSubscribe instance
 */
public static Completable.OnSubscribe onCreate(Completable.OnSubscribe onSubscribe) {
    Func1<Completable.OnSubscribe, Completable.OnSubscribe> f = onCompletableCreate;
    if (f != null) {
        return f.call(onSubscribe); // exception thrown here
    }
    return onSubscribe;
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
akarnokdcommented, Feb 26, 2018

Please create a fresh project with only RxJava as a dependency and a plain old Java main(String[] args) method with the basic Completable.create. If that works, your other project is likely not cleaned up properly after a version upgrade.

0reactions
anand1430commented, Feb 26, 2018

@akarnokd - Apologize its a project issue. I was able to make it work with a new project. My bad. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FATAL EXCEPTION: main java.lang.NoClassDefFoundError ...
In my application after successfully login, loading data through retrofit library. from last two days i founded one major issue in my ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found