Tuesday, May 31, 2016

Cheeky Git Commands

Just storing the list of git commands I seem to always come back to trying to find. Will reference the original source when possible.

Update the remote branch list on your local (Detlus Knowldge)
$ git remote update origin --prune

Replace the local version with the remote version
$ # fetch the latest changes
$ git fetch origin
$
$ # reset the branch to fetched changes (assuming you're working on master)
$ git reset --hard origin/master

Rename a local branch (pre-push to origin)
$ # checkout the branch to rename
$ git checkout branch-name
$ 
$ # rename the branch
$ git branch -m new-branch-name

Push and track a local branch to origin
$ # switch the branch to push and track
$ git checkout branch-name
$ 
$ # push the branch to origin
$ git push -u origin branch-name

Friday, May 6, 2016

ACS Commons twitter4j bundle not resolved

We were getting an annoying error in our log files due to the ACS Commons Twitter integration not being able to resolve the twitter4j dependancy. We were seeing this in the logs and one of the bundles remained in an "Installed" state.
06.05.2016 10:11:22.263 *INFO* [OsgiInstallerImpl] org.apache.sling.installer.core.impl.tasks.BundleStartTask Could not start bundle com.adobe.acs.acs-aem-commons-bundle-twitter [519]. Reason: {}. Wil
l retry.
org.osgi.framework.BundleException: Unresolved constraint in bundle com.adobe.acs.acs-aem-commons-bundle-twitter [519]: Unable to resolve 519.0: missing requirement [519.0] osgi.wiring.package; (&(osg
i.wiring.package=twitter4j)(version>=3.0.5)(!(version>=4.0.0)))
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3980)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2043)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963)
        at org.apache.sling.installer.core.impl.tasks.BundleStartTask.execute(BundleStartTask.java:93)
        at org.apache.sling.installer.core.impl.OsgiInstallerImpl.executeTasks(OsgiInstallerImpl.java:735)
        at org.apache.sling.installer.core.impl.OsgiInstallerImpl.run(OsgiInstallerImpl.java:249)
        at java.lang.Thread.run(Thread.java:745)
In the OSGi Bundles, we're seeing the following:
After a bit of digging I came across the ACS AEM Bundles page and there it is, our missing twitter4j bundle!

Installing the com.adobe.acs.bundles.twitter4j-content-1.0.0.zip bundle resolved the missing constraints, allowed the ACS Commons Twitter bundle to be installed and got rid of the constant errors.

Hope this helps someone else out there!