aspose file tools*
The moose likes Cattle Drive and the fly likes Orion on MacOSX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Orion on MacOSX " Watch "Orion on MacOSX " New topic
Author

Orion on MacOSX

Adam Price
Ranch Hand

Joined: Nov 11, 2005
Posts: 95
As I am closing in on Moosehead #2, I am trying to prep my computer for Servlets. I am stumped with installation of j2ee sdk on my macos x 10.4 system, and wonder if anyone can tell me just what I need to do. I searhing other parts of the saloon, I see people saying it's already installed, that I need jboss, that I need Jetty, that I need tomcat, that tomcat is already installed, and a half dozen other helpfully conflicting bits of advice. Does anyone in the cattledrive have this working? (Oh - there is no downloader for j2eesdk-macosx on the Sun website
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Pauline is the Mac expert around here. As far as I know she used Orion for her Servlets and JDBC assignments.

My understanding is that OS X comes with J2SE. I never heard that it comes with J2EE.

You definitely do not need Jetty or Tomcat. And you'd only need JBoss if we were going to do EJB stuff (which we're not).


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Hi Adam,

Yeah, I got Orion going on my mac, though I'm still using 10.3. I'm at work on Windows right now, but when I get home tonight I'll check my mac - or more importantly, my memory, ack!

Just to confirm what Marilyn said, Mac OS X comes with J2SE, but not with J2EE.

I have a vague recall of downloading the linux j2ee. Argh, I had a feeling I should have taken notes. Be right back...
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
This article may or may not be helpful in getting orion set up, but at least it shows that it can be done on OS X.
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
OK, I'm dredging up some dusty grey cells, but maybe here's a start.

Assuming you're using Orion for the assignments, have you set it up already? It's probably simplest to go in the same order that the assignment does, and get the web server working (orion) and then move on to the j2ee jdk (for writing your servlets).

I found some decent installation instructions at http://www.orionserver.com/ (link to "Installation Guide"). Have you used the Terminal command line application that comes with your mac? You'll need that for the parts where they say "do blabla on the command shell".

A couple of general bits of info: I have orion version 2.0.5 installed in a directory called orion at the root (top level) of my machine. Plus I did what they said in step 4 of the instructions and set up the orion server to run on port 8080 of localhost (leaving the Apache server that comes installed already to run on localhost port 80).

Maybe I'll pause here to see where you're at, whether you're able to start setting up orion or not yet...
[ March 29, 2006: Message edited by: Pauline McNamara ]
Adam Price
Ranch Hand

Joined: Nov 11, 2005
Posts: 95
Originally posted by Pauline McNamara:


Have you used the Terminal command line application that comes with your mac?

Yes - I use it more than finder, in fact, so feel free to abbreviate/be vague about shell commands.
Originally posted by Pauline McNamara:


Maybe I'll pause here to see where you're at, whether you're able to start setting up orion or not yet...



I have made it through this step:

Orion comes with some demo servlets. Let's make sure that the servlet server is working by accessing one of them. Direct your browser to http://localhost/servlet/DateServlet - if you see the current date and time, the servlet server is working.


and I got stuck on
Download the J2EE SDK(Java 2 Enterprise Edition Software Development Kit) from Sun, and install it. It is a supplement to the JDK you already have installed. You need to include the j2ee.jar in your classpath.

Compile and copy BeeServlet.class to c:\orion\default-web-app\WEB-INF\classes\BeeServlet.class, and restart the server as before. Now direct your browser to http://localhost/servlet/BeeServlet - do you see the message?

[ March 29, 2006: Message edited by: Adam Price ]
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
OK, great! You're at download and install the j2ee sdk, then add the j2ee.jar to your classpath. As someone who prints out stuff, uses it and then leaves it in pile for years, I was actually able to locate the instructions I used way back when. (And to think that just the other day I considered cleaning that shelf! )

