Loading Seaside 30 in Pharo 3 results in a MetacelloProjectSpecLoadError about ConfigurationOfOmniBrowser? - pharo

No version found for #stable of ConfigurationOfOmniBrowser?
Just downloaded Pharo 3 from here: http://files.pharo.org/platform/Pharo3.0-portable.zip
Opened an workspace and did this:
Gofer new
squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfSeaside30';
load.
(Smalltalk at: #ConfigurationOfSeaside30) load.
I get this error:

Well... in Pharo, correct configuration is Seaside3... and it is not in MetacelloRepository since starting in Pharo3 we switched to a "per version" repo.
So, this code should do the work:
Gofer new
smalltalkhubUser: 'Pharo' project: 'MetaRepoForPharo30';
configurationOf: 'Seaside3';
loadStable.

Related

In a ScalaJs sbt build, is there any advantage to use webjars instead of npm or bower with 'Provided'?

When I first discovered webJars a few months ago I was super-skeptical that it would be be a viable way means of handling client-side dependencies given the enormous complexity of some of these builds/buildsystems, and given the frequency that js files are published. The second concern was of course not well-founded but I feel vindicated on the first after spending almost 36 hours now trying in vain to get about 10 scss/css/less-type webJars and 8 JS webJars to live under one jsDependencies roof.
What I found as that by the time you reach JS dependency 3, 4, or 5,you start getting into a ridiculous timekill loop:
1. "Oh nos! fastOptJS failed because there was some random file that was also named the same as a dependency in the webjar!"
[trace] Stack trace suppressed: run last client/compile:resolvedJSDependencies for the full output.
[error] (client/compile:resolvedJSDependencies) org.scalajs.core.tools.jsdep.JSLibResolveException: Some references to JS libraries could not be resolved:
[error] - Ambiguous reference to a JS library: bootstrap.min.js
[error] Possible paths found on the classpath:
[error] - META-INF/resources/webjars/bootstrap/3.3.6/js/bootstrap.min.js
[error] - META-INF/resources/webjars/bootstrap3-dialog/1.34.4/examples/assets/bootstrap/js/bootstrap.min.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
[error] - Ambiguous reference to a JS library: bootstrap.js
[error] Possible paths found on the classpath:
[error] - META-INF/resources/webjars/bootstrap3-dialog/1.34.4/examples/assets/bootstrap/js/bootstrap.js
[error] - META-INF/resources/webjars/bootstrap/3.3.6/js/bootstrap.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
2. I know what to do! I'll add a version to the defined js!
lazy val webjarbs = "org.webjars" % "bootstrap" % version.bootstrap / s"${version.bootstrap}/bootstrap.js" minified s"${version.bootstrap}/bootstrap.min.js" dependsOn "jquery.js" commonJSName "bootstrap"
3. "Oh no! fastOptJS failed!"
[trace] Stack trace suppressed: run last client/compile:resolvedJSDependencies for the full output.
[error] (client/compile:resolvedJSDependencies) org.scalajs.core.tools.jsdep.JSLibResolveException: Some references to JS libraries could not be resolved:
[error] - Missing JS library: 3.3.6/bootstrap.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
[error] - Missing JS library: 3.3.6/bootstrap.min.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
gg boys.
This goes over and over and around and around, and then I have to start doing
lazy val bs_sidebar = ( "org.webjars" % "bootstrap-sidebar" % version.bs_sidebar intransitive()) / "js/sidebar.js" dependsOn(s"bootstrap.js", s"bootstrap.min.js")
and now I'm not really even using the webjar, but it has a jsdependency named X and I cannot change that...
Question
Hmmm? What if I just did what I used to do but build the dependencies without the app into some gigantic file, or set of files, and then feed that into the build? I have a proof of concept from online and I got it work (I think it was https://github.com/wav/material-ui-scalajs-react/blob/master/src/main/scala/wav/web/muiwrapper/package.scala ) which almost worked, and gave me the idea.
I know npm works a lot better than sbt, and I can still get it into my package... what's the downside, and am I missing something about sbt?
I agree with you. Once an application starts having non-trivial dependencies on JavaScript libraries, jsDependencies does not scale. This is mostly because WebJars are missing critical features (just as transitive dependencies), but also because jsDependencies was not a mechanism designed to scale.
As time passed, users have asked for more and more features of jsDependencies, because they want to use it as their true app-scale (whatever that means) dependency mechanism. As a result, we've been patching more and more features/hacks on top of jsDependencies. The result is not the prettiest thing in the world, and it definitely has shortcomings.
I would actually encourage using npm to resolve your dependencies, especially if you are familiar with it and know how to integrate it into your workflow.
The principal advantage to using web jars, in my opinion, is not having to use npm. Plus, they go through the usual maven resolution / download process, so while it isn't perfect, it's only one pipeline of breakage instead of two.
Regardless, they can be painful. I've got about 30 dependencies in my scala.js app, and they are mostly managed with web jars. I have found that, in general, I get better results using npm webjars vs. bower webjars, and it is folly to attempt to rely on web jar transitive dependencies.
My jsDependencies tend to look like this:
("org.webjars" % "morrisjs" % "0.5.1" intransitive ())
/ "morris.js"
minified "morris.min.js"
dependsOn "2.1.2/raphael.js",
("org.webjars" % "raphaeljs" % "2.1.2-1" intransitive ())
/ "2.1.2/raphael.js"
minified "2.1.2/raphael-min.js"
The first thing to note is the version number mangled onto basically everything that ever gets depended on. If it gets used much, I extract the version out into a variable. The second thing is the intransitive() annotation. While I can sometimes get away without it, I find that being explicit keeps things working and my hair in place.
I tend to stick to front-end friendly packages like react and angular. Some of the new react libraries have dozens of transitive dependencies and attempting to use them would be painful. I avoid those =p

Seaside - How do I install Scriptaculous on a clean Seaside install (via Configuration Browser) on Pharo?

I used the method described here to install Seaside3 on Pharo. All is well, but Scriptaculous doesn't come preinstalled. How do I get it?
Seaside3 :
1: Go to the configuration manager
2: Select the Seaside 3 configuration. Click on Install.
3: Wait while it loads. Takes a couple of minutes on an i7 and a decent network link.
4: Open a Workspace and start a ZincServerAdaptor on the port you like (here 8080):
ZnZincServerAdaptor startOn: 8080. (then CMD+d for Do It)
7: Access Seaside from your browser.
8: Install Scriptaculous, but how?
Johan B's input:
http://forum.world.st/Seaside-How-do-I-install-Scriptaculous-on-a-clean-Seaside-install-via-Configuration-Browser-on-Pharo-td4802930.html
Pharo’s Configuration browser loads the default group of the Metacello configuration, which unfortunately was set to ‘Core’ for Seaside 3.1.
So, you will need to load additional groups programmatically:
(ConfigurationOfSeaside3 project version: #stable) load: #('Scriptaculous' 'JSON')
If you want to get the list of possible groups to load, inspect:
(ConfigurationOfSeaside3 project version: #stable) groups
Install from scratch with:
(ConfigurationOfSeaside3 project version: #stable) load: #('default' 'Scriptaculous' 'JSON')
This is something we fixed for Seaside 3.2, where the default will load everything to help newcomers.
We prefer not to change the existing 3.1 configuration versions to not break existing uses, but it’s fixed in the upcoming version.
Btw, Scriptaculous is really outdated. You will prefer to use jQuery and jQuery-UI (or any other JS framework…)
My findings on the subject:
Well, finally figured it out.
The packages needed for Scriptaculous to work are listed in the book here:
http://book.seaside.st/book/web-20/scriptaculous/frameworks/installation
Then you need to find a repository to get them from, after a little poking around here:
http://www.smalltalkhub.com/mc/Seaside/
I chose the Seaside31 repository, which is what I apparently managed to install a few hours ago.
http://www.smalltalkhub.com/mc/Seaside/Seaside31/main
Then I had to Do-It a couple of times on (maybe there is a faster way to do this):
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'Javascript-Core';
load.
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'Prototype-Core';
load.
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'Scriptaculous-Core';
load.
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'Scriptaculous-Components';
load.
For those looking to install jQuery into Seaside can use these:
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'Javascript-Core';
load.
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'JQuery-Core';
load.
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'JQuery-UI'; "notice that there is no -Core on this one, I don't know why"
load.
If one wants to load a full fledged configuration in Pharo 4.0 (after having loaded Seaside from the configuration browser):
| config groups |
config := (ConfigurationOfSeaside3 project version: #release3).
"Inspect this in case you want to see what's available"
groups := config groups.
"Load the usual suspects"
config load: #('OneClick' 'Javascript' 'Javascript Tests' 'JQuery' 'JQuery Tests' 'JQueryUI' 'JQueryUI Tests' 'JQueryUI Examples' 'REST' 'REST Tests' 'JSON' 'JSON Tests').
An additional interesting configuration to load is Bootstrap.
Check the configuration browser.

Error grabbing Grapes ... unresolved dependency ... not found

UPDATE 8/6:
The beefed up logging has shown me that there is an issue deleting the old jar from the cache, which leads to the fatal "not found" error. There are other threads similar to this, but only when someone is locking the file with their IDE. We are running a single groovy script from Jenkins, and no one is logged into this box.
We ran process explorer right after the failure and there were no locks. Then I login with the user that Jenkins is using to run the script, and I get no error deleting the files.
Also it seems there was a fix in IVY 2.1 to not fail when the jar cannot be deleted, and I'm on Ivy 2.2 (Groovy 1.8.4). What gives?
Couldn't delete outdated artifact from cache: C:\Users\myUser\.groovy\grapes\com.a.b.c\x-y-z\jars\x-y-z-1.496.jar
then the false(?) error:
Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: com.a.b.c#x-y-z;1.+: not found]
at smokeTestSuccess.<clinit>(smokeTestSuccess.groovy)
Interestingly enough, this happens everyday the first time the script is run after 5am. I guess the cache gets invalidated through some default config at 5am? Is this some kind of clue??
Original post:
I am intermittently getting an error when running a number of different Groovy scripts which all share an identical #Grab declaration. (file names changed to protect the innocent). First the full Grab declaration:
#GrabResolver(name = 'libs.release', root = 'http://myserver:8081/artifactory/libs-release', m2compatible = 'true') #Grapes([
#Grab(group = 'com.a.b.c, module = 'x-y-z', version = '1.+', changing = true),
#Grab('commons-lang:commons-lang:2.3'),
#Grab('log4j:log4j:1.2.16'),
#Grab('gpars:gpars:0.12'),
#Grab('jsr166y:jsr166y:1.7.0'),
#Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.6'),
#Grab('org.apache.commons:commons-collections:3.2.1'),
#Grab('org.apache.httpcomponents:httpclient:4.2.2'),
#Grab('org.apache.httpcomponents:httpcore:4.2.3'),
#Grab('org.cyberneko.html:nekohtml:1.9.17'),
#Grab('xerces:xercesImpl:2.11.0'),
]) #GrabConfig(systemClassLoader = true)
Then the error:
Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: com.a.b.c#x-y-z;1.+: not found]
Upon doing numerous internet searches, the cause always seems to be very simple, either one of these two basic problems:
1. Repository unreachable
2. Jar file doesn’t exist
However, in the artifactory logs, I've proven that the file is actually being downloaded:
*Artifactory did accept the request for download:
2014-07-17 07:58:19,938 [ACCEPTED DOWNLOAD] libs-release-local:com/a/b/c/x-y-z/1.477/x-y-z-1.477.jar for anonymous/165.226.40.155.
*Artifactory did deliver jar:
20140717075820|156|REQUEST|165.226.40.155|non_authenticated_user|GET|/libs-release/com/a/b/c/x-y-z/1.477/x-y-z-1.477.jar|HTTP/1.1|200|1276695
The scripts all work about 100% of the time if they are simply restarted. This all leads me to believe that the issue is the Grab timing out. Theoretically the second time I run the script, the file is in the cache, and things happen faster, thus it doesnt fail.
For the above real request, I can see about 20 seconds of elapsed time in the http log from request to download.
Questions:
Does my theory seem correct?
Is there a way to increase the amount of time that the script will wait for the #Grab to resolve?
Does putting a try / catch block around the #Grab statements seem like a good idea? Or will that just hide the real problem?
thanks in advance!!!!
I think I finally figured out the answer to my own question.
I believe there is some sort of bug within Groovy 1.8.4 (or Ivy 2.2), especially since this behavior does mirror an ancient documented Ivy bug with this exact error message scheme and behavior.
Upgrading to Groovy 2.3.6 (which includes Ivy 2.3) appears to solve the issue.
I also still have no idea why the jars cannot be deleted, nothing is locking them. I experimented with moving the grape cache to a less secure folder to rule out a permission issue, but this didn't help:
-Dgrape.root=D:\Temp\grapeCache
UPDATE 8/19:
Once we upgraded to Groovy 2.3.6, the error went away, but I then figured out that the jar was no longer being downloaded at all, when using the "1.+" resolver. Something in the defaultgrapeConfig.xml was causing an issue. Everything is finally working properly after (in addition to the Groovy upgrade) we overrode defaultgrapeConfig.xml with our own stripped down file using this command line JAVA_OPT:
-Dgrape.config=D:\Temp\myGrapeConfig.xml
which had these contents:
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<chain name="downloadGrapes">
</chain>
</resolvers>
</ivysettings>
ALSO:
For completeness (further steps):
In Jenkins GUI, update the job(s):
a. Update the drop down for each script: Execute Groovy Script > Groovy Version > Groovy-2.3.6
b. Update the JAVA_OPTS for each script (have to click the ‘advanced’ button under the script to see JAVA_OPTS):
-Dgrape.config=D:\Software\SfGrapeConfig.xml
Optional logging switches: -Dgroovy.grape.report.downloads=true -Divy.message.logger.level=4
In the actual Groovy script itself, delete this option within the #GrabResolver annotation: , m2compatible = 'true'
If you get this or a similar error:
"could not find client or server jvm under [Whatever JAVE_HOME is], please check that it is a valid jdk / jre containing the desired type of jvm"
Delete groovy.exe & groovyw.exe from D:\Software\Groovy-2.3.6\bin (if the exe’s do not exist, the Jenkins groovy plugin will use the bat file versions of these, and they handle the 32-bit / 64-bit problem better than the exe’s)

unable to run locally orchard azure project ysod fresh off sources

I am trying to run locally Orchard.Azure.CloudService project without any code changes to the official stable release 1.7.1 (58c21815). full source address is # https://git01.codeplex.com/orchard .
Here is the steps to reproduce the error:
launch the Orchard.Azure solution
select "Debug" build
click on press F5 start debugging
the page will show "Server Error in '/' Application."
None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters: Cannot resolve parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher' of constructor 'Void .ctor(System.Func1[Autofac.Features.OwnedInstances.Owned1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable1[Orchard.Mvc.Routes.IRouteProvider], System.Collections.Generic.IEnumerable1[Orchard.WebApi.Routes.IHttpRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable`1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.
Source Error:
Line 111: var shellScope = _shellContainerFactory.CreateContainer(settings, blueprint);
Line 112:
Line 113: return new ShellContext {
Line 114: Settings = settings,
Line 115: Descriptor = descriptor,
Source File: c:\projects\orchard\src\Orchard\Environment\ShellBuilders\ShellContextFactory.cs Line: 113
`
... "
Windows 8, x64
VS2012.3 Azure SDK 2.1
source code version hash: 58c21815
It is a known issue that the solution can't run in the emulator. This is caused by the structure of the solution, and the fact the emulator doesn't run the cspack file. This script is used to copy modules and themes into the package for Azure deployment. When the emulator runs it simply mounts the Orchard.Azure.Web project which is almost empty and doesn't have all the files necessary to run the solution.
See this discussion on CodePlex for more detail.
I don't believe you should be running that solution but the main Orchard solution.
ie, you don't need to develop specifically for Azure, just deploy for Azure.
I think ^_^

Does Firefox disable plugins that failed to initialize?

I am trying to test a Mozilla plugin (developed using FireBreath) in the form of an .so shared object file. The plugin was developed on Ubuntu, where it works fine.
I am now trying it under OpenSUSE - so I first symlinked the .so file in ~/.mozilla/plugins:
> ln -s /path/to/npXXX.so ~/.mozilla/plugins/
... and then ran Firefox (7) from command line:
> /path/to/firefox -P myprofile
...
LoadPlugin: failed to initialize shared library libXext.so [libXext.so: cannot open shared object file: No such file or directory]
LoadPlugin: failed to initialize shared library /path/to/npXXX.so [/path/to/npXXX.so: undefined symbol: gtk_widget_get_mapped]
# and the LoadPlugin messages do NOT show a second time - probably because plugin is disabled (via about:addons).
And so I thought to try different stuff to look into this - but first, I restarted Firefox, and realized that on the second run I do not get the "LoadPlugin: failed to initialize" messages anymore! Then I tried removing the plugins symlink, and restarting FF; and adding it again, and restarting FF - still no error messages!
So, this tells me that probably Firefox somehow disabled/blacklisted the plugin (but which one: libXext, npXXX or both?) , but searching (grepping) for (np)XXX in '/path/to/myprofile/blocklist.xml' returns nothing (the plugin should use a email-like id, not those number GUIDs, so I'd expect that string to show in blocklist.xml if it's there).
Does anyone know: is the default behavior of Firefox to disable/blocklist plugins, that fail to load at first? If so, is there a way to force Firefox to load them again (and spit out error messages)? If you'd also have links to where this behavior is documented, it will be much appreciated :)
Many thanks in advance for any answers,
Cheers!
Note: after I stopped seeing the error messages, I did the following:
I am trying "about:plugins": "No enabled plugins found";
then trying "about:addons", and clicking under Plugins: "You don't have any add-ons of this type installed";
This plugin is not embedded in an extension, so nothing new should be added in "about:addons" under "Extensions" - and as expected, nothing new shows there. Under Ubuntu (where all works), just by symlinking the plugin to ~/.mozilla/plugins, the above two locations/screens start showing the plugin info.
This one of the things that puzzle me - if it just showed the plugin as "disabled", maybe I would have had a chance to re-enable it again (to get a new batch of error messages) - however, "about:plugins" and "about:addons" simply show nothing - so there's nothing I can use to enable from there. Which tells me Firefox has used a different method to disable the plugin(s) - but I cannot tell what it is...
Firefox has a cache for XPCOM modules ("fastload cache"), if a module fails to load Firefox won't try again. The cache is reset automatically if an extension is installed or if the application is updated. Starting with Firefox 4 you can also use -purgecaches command line flag to discard the cache.

Resources