 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jeffrey Spoon Guest
|
Posted: Tue Apr 18, 2006 9:12 pm Post subject: Loading archives with an applet |
|
|
Hello I'm trying to follow
<https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemote
EJB> in order to access an EJB via my applet.
I created a JSP (below) which loads my applet and defines the required
archive so I can boot the default InitalContext for JNDI. This doesn't
seem to work, but I'm wondering if the archive is being loaded properly.
<http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/ap
plet.html#archive> states that http:// archives can be loaded from a
different directory as long as they're from the same host. The thing is
I didn't actually deploy the jar from my server, but I am using the same
machine to run the applet at the moment. Should I stick the jar on my
app server and deploy it, or will having the jar locally make no
difference as I am running the applet locally anyway?
Also my main question was, how do you know if the jar has been loaded
successfully?
The console gives me this:
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
basic: httpCompression = true
network: Connecting
http://localhost:8080/politse/%5CSun%5CAppServer%5Clib%5Cappserv-rt.jar
with proxy=DIRECT
network: Connecting
http://localhost:8080/politse/%5CSun%5CAppServer%5Clib%5Cappserv-rt.jar
with cookie "JSESSIONID=aeb13541f7b377b555ffbdfd0d1c1"
As there are no errors I assume the archive has been loaded
successfully, but I'm not convinced it has, partly because I haven't
deployed it onto the server, but also I still get a
NoInitialContextException when attempting to contact the EJB.
Thanks.
<html>
<head><title>Localized Dates</title></head>
<body bgcolor="white">
<jsp:plugin
type="applet"
code="TestClient.class"
codebase="/politse"
archive="\Sun\AppServer\lib\appserv-rt.jar"
jreversion="1.4"
align="center" height="25" width="300"
nspluginurl="http://java.sun.com/j2se/1.4.2/download.html"
iepluginurl="http://java.sun.com/j2se/1.4.2/download.html" >
<jsp:params>
<jsp:param name="language"
value="${pageContext.request.locale.language}" />
<jsp:param name="country"
value="${pageContext.request.locale.country}" />
<jsp:param name="bgcolor" value="FFFFFF" />
<jsp:param name="fgcolor" value="CC0066" />
</jsp:params>
<jsp:fallback>
<p>Unable to start plugin.</p>
</jsp:fallback>
</jsp:plugin>
</body>
</html>
--
Jeffrey Spoon |
|
| Back to top |
|
 |
Jeffrey Spoon Guest
|
Posted: Wed Apr 19, 2006 9:12 pm Post subject: Re: Loading archives with an applet |
|
|
In message <H1hNR0A2QVREFwwR (AT) nowhere (DOT) nnn>, Jeffrey Spoon
<JeffreySpoon (AT) hotmail (DOT) com> writes
Hmm, that didn't work:
Any ideas?
javax.naming.NoInitialContextException: Cannot instantiate class:
com.sun.enterprise.naming.SerialInitContextFactory [Root exception is
java.security.AccessControlException: access denied
(java.util.PropertyPermission com.sun.appserv.iiop.loadbalancingpolicy
read)]
at javax.naming.spi.NamingManager.getInitialContext(Unknown
Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at TestClient.getInitialContext(TestClient.java:136)
at TestClient.connect(TestClient.java:109)
at TestClient.actionPerformed(TestClient.java:63)
at javax.swing.AbstractButton.fireActionPerformed(Unknown
Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown
Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied
(java.util.PropertyPermission com.sun.appserv.iiop.loadbalancingpolicy
read)
at java.security.AccessControlContext.checkPermission(Unknown
Source)
at java.security.AccessController.checkPermission(Unknown
Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at
com.sun.enterprise.naming.SerialInitContextFactory.<init>(SerialInitConte
xtFactory.java:27)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
... 30 more
--
Jeffrey Spoon |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|