-
Notifications
You must be signed in to change notification settings - Fork 8
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
Sort out why i18n doesn't work from Jar file #25
Comments
Didn't realise you already fixed this on dev (as it appears to me working now in dev), but I got it working using a different approach. Updating utils to (clojure.java.io/resource "filename") (defn raw-get-messages This ensures the classpath location is being used to locate the file: https://stackoverflow.com/questions/8009829/resources-in-clojure-applications |
H'mmm... my solution doesn't work for me, so I'll try yours ;-) More to the point I'm facing an issue where I need to supply configuration parameters in one way if Smeagol is launched as an executable Jar file, and in another if Smeagol is run as a War file in a servlet container. I've submitted a pull request on lein-ring which allows abitrary One thing is I could create a form editable by the admin user which allows editing of the contents of the I haven't reached a solution I'm entirely comfortable with; but at the same time I want to have a finished 1.0.0 release sometime this month, so I need to make up my mind. |
Odd, I put that change in (mines) and tried to push, but realised I was still on master and switched to dev minus my changes and it still worked. Possibly I didn't clear my browser cache properly, but that change certainly worked when I tried it. And it was just a tweak to the utils file. |
Not sure if I have permission to push/create pull requests to your project. |
One idea is to use something simple like couchdb or sqlite as a backing store and having an initial setup page to specify configuration parameters/overrides. I'm sure you have already considered this in the past, which is why I was reluctant to suggest it :). |
I've now read up on Twelve-Factor App, this is something I've been ignorant of, until now.. |
Ha! The whole motivation for building Smeagol was I wanted to get away from having an SQL back end. Yes, that would work. To submit a pull request, fork the project (there's a button to do that top right of the project page), check out from your repository, make your change, commit it to your repository, and then create a pull request from yours to mine. You'll find the github workflow runs really smoothly. If you download the Zenhub plugin for Chrome, you'll be able to see my kanban board (and then we can work out how to give you permission to edit it). |
Pull request is in. Hopefully that works for you. |
Setup zenhub and can now see your kanban board. |
Damn. Still doesn't work. I'm getting:
The path is correct:
Don't know. Not fixed. |
Very strange, I duplicated the problem yesterday, updated that line of code and the main smeagol page was displayed. I'll nuke my local copy and checkout development again to verify. |
I did as I said above and the main landing page/login page is displayed, which was not happening previously. I'm developing this on Windows at the moment, which I doubt is a factor. Is this another section of the site your getting this error? |
Can you verify with just my latest change? I'm thinking you might have other stuff lingering around that might be causing this i.e another issue from the I18n? |
OK, where you running from an ubrerjar file? The recipe is
Obvs, point SMEAGOL_CONTENT_DIR at some directory which exists and is writable (but doesn't contain anything you value!) That has to work. |
I've not done any of that. I just did
Originally, I got the error about resolving the I18n file, but after adding my fix, I can now see the main page. I will retry with your recipe above.` |
It could be in the i18n library, but I don't think so. I realise I haven't pushed the i18n library up to Github - will do that. |
Yes I have - thought I had - just forgotten the name. |
I'm getting something different: The path is accessible. I assume I've missed a step to generate content to that folder as it's looking for _side-bar.md on startup. |
Ok, I definitely must be missing something as when I start up smeagol following your guide ,I get the above error. What I did to correct this was copy the content of C:\development\clojure-work\smeagol\resources\public\content (which has _side-bar.md) to C: C:\development\clojure-work\smeagol\temp_output and smeagols auth page rendered correctly. |
Never mind, I misunderstood what you said before. The name of the variable says it all SMEAGOL_CONTENT_DIR !!! I've just pointed it at that and as I said before, the smealgol auth & home page displays fine for me. |
In addition to it working with uberjar, I've tried uberwar (with my latest pull request) and it deploys fine to the latest tomcat. I am able to view the landing page and login as admin/admin. |
Have you had a chance to check my latest push? I've tested on both tomcat and ring/jetty. Seems to work fine for me. |
Sorry, been unwell. On it now. |
no worries, hope your on the mend. Let me know if that latest pull request sorts things. |
OK, this still isn't working, but I think it's better. The underlying problem is that I'm confusing files with resources and vice-versa, and this problem exists in botth the Smeagol code base and in the internationalisation code base. I think it's fixed now in internationalisation, but the resources are not being picked up in unit tests which I think is a unit test misconfiguration rather than a code error (but might not be). Smeagol is BETTER, in that it will now run from a Jar file without internationalisation breaking, but it's not fixed. |
This is a fix, but it's a fix against the `develop` branch of [internationalisation](https://github.com/simon-brooke/internationalisation), so I need to do a new release of internationalisation before I call this a full fix.
Fix. |
When you start Smeagol as an executable Jar file (i.e. running from Jetty within a Jar file), a number of things go wrong. But the oddest is that it fails to access its i18n resources - which are in the jar file, so should be available.
I'm missing something here.
The text was updated successfully, but these errors were encountered: