users@jax-ws.java.net

Re: for problem to access denied using SocketPermission("228.5.6.7:1000", "connect,accept")

From: Lukas Jungmann <Lukas.Jungmann_at_Sun.COM>
Date: Wed, 23 Aug 2006 15:50:02 +0200

yuyin Song wrote:
> All,
>
> Who use SocketPermission("228.5.6.7:1000",
> "connect,accept")?
> I use MulticastSocket in web service. I met a problem
> to access denied:
> Caused by: java.security.AccessControlException:
> access denied (java.net.SocketPermission 228.5.6.7
> connect,accept,resolve).
> Please give me some advices. How to use it and get to
> access? Thank you so much.

set correct permissions for your code in policy file in glassfish
(should be something like %GF_HOME%\domains\domain1\config\server.policy)?

just a guess...

>
> Yin

--lj

>
>
> The Java source code is in the following:
> try{
> groupAddress = InetAddress.getByName("228.5.6.7");
> }catch (IOException e){
> System.out.println("error in getting group address by
> Name:\n");
> }
>
> try{
> SecurityManager security =
> System.getSecurityManager();
> if (security != null) {
> security.checkMulticast(groupAddress);
> }
> }catch(SecurityException se){
> System.out.println("Security Manager Error");
> }
>
>
>
> try{
> multiSocket = new MulticastSocket(1000);
> System.out.println("Successfully create a
> MulticastSocket:\n");
>
> }catch (IOException e){
> System.out.println("error in defining
> MulticastSocket:\n");
> }
>
> socketPermission = new
> SocketPermission("228.5.6.7:1000", "connect,accept");
>
> try{
> multiSocket.joinGroup(groupAddress);
> System.out.println("Successfully joining the
> Group:\n"+groupAddress);
> }catch (IOException e){
> System.out.println("error in joining the
> Group:\n");
> }
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>