modular-mind / updatemanager

Simple service that performs p2 auto-update and auto-install logic for Eclipse RCP applications
Eclipse Public License 2.0
7 stars 3 forks source link

NPE in UpdateManagerImpl #2

Closed nagelfargithub closed 3 years ago

nagelfargithub commented 3 years ago

I wanted to give this a spin and installed it from the provided p2 repository but this lead to a NPE:

Caused by: java.lang.NullPointerException
    at com.modumind.updatemanager.service.impl.UpdateManagerImpl.log(UpdateManagerImpl.java:380)
    at com.modumind.updatemanager.service.impl.UpdateManagerImpl.performAutoUpdate(UpdateManagerImpl.java:94)
    at com.evolit.klv.ui.LifeCycleManager.doUpdateCheck(LifeCycleManager.java:71)
    at com.evolit.klv.ui.LifeCycleManager.postContextCreate(LifeCycleManager.java:58)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

I can see a commit adressing this issue but perhaps the p2 repository was not updated?

modular-mind commented 3 years ago

I just updated the repo with the latest build. Thanks for pointing that out :-)

nagelfargithub commented 3 years ago

Does it now depend on Java 11 or am I not reading this correctly? Cause we are using Java 8 and that worked before...

 Cannot resolve target definition:
[ERROR]   Software being installed: com.modumind.updatemanager.feature.feature.group 1.0.0.202106211542
[ERROR]   Missing requirement: com.modumind.updatemanager.service 1.0.0.202106211542 requires 'osgi.ee; (&(osgi.ee=JavaSE)(version=11))' but it could not be found
[ERROR]   Cannot satisfy dependency: com.modumind.updatemanager.feature.feature.group 1.0.0.202106211542 depends on: org.eclipse.equinox.p2.iu; com.modumind.updatemanager.service [1.0.0.202106211542,1.0.0.202106211542]
modular-mind commented 3 years ago

I looked through the history and it's always been Java 11. But I set it back to Java 8 and rebuilt the repo. Let me know if that works for you.

nagelfargithub commented 3 years ago

Yes, that works for me, thank you.

I was not able to hook a logger into your update using declarative services, that might be my setup though.

Logging to System.out works for my prototype but I think the messages could benefit from a little more explanation e.g. I find No profile found for this installation, ending auto update process not really helpful in this context but I have yet to read into the p2 update mechanism. Also, small typo: provisioingAgentProvider

nagelfargithub commented 3 years ago

I managed to find a solution for the No profile found message, I need to set this option in my runconfiguration image

modular-mind commented 3 years ago

That will work to give you a profile, but my understanding is that you can't actually apply updates when running in the IDE. I usually wind up testing with builds of my application and use remote debugging if necessary.

nagelfargithub commented 3 years ago

That's probably true but for setting up the feature and everything around it I need the possibility to quickly adapt and rerun the project without waiting for a full build.