Kinds of Learning: Immersive, Structured

My supervisor, Gord McCalla, told me about an invited talk that was given at AIED one time by John Sellers (?).  In this talk, there was a discussion of two kinds of learning:
  1. like language learning, where you just put yourself in a rich environment and you pick it up as you go
  2. where it takes hard work, reflection, organized/structured approach to material
I've Googled around but I can't find any references to this talk.  If I ever find it, I'll put the link here.

I think this discussion is interesting because it could inform the kinds of instructional planning approaches that should be used for certain domains, or even certain learners in certain situations. 

Building a WAR file in Eclipse with Maven

The other day, I installed Maven on my OSX machine (previous entry) and I started using it in my Eclipse projects (mostly Dynamic Web Projects).  Maven really helped me clean up my Jar file conflicts.  Now that I have my jar files all cleaned up, I want to export them into a WAR file.  So, how do you generate a WAR file from Eclipse that is based upon your definitions in pom.xml?

Well you can right-click on your project and go Run As --> Maven Build...

In the next window, you'll see a box labelled "Goals:".  There are keywords you can type in here.  If you type "package", it will look in your pom.xml for any directions you've typed for creating JAR or WAR files.  Here is a StackOverflow thread where one of the replies shows how to pull in the Maven WAR plugin

So, edit your pom.xml to include the Maven War Plugin stuff (which gives teh path to web.xml).  Then, Run As --> Maven Build, and type "package" into the Goals: box.   Then you'll see some Build information in your console, and, hopefully, you can look inside your "target" folder in your project (remember to hit Refresh in Eclipse!) and you should see the war file that has been assembled for you.

This link at Aykut Akın's Blog shows some screenshots to give a broad overview of how I did it.

I am accustomed to doing this with ANT, so I have a few kinks to work out to make sure the .class files and .jsp files and so on all end up in the correct place!  

Jersey + Hibernate conflict

Here is the error:
http://stackoverflow.com/questions/7721836/jersey-hibernate-nosuchmethoderror-org-objectweb-asm-classreader-acceptlor 


Using Maven, this is the best solution to the Jersey / Hibernate conflict I have found:
http://blog.idm.fr/2009/04/jersey-hibernate-conflict.html


Maven on OSX

Once upon a time, Mac OS X came with Maven pre-installed.  Nowadays we have to install it ourselves, alas.

Luckily, it's fairly simple.  First, you have to install Homebrew; just scroll to the bottom of that website and execute the command provided.   When I pasted the command directly into the Terminal, it didn't work (error: "Illegal variable name.").  But when I went into "sh" first, then it worked.  It asked me to verify that I was OK to some permissions updates, and I also had to install developer tools that I hadn't yet on this machine.  Then it installed.

After that, I followed advice from this popular StackOverflow question and typed:
brew install maven
(while still in "sh").

Now, whenever you are in "sh", you can use the "mvn" command.  At this point, I went on to install Maven Integration for Eclipse.

After installing the plugin, I found that you can right-click on your Eclipse project and go Configure --> Convert to Maven Project.  This asks you to type in the GroupID, ArtifactId, Version, etc..  When I did that, it created a pom.xml descriptor for me in the root of my project folder.

When I double-clicked pom.xml, it automatically opened in the Maven POM Editor.  In here, I found a "Dependency" tab.  When I clicked Add, it asked for GroupID, ArtifactId, Version, etc.  I observed that this looks a LOT like the XML shown in sample pom.xml files around the web.

So, I typed in:

Group ID: org.glassfish.jersey.containers
Artifact ID: jersey-container-servlet
Version: 2.5.1

Where did I get this info?  Just Google around and find a sample pom.xml... it is obvious looking at the XML what the GroupID, ArtifactID and Versions are.

Then I clicked OK, then I Saved pom.xml.   Then it automatically built my workspace.  When I went under Java Resources --> Libraries --> Maven Dependencies, I noticed some familliar Jersey Jar files there.   Did it download those automatically for me??? It must have.  I can't believe I didn't have to manually download the jars and add them to Properties -> Java Build Path

But first I have to go feed my kid some lunch.

Bye.

UPDATE:  OK, Hibernate is working now too.  That is, I have a Java class with Hibernate imports, and they are not red and underlined.  I used:

Group ID: org.hibernate
Artifact Id: hibernate-core
Version: 4.3.5.Final

Translate