The Artima Developer Community
Sponsored Link

Java Buzz Forum
JDeveloper, Apache And MIME Types

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
John Topley

Posts: 233
Nickname: johntopley
Registered: Jul, 2003

John Topley is embarking on a journey to become a J2EE master.
JDeveloper, Apache And MIME Types Posted: Jun 8, 2004 3:21 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by John Topley.
Original Post: JDeveloper, Apache And MIME Types
Feed Title: John Topley's Weblog
Feed URL: http://johntopley.com/posts.atom
Feed Description: John Topley's Weblog - some articles on Ruby on Rails development.
Latest Java Buzz Posts
Latest Java Buzz Posts by John Topley
Latest Posts From John Topley's Weblog

Advertisement

I've just got to the bottom of a fairly obscure problem that occurs when using Mozilla Firefox to access a web application developed using Oracle JDeveloper. The JSPs in my application link to an external stylesheet, but the pages weren't styled when viewed using a Gecko-based browser, such as Firefox. However, they were fine when using Internet Explorer or Opera.

Changing to an inline stylesheet declaration fixed the problem, which suggested that there might have been something about my external stylesheet declaration that Firefox didn't like:

<link rel="stylesheet" type="text/css" href="/webforum/assets/css/webforum.css" />

—There's nothing out of the ordinary there. Using the JavaScript Console in Firefox showed that the error was occurring because the CSS file was being served with a MIME type of application/octet-stream instead of text/css:

Click to enlarge.
A picture of the Mozilla Firefox JavaScript console showing the error

—This opened up another avenue of investigation. JDeveloper includes a cut-down, embedded version of Oracle's OC4J J2EE application server. This enables J2EE components and web applications to be run from within the IDE. I know that OC4J uses Apache as its web server, which led me to suspect that I was dealing with an Apache configuration problem and not a JDeveloper or OC4J problem. I sniffed around in the configuration directory for the embedded container and found a file named mime.types, which seemed a likely candidate for modification. I added the line:

text/css    css

…restarted the application and all was now well. I could admire the results of my beautiful stylesheet in Firefox and marvel at how different it looked from IE.

According to a message on the Oracle Technology Network JDeveloper forum, this quirk is still present in the latest JDeveloper release. For the benefit of other developers with this problem who want to work around it, simply download this mime.types file from my standalone Apache 1.3 installation and overwrite the existing file in:

<JDEVHOME>/jdev/systemX.X.X.X.XXXX/oc4j-config for the embedded OC4J server,

–or–

<JDEVHOME>/j2ee/home/config for the standalone server. Job done!

Read: JDeveloper, Apache And MIME Types

Topic: [May 28, 2004 05:59 PDT] 13 Links Previous Topic   Next Topic Topic: My Name is Alex and I&#039;m Two Years Old

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use