A google with "install j2ee sdk macintosh" still brings up one of those old articles high on the list. I followed the section called J2EE SDK. Just above that, there's a part in the section called J2EE TUTORIAL about environment variables. I did those, plus the additional command export CLASSPATH = .: path_to_j2ee.jar. (Depending on which shell you're using the syntax may differ, plus you may have other stuff in your CLASSPATH already that you want to keep in there still.)

Maybe a caveat to keep in mind, I was dealing with version 1.3 of the j2ee sdk. I'm at work again, so can't check if I updated to 1.4, or if that download works the same way.

Does that give you a starting point? I'll check my j2ee setup again tonight. I do remember thinking that I should really write down the steps for later reference - alas, best intentions...

Pauline

PS
The other articles that I chose to keep were these 2: one from Sun and one from developer.com. Both served me more as background info than as actual installation instructions, so maybe just if you want to immerse yourself in that some more.

And just for reference, the download page for the j2ee sdk. I'd go with the link at the top "Get the J2EE SDK", then just choose the linux version on the actual download page.
[ March 30, 2006: Message edited by: Pauline McNamara ]
Adam Price
Ranch Hand

Joined: Nov 11, 2005
Posts: 95
Originally posted by Pauline McNamara:


A google with "install j2ee sdk macintosh" still brings up one of those old articles high on the list. I followed the section called J2EE SDK. Just above that, there's a part in the section called J2EE TUTORIAL about environment variables. I did those, plus the additional command export CLASSPATH = .: path_to_j2ee.jar. (Depending on which shell you're using the syntax may differ, plus you may have other stuff in your CLASSPATH already that you want to keep in there still.)
Does that give you a starting point? I'll check my j2ee setup again tonight. I do remember thinking that I should really write down the steps for later reference - alas, best intentions...



And just for reference, the download page for the j2ee sdk. I'd go with the link at the top "Get the J2EE SDK", then just choose the linux version on the actual download page.


Oddly, I shad stumbled across the same page and tried to follow those same steps. Where I ran in to trouble was on untar'ing the j2ee sdk. It downloads as a .bin file - tar doesn't apply and stuffit won't open it either. What should I do with that file?
Adam Price
Ranch Hand

Joined: Nov 11, 2005
Posts: 95
A little closer . . . I found this site: http://java.sun.com/developer/EJTechTips/2003/tt1222.html
Which reports that the file is an elf binary and can be opened with unzip. That works. From there forward, though, the instructions don't work. It says to run an installer with
java -cp package/PackageFormat.jar:. appserv That generates the class file, but then fails with the error Platform not supported for media spanning: com.sun.wizards.media.Mac_os_xMediaSupport

Any thoughts?
Wesley Furgiuele
Greenhorn

Joined: Oct 02, 2005
Posts: 4
I'm new here, not near Servlets yet, but is there any reason that Orion is what has to be installed? The primary reason for installing this is to be able to support running servlets, at least for the purpose of the Cattle Drive -- is that correct?

Apple has this article describing another option.

I guess I'm just curious because (1) I will face this issue (hopefully) soon enough, and (2) I also have a couple Mac OS X Server installations running here, which have JBoss preinstalled.

