Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ephemeris] Added Ephemeris service #506

Merged
merged 8 commits into from
Jun 11, 2019
Merged

Conversation

kaikreuzer
Copy link
Member

Ported over from eclipse-archived/smarthome#6227.

@maggu2810 Did I do it correctly to add the jollyday lib to the compile- and runtime-bom?

Also-by: Gaël L'hopital gael@lhopital.org
Signed-off-by: Kai Kreuzer kai@openhab.org

@kaikreuzer
Copy link
Member Author

@maggu2810 Did I do it correctly to add the jollyday lib to the compile- and runtime-bom?

Correction: ...to the compile-bom, runtime-bom AND the bundle pom itself?

Copy link
Contributor

@maggu2810 maggu2810 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some minor comments.
I also reviewed (a little bit) the code regardless if it has "only" been ported...

<artifactId>org.openhab.core.config.core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not add any external dependency here.
That should be injected by the compile BOM already.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I expected as well. But as you can see here, the PR build failed without it and once I added it, it succeeded. Any idea why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my machine it is working (building the project after removing that lines).

Looking at the check of the first commit:

  • continuous-integration/travis-ci/pr: success
  • PR-openHAB-Core: failure

I assume you should check your Jenkins configuration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO my comment is still valid and should be addressed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely - sorry, it slipped through. Fixed now.

features/karaf/openhab-core/src/main/feature/feature.xml Outdated Show resolved Hide resolved
@kaikreuzer
Copy link
Member Author

@maggu2810 Any idea why travis failed? Did I do anything wrong wrt capability/requirement?

@maggu2810
Copy link
Contributor

You define a capability but no option how it could be resolved it is it not already be resolved by the current environment.
We always add a optional dependency to a feature.

See:

<requirement>openhab.tp;filter:="(feature=base)"</requirement>
<feature dependency="true">openhab.tp-base</feature>
<requirement>openhab.tp;filter:="(&amp;(feature=xtext)(version&gt;=2.14.0)(!(version&gt;=2.15.0)))"</requirement>
<feature dependency="true">openhab.tp-xtext</feature>
<requirement>openhab.tp;filter:="(feature=jax-rs)"</requirement>
<feature dependency="true">openhab.tp-jax-rs</feature>
<requirement>openhab.tp;filter:="(feature=httpclient)"</requirement>
<feature dependency="true">openhab.tp-httpclient</feature>

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/caldav-binding-to-read-holidays-calendar/66367/13

@kaikreuzer
Copy link
Member Author

Thanks - hopefully it is fixed now.

bundles/org.openhab.core.ephemeris/build.properties Outdated Show resolved Hide resolved
features/karaf/openhab-core/src/main/feature/feature.xml Outdated Show resolved Hide resolved
<artifactId>org.openhab.core.config.core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my machine it is working (building the project after removing that lines).

Looking at the check of the first commit:

  • continuous-integration/travis-ci/pr: success
  • PR-openHAB-Core: failure

I assume you should check your Jenkins configuration.

@svendiedrichsen
Copy link

svendiedrichsen commented Feb 11, 2019

@kaikreuzer I wrote the Jollyday library. If there is anything I can do to help please contact me.

@meingraham
Copy link

Is there an ETA on a beta version of the Ephemeris service? I'm happy to be an early tester.

@maggu2810
Copy link
Contributor

@kaikreuzer Do you plan to update this PR?

@kaikreuzer
Copy link
Member Author

I had put in on hold as long as I didn't have a proper IDE. Will try to find time to revisit it.

@clinique As this code was written by you, feel free to help getting it merged by doing PRs against this branch :-)

Also-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer
Copy link
Member Author

All, sorry for the delay. All comments should be addressed now.

@kaikreuzer kaikreuzer added rebuild Triggers the Jenkins PR build and removed rebuild Triggers the Jenkins PR build labels Jun 10, 2019
@kaikreuzer kaikreuzer closed this Jun 10, 2019
@kaikreuzer kaikreuzer reopened this Jun 10, 2019
<artifactId>org.openhab.core.config.core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO my comment is still valid and should be addressed.

features/karaf/openhab-tp/src/main/feature/feature.xml Outdated Show resolved Hide resolved
Signed-off-by: Kai Kreuzer <kai@openhab.org>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer
Copy link
Member Author

Thanks, @maggu2810, I have addressed all your comments.

Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer
Copy link
Member Author

Seems I still got something wrong wrt to the feature definitions...

@@ -114,6 +114,16 @@
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.config.discovery.usbserial.linuxsysfs/${project.version}</bundle>
</feature>

<feature name="openhab-core-ephemeris" version="${project.version}">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You miss the ephemeris bundle itself in this very specific feature

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. No idea how that got lost...

Signed-off-by: Kai Kreuzer <kai@openhab.org>
@maggu2810 maggu2810 merged commit d0dfbe3 into openhab:master Jun 11, 2019
@kaikreuzer kaikreuzer deleted the ephemeris branch June 11, 2019 09:01
@wborn
Copy link
Member

wborn commented Jun 11, 2019

