edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
714 stars 110 forks source link

URL resolving counter intuitive #13

Closed mainrs closed 8 years ago

mainrs commented 8 years ago

I tried to setup an update repository for my app with github pages. The url (folder) that contains all files is http://sirwindfield.github.io/taskflow/application-support. I added it in the manifest as app.url. But resolving the url for the first artifact, guide.jar, doesn't work as I would have expected it. The launcher checks the location http://sirwindfield.github.io/guice.jar.

I understand that it resolves it correctly (from a programmer's view) but specifying a URL should allow people to be able to use other locations and not only the base url location.

edvin commented 8 years ago

It should resolve to http://sirwindfield.github.io/taskflow/application-support/guice.jar. I remember there was a bug in the url resolver a while back, can you confirm you're running against version 1.0.11? If not, try updating to the latest version or simply append a trailing slash on the url, so it reads http://sirwindfield.github.io/taskflow/application-support/. I think the bug was triggered when the url didn't end with a slash.

mainrs commented 8 years ago

Ye, it was the last slash... Now I get another error. Some parsing problems with the xml file but it looks right imo.

WARNING: Unable to update manifest
javax.xml.bind.DataBindingException: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; systemId: http://sirwindfield.github.io/taskflow/application-support/app.xml; lineNumber: 6; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag "</hr>".]
    at javax.xml.bind.JAXB.unmarshal(JAXB.java:189)
    at fxlauncher.Launcher.syncManifest(Launcher.java:230)
    at fxlauncher.Launcher.updateManifest(Launcher.java:128)
    at fxlauncher.Launcher.lambda$start$0(Launcher.java:60)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; systemId: http://sirwindfield.github.io/taskflow/application-support/app.xml; lineNumber: 6; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag "</hr>".]
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:335)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:563)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:249)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:221)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:276)
    at javax.xml.bind.JAXB.unmarshal(JAXB.java:186)
    ... 4 more
Caused by: org.xml.sax.SAXParseException; systemId: http://sirwindfield.github.io/taskflow/application-support/app.xml; lineNumber: 6; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag "</hr>".
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1750)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2970)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
    ... 7 more

Here is the xml file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Application uri="http://sirwindfield.github.io/taskflow/application-support/" launch="de.zerotask.taskflow.TaskflowApplication">
    <lib file="aopalliance.jar" checksum="2581466319" size="4467"/>
    <lib file="application.jar" checksum="141746663" size="1545"/>
    <lib file="framework.jar" checksum="3616978417" size="1441"/>
    <lib file="guava.jar" checksum="1667460239" size="2228009"/>
    <lib file="guice.jar" checksum="3671510704" size="668235"/>
    <lib file="guiceinjector.jar" checksum="1075369626" size="1517"/>
    <lib file="javax.inject.jar" checksum="180262715" size="2497"/>
    <updateText>Updating...</updateText>
    <updateLabelStyle>-fx-font-weight: bold;</updateLabelStyle>
    <progressBarStyle>-fx-pref-width: 200;</progressBarStyle>
    <wrapperStyle>-fx-spacing: 10; -fx-padding: 25;</wrapperStyle>
    <cacheDir>libraries</cacheDir>
</Application>
edvin commented 8 years ago

That's weird. Can you attach fxlauncher.jar after you have run the embedAppManifest goal on it?

mainrs commented 8 years ago

Github doesn't allow be to upload a jar file. Here is a dropbox link: https://www.dropbox.com/s/i6mwr2qak2cfogd/fxlauncher.jar?dl=0

edvin commented 8 years ago

I think the github page might be redirecting you and possibly delivering some other content on that initial request, can you try changing the url to https://sirwindfield.github.io/taskflow/application-support/? (https instead of http to avoid the redirect).

mainrs commented 8 years ago

It was some redirecting issue. Thank you! Wouldn't have figured that out by myself...

edvin commented 8 years ago

Great! I'll look into handling redirection better as well :)