Regardless, good luck getting this running, Adam. Please post back when you get it working.
[ March 30, 2006: Message edited by: Wesley Furgiuele ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41509
    
  53
Maybe this comes out of left field, but I'm doing J2EE development on OS X all the time, and I've never installed any version of the official "J2EE SDK". One needs the documentation, which is a separate download, but beyond that I don't think the SDK adds much useful stuff.

For servlet/JSP development I installed Tomcat -which comes with the required libraries-, and off I go (Orion would work just as well I suppose). When I needed JavaMail or JMS, I downloaded the respective API, added the libraries to my classpath, and I was good to go. Same with EJB (which of course needs an EJB container like Resin), JMX and other parts.

What does the J2EE SDK add that you can't get individually, particularly if it's only servlet development that one is interested in?
[ March 30, 2006: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Hi Ulf, nice to see you in here. Any advice is welcome whatever field it comes out of.

For servlet/JSP development I installed Tomcat -which comes with the required libraries-, and off I go (Orion would work just as well I suppose).

Maybe this is the difference. These assignments call for using Orion. (Though people have done the assignments using Tomcat instead, I'm pretty sure.) I guess Orion doesn't include the libraries like Tomcat does.
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Originally posted by Adam Price:
A little closer . . . I found this site: http://java.sun.com/developer/EJTechTips/2003/tt1222.html
Which reports that the file is an elf binary and can be opened with unzip. That works. From there forward, though, the instructions don't work. It says to run an installer with
java -cp package/PackageFormat.jar:. appserv That generates the class file, but then fails with the error Platform not supported for media spanning: com.sun.wizards.media.Mac_os_xMediaSupport

Any thoughts?


Just checked my setup. Looks like I have j2sdkee1.3.1 which, I'm guessing, explains why those instructions worked for me and not with version 1.4.

Any thoughts? Yeah, I'm thinking about what a pain it's getting to be for you and how patient you are. Other than installing Tomcat just to get the libraries in there (would that do the trick?) I'm not coming up with any smart advice beyond searching for stories from someone who's installed j2eesdk 1.4 on their mac...

Pauline


google google on the wall, who's the cluelesst one of all?
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
On second thought, a question: Marilyn, is there any reason that j2ee 1.3 would not work with the revised assignments?

If not, then Adam could install j2ee 1.3 with the instructions at hand. That version is still available for download...
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
I did the assignments using j2ee 1.3
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
The assignments can be done with any app server, including Tomcat and JBoss. But the instructions (paths and such) were written specifically for an Orion installation. If you know which directories to substitute in those instructions, Wesley, then there's no problem. JBoss is a bit of an overkill since it is an EJB server that runs on top of Tomcat (a servlet server). Hmmm. that's a thought. Adam, do you also have JBoss pre-installed?
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Adam, do you also have JBoss pre-installed?

Actually, it looks like Wesley has Mac OS X Server, which is not the same animal as plain old OS X.

Soooo, Adam, you could install j2ee 1.3 and stick with Orion...

..or you could install Tomcat and use that instead of Orion.
Wesley Furgiuele
Greenhorn

Joined: Oct 02, 2005
Posts: 4
Pauline/Marilyn:

Yes, I do have OS X Server here, but I also typically work on a regular old OS X (non-server) machine. Although I have access to the preinstalled JBoss and Tomcat environment, the article I linked to listed instructions for getting them up and running on a non-server installation.

Also, (and again, this is waaaay early for me to actually be concerned with, so it's mostly just out of curiosity), I saw only a single thread on the Mac Java developer mailing list dealing with J2EE installation on OS X 10.4 (and it doesn't seem to be server-specific).

It's over my head for now, but here's the thread, in case it's meaningful to anyone:
http://lists.apple.com/archives/java-dev/2005/Nov/msg00554.html
[ March 31, 2006: Message edited by: Wesley Furgiuele ]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
It is possible to run the J2EE 1.4 SDK on Macintosh OS X or Darwin, although they are not officially supported. You must have root access to install on OS X or Darwin, and your Java Environment (JRE) must be version 1.4.1 or better.

To install the J2EE 1.4 SDK on OS X or Darwin, do the following:

1. Download the Linux release of the SDK from http://java.sun.com/j2ee/1.4/download-dr.html. The file you download will be an ELF binary.

2. Use the unzip command-line utility to unzip the archive into an empty directory. You must use unzip -- programs such as StuffIt will not work. At the prompt ('$'), enter:

$ unzip j2eesdk-1_4-dr-linux-eval

3. Start the installer. Enter:

$ java -cp package/PackageFormat.jar:. appserv

The installer will start and will install the SDK. You might need to occasionally resize a window if you can't read its contents.

4. The installation program will ask you for the location of Java. Enter:


/Library/Java/Home

The installer will prompt with a warning that the server requires JDK 1.4.2. Java 2 version 1.4.1 will work properly, so select <continue>.

5. After installation, you must perform a few extra steps. The first step is to change some permissions in the imq/bin directory of the installation. Enter:


$ chmod a+x /Users/yourname/SUNWappserver/imq/bin

where yourname is your user name. (This procedure assumes that you installed the server in /Users/yourname.)

6. The final step requires root access. The server looks for java and javac in /Library/Java/Home/jre/bin which does not yet exist. You must create this directory, and create symbolic links to the binaries for these programs. Enter:

$ sudo mkdir -p /Library/Java/Home/jre/bin
$ cd /Library/Java/Home/jre/bin
$ sudo ln -s /Library/Java/Home/bin/java java
$ sudo ln -s /Library/Java/Home/bin/javac javac

The sudo program will request your password the first time you run it. If you are not an administrator, you must log on as root or su to root to complete these tasks.

7. Installation is now complete. To start the application server, enter:

$ cd /Users/yourname/SUNWappserver/bin
$ asadmin start-domain

Sun Microsystems instruction page
Wesley Furgiuele
Greenhorn

Joined: Oct 02, 2005
Posts: 4
Marilyn, I think you and I might have been reading that at the same time!

I actually tried the instructions there and, after Googling the error message I got when it didn't work, came to another, follow-up thread on Sun's Java Forums.

http://forum.java.sun.com/thread.jspa?forumID=136&threadID=507411

The gist of it seems to echo what was said also on Apple's Java-Dev mailing list, which is basically: install an IDE and pull the whatever you need from there.
Adam Price
Ranch Hand

Joined: Nov 11, 2005
Posts: 95
Originally posted by Wesley Furgiuele:
Marilyn, I think you and I might have been reading that at the same time!
.
And that's the page I was looking back at post #9. Same trouble as you: Platform not supported for media spanning: com.sun.wizards.media.Mac_os_xMediaSupport
.

Originally posted by Wesley Furgiuele:
The gist of it seems to echo what was said also on Apple's Java-Dev mailing list, which is basically: install an IDE and pull the whatever you need from there.

I don't quite understand what they're saying with regard to this.
Wesley Furgiuele
Greenhorn

Joined: Oct 02, 2005
Posts: 4
Originally posted by Adam Price:

I don't quite understand what they're saying with regard to this.


Well, at this point for me there's a lot I still don't understand about this whole setup

However, I started to run through the process of installing JBoss and Jetty on my non-server OS X 10.4.5 machine. I did the web start-based JBoss Application Server installation and installed into /usr/local/jboss. After doing this, I just started digging around in the jboss subdirectories.

When I had first run through the Orion Server installation and then, without downloading/installing the J2EE SDK, tried compiling BeeServlet.java, I think I got 4 errors (cannot find symbol HttpServlet, etc.). I can't remember which subdirectory now, but I was able to dig around and find things like HttpServlet.class in the jboss installation. If I added the directory to my classpath before compiling, it dropped me down to 2 errors. Presumably there are other classes that could be found in other subdirectories -- that's pretty much where I stopped for now though.

For someone more skilled and knowledgable, perhaps it's simple enough to find or copy all the needed classes to useful location.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Here's an idea that works for me, Adam. Take the j2ee.jar out of your classpath and add orion.jar (from the orion install directory) to your classpath.

Can you compile? I could.
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Just tried that out on my mac and it worked.

That sure simplifies things! Peeked inside and saw that all those class files are all tucked away in the orion.jar, how nice.
Adam Price
Ranch Hand

Joined: Nov 11, 2005
Posts: 95
Originally posted by Marilyn de Queiroz:
Here's an idea that works for me, Adam. Take the j2ee.jar out of your classpath and add orion.jar (from the orion install directory) to your classpath.

Can you compile? I could.


That's great, Marilyn! Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Orion on MacOSX