After building a local distro I now see the following exceptions:

22:01:50.121 [ERROR] [org.openhab.core.model.script        ] - FrameworkEvent ERROR - org.openhab.core.model.script
org.osgi.framework.ServiceException: Exception in org.apache.felix.scr.impl.manager.SingleComponentManager.getService()
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:222) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:508) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) ~[?:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:624) ~[?:?]
	at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39) ~[?:?]
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) ~[?:?]
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870) ~[?:?]
	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) ~[?:?]
	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183) ~[?:?]
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318) ~[?:?]
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261) ~[?:?]
	at com.eclipsesource.jaxrs.publisher.internal.Activator.openAllServiceTracker(Activator.java:91) ~[?:?]
	at com.eclipsesource.jaxrs.publisher.internal.Activator.start(Activator.java:55) ~[?:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:779) ~[?:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:772) ~[?:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:729) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:933) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:309) ~[?:?]
	at org.eclipse.osgi.container.Module.doStart(Module.java:581) ~[?:?]
	at org.eclipse.osgi.container.Module.start(Module.java:449) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402) ~[?:?]
	at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.startBundle(BundleInstallSupportImpl.java:165) ~[?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1153) ~[?:?]
	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1036) ~[?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:?]
	at java.lang.Thread.run(Thread.java:748) ~[?:?]
Caused by: java.lang.NoClassDefFoundError: org/eclipse/smarthome/core/ephemeris/EphemerisManager
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:?]
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[?:?]
	at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BindMethod.getServiceObjectAssignableMethod(BindMethod.java:469) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BindMethod.doFindMethod(BindMethod.java:180) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.findMethod(BaseMethod.java:173) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$400(BaseMethod.java:41) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod$NotResolved.resolve(BaseMethod.java:602) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod$NotResolved.methodExists(BaseMethod.java:626) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.methodExists(BaseMethod.java:528) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BindMethod.getServiceObject(BindMethod.java:659) ~[?:?]
	at org.apache.felix.scr.impl.manager.DependencyManager.getServiceObject(DependencyManager.java:2308) ~[?:?]
	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.prebind(DependencyManager.java:1154) ~[?:?]
	at org.apache.felix.scr.impl.manager.DependencyManager.prebind(DependencyManager.java:1568) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractComponentManager.java:1029) ~[?:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:935) ~[?:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:900) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) ~[?:?]
	... 34 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.smarthome.core.ephemeris.EphemerisManager cannot be found by org.openhab.core.model.script_2.5.0.201906111951
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) ~[?:?]
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[?:?]
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[?:?]
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[?:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?]
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:?]
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[?:?]
	at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BindMethod.getServiceObjectAssignableMethod(BindMethod.java:469) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BindMethod.doFindMethod(BindMethod.java:180) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.findMethod(BaseMethod.java:173) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$400(BaseMethod.java:41) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod$NotResolved.resolve(BaseMethod.java:602) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod$NotResolved.methodExists(BaseMethod.java:626) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.methodExists(BaseMethod.java:528) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BindMethod.getServiceObject(BindMethod.java:659) ~[?:?]
	at org.apache.felix.scr.impl.manager.DependencyManager.getServiceObject(DependencyManager.java:2308) ~[?:?]
	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.prebind(DependencyManager.java:1154) ~[?:?]
	at org.apache.felix.scr.impl.manager.DependencyManager.prebind(DependencyManager.java:1568) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractComponentManager.java:1029) ~[?:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:935) ~[?:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:900) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) ~[?:?]
	... 34 more

@maggu2810
Copy link
Contributor

I did not realize the namesoace on review.
Why do we use org.eclipse.smarthome for code that is newly added to the repository?

@maggu2810
Copy link
Contributor

@kaikreuzer Can you comment?

@kaikreuzer
Copy link
Member Author

Why do we use org.eclipse.smarthome for code that is newly added to the repository?

Because of #506 (comment): "Ported over from eclipse-archived/smarthome#6227". This was a contribution to ESH, which just wasn't merged on time.
I agree that we could have adapted the namespace, but I tried to keep it the original contribution that it was.
Ok for me to do a follow-up PR with an updated namespace, if you wish. Otherwise, we do it with an upcoming bulk rename for 3.x.

@maggu2810
Copy link
Contributor

We renamed the whole automation part that has already been part of ESH.
I don't understand for which part it is important and for which contribution it is optional.

@kaikreuzer
Copy link
Member Author

For automation it was exceptionally important as this code was a new API that many bindings immediately wanted to use, so a lot of code was implemented using it.

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/jython-logaction-not-working/77115/7

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/preparation-for-2-5m2/75738/1

@wborn wborn added this to the 2.5 milestone Jul 30, 2019
@cweitkamp cweitkamp added the enhancement An enhancement or new feature of the Core label Dec 3, 2019
@cweitkamp cweitkamp changed the title Ephemeris service [ephemeris] Added Ephemeris service Dec 3, 2019
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
Also-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
GitOrigin-RevId: d0dfbe3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core new contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants