hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niti Bhatt \(PL/EUS\)" <niti.bh...@ericsson.com>
Subject RE: Running in Applet-viewer vs Firefox
Date Mon, 07 May 2007 14:58:53 GMT
Hi,
   Sorry to abruptly end the previous email. It was
unintentional...Continued from previous email

4. Make sure your codebase is correct. Specify the url and port number
of the server on which your jar file resides. For example
    codebase = "http://<url>:8080/<application-context> . 

5. If you are deploying a war, include the httpclient.jar and
MenuDemo.jar in the root of your war. 


I had overcomed the issues you mentioned using the steps mentioned
above. Hope this helps you as well!

BR/Niti

-----Original Message-----
From: Niti Bhatt (PL/EUS) [mailto:niti.bhatt@ericsson.com] 
Sent: Monday, May 07, 2007 9:53 AM
To: HttpClient User Discussion
Subject: RE: Running in Applet-viewer vs Firefox

Hi Brian,
  I had encountered similar problems while trying to make my applet work
with a web browser. A couple of things..

1. You might have to use certificate in order to load the applet on
client machine and make it do its task. If you need more information on
how to do self signing, go to the following link
http://personal.vsnl.com/sureshms/javasign1.html. This will probably
remove your 'AccessControlException' error.

2. The size of the jar file defined in the ARCHIVE tag is critical to
successful loading of the applet. Try using the reduced version of the 
   HttpClient.jar from the following link
 
     http://chiralsoftware.net/httpclient-fork.html

3. Make sure the jar file for HttpClient is also specified along with
your class specific jar in the ARCHIVE tag for eg.
archive="MenuDemo.jar,httpclient.jar".

3. 

-----Original Message-----
From: Brian Johnson [mailto:brj@u.washington.edu]
Sent: Friday, May 04, 2007 5:34 PM
To: httpclient-user@jakarta.apache.org
Subject: Running in Applet-viewer vs Firefox


Hi! I've just subscribed to the list in the hopes of gaining some
insight into the following problem...

On MacOS 10.4, developing with eclipse set to use compliance level 1.4,
I am trying to use HttpClient to connect to a web server. In
Applet-viewer this works fine, but I've had a devil of a time getting it
to work off my web server. Having browsed the mailing list archives
some, it's clear that this *can* work -- so it's probably
user-befuddlement and/or outright ignorance.

One possible source of mistakes: this is the first applet I've done that
uses libraries (the commons packages) in separate JAR files. I thought I
just needed to put all the .jar files into the ARCHIVE="" parameter on
the HTML APPLET tag, but I kept getting "java.lang.NoClassDefFoundError"
at the first "new HttpClient()" (and the traceback had no org.apache... 
pieces). I concluded that the ARCHIVE parameter wasn't really delivering
the libraries as needed. Something I found on the web suggested I might
need to monkey with the manifest, so I unZipped one of the jar files and
used the resulting folder (a) as a model to package my own applet, and
(b) as a place to put a "Class-Path:" header with all the commons jars
on it. 
I then reZipped and renamed it. Now the applet tag is

       <applet code="dirList/MenuDemo2.class" name="MenuDemo2"
        archive="MenuDemo.jar"
        width="400" height="500">

The applet launches, but the "new HttpClient()" still runs into
problems..

java.lang.ExceptionInInitializerError
    at
org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:66)
      ...
Caused by: java.security.AccessControlException: access denied
(java.util.PropertyPermission
org.apache.commons.logging.LogFactory.HashtableImpl read)
    at
java.security.AccessControlContext.checkPermission(AccessControlContext.
java:264)

fwiw, the url being accessed is on port 8080.

Suggestions?  Thanks for your insights.

   -Brian Johnson, Dept of Architecture, University of Washington,
Seattle


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message