android-developers
[Arriba] [Todas las Listas]

[android-developers] IllegalState Cuándo creando interfaz con Android 4

To: Android Developers <android-developers@xxxxxxxxxxxxxxxx>
Subject: [android-developers] IllegalState Cuándo creando interfaz con Android 4.0 VpnService.Constructor
From: Kristian <kristian.evensen@xxxxxxxxx>
Date: Wed, 30 Nov 2011 10:14:21 -0800 (PST)
Delivery-date: Wed, 30 Nov 2011 13:14:45 -0500
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:mime-version:date:user-agent :x-http-useragent:message-id:subject:from:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=R6F+q9YDfffCxUkrrfBwfMjg1lIgyRe/ut6UIMF4Jhs=; b=qEzxXFdc364FjPmP5Bt3x11awMIQEDqPYKg9iUh9u9KHt45Y/aevufjZkdX/SpVD5g oG3jxK0yNpVrnpVLBuwCo93ctHYsD6wvn86WkujlSzIy3iLop8H+8lJdj2xvpdmDiEw/ A51Rt3P600RGYXFXyYdwopVE3pDHsAGTa7AZU=
Envelope-to: traductor@xxxxxxxxxxx
List-archive: <http://groups.google.com/group/android-developers?hl=en_US>
List-help: <http://groups.google.com/support/?hl=en_US>, <mailto:android-developers+help@googlegroups.com>
List-id: <android-developers.googlegroups.com>
List-post: <http://groups.google.com/group/android-developers/post?hl=en_US>, <mailto:android-developers@googlegroups.com>
List-subscribe: <http://groups.google.com/group/android-developers/subscribe?hl=en_US>, <mailto:android-developers+subscribe@googlegroups.com>
List-unsubscribe: <http://groups.google.com/group/android-developers/subscribe?hl=en_US>, <mailto:android-developers+unsubscribe@googlegroups.com>
Mailing-list: list android-developers@xxxxxxxxxxxxxxxx; contact android-developers+owners@xxxxxxxxxxxxxxxx
Reply-to: android-developers@xxxxxxxxxxxxxxxx
Sender: android-developers@xxxxxxxxxxxxxxxx
User-agent: G2/1.0
Hola,

soy *experimenting con el *VpnService que era añadió a *Android en
SDK 4.0. He conseguido tan lejos cuando empezando el *VpnService, aun así, soy incapaz de crear la interfaz virtual. Mi código echa un
*IllegalStateException y no soy capaz de imaginar fuera de por qué.

Mi corte abajo el ejemplo parece esto:

			*ParcelFileDescriptor *pfd = *null;

			*VpnService.Constructor *b = nuevo *VpnService.Constructor();
			prueba
				#unknown{^*b.*addAddress("10.0.6.2", 24);
				*b.*setMtu(1460);
				*b.*setSession("*TunnelTest");
			} Coge(*IllegalArgumentException *e)
				#unknown{^*Log.*v("Servicio", "la Dirección es nula!");
				*stopSelf();
				Regreso;
			}

			prueba
				#unknown{^*pfd = *b.Establece();
			} coge (*IllegalArgumentException *e)
				#unknown{^*Log.*v("Servicio", "la Interfaz fue proporcionada con un argumento
ilegal");
			} coge (*IllegalStateException *e)
				#unknown{^*e.*printStackTrace();
				*Log.*v("Servicio", "estado Ilegal");
			} coge (*SecurityException *e)
				#unknown{^*Log.*v("Servicio", "excepción de Seguridad echada");

Qué intento hacer aquí es para crear una interfaz virtual con IP
10.0.6.2, perteneciendo al 10.6.0.0/24 *subnet. La excepción es echada
por el *b.Establece() llamada.

Esto es el lleno *stack rastro:

	11-30 17:51:10.863: *W/Sistema.*err(2741):
*java.*lang.*IllegalStateException: No puede crear interfaz
	11-30 17:51:10.875: *W/Sistema.*err(2741): 	en
*android.*os.*Parcel.*readException(*Parcel.*java:1335)
	11-30 17:51:10.875: *W/Sistema.*err(2741): 	en
*android.*os.*Parcel.*readException(*Parcel.*java:1281)
	11-30 17:51:10.875: *W/Sistema.*err(2741): 	en
*android.Red.*IConnectivityManager$Colilla
$*Proxy.*establishVpn(*IConnectivityManager.*java:1321)
	11-30 17:51:10.875: *W/Sistema.*err(2741): 	en *android.Red.*VpnService
$Constructor.Establece(*VpnService.*java:472)
	11-30 17:51:10.875: *W/Sistema.*err(2741): 	en ningún.*simtel.*TestVpnService
$*TestVpn.Carrera(*TestVpnService.*java:37)

*Thanks anticipadamente para cualquier ayuda.

/Kristian

-- 
recibiste este mensaje porque eres *subscribed al *Google
Grupos "*Android *Developers" grupo.
A correo a este grupo, envía *email a *android-developers@xxxxxxxxxxxxxxxx
A *unsubscribe de este grupo, envía *email a *android-*developers+unsubscribe@xxxxxxxxxxxxxxxx

Puesto que más opciones, visita este grupo en
*http://grupos.*google.*com/Grupo/*android-*developers?*hl=*en

Hello,

I am experimenting with the VpnService that was added to Android in
SDK 4.0. I have gotten as far as starting the VpnService, however, I
am unable to create the virtual interface. My code throws an
IllegalStateException and I am not able to figure out why.

My cut down example looks like this:

			ParcelFileDescriptor pfd = null;

			VpnService.Builder b = new VpnService.Builder();
			try{
				b.addAddress("10.0.6.2", 24);
				b.setMtu(1460);
				b.setSession("TunnelTest");
			} catch(IllegalArgumentException e){
				Log.v("Service", "Address is invalid!");
				stopSelf();
				return;
			}

			try{
				pfd = b.establish();
			} catch (IllegalArgumentException e){
				Log.v("Service", "Interface was provided with an illegal
argument");
			} catch (IllegalStateException e){
				e.printStackTrace();
				Log.v("Service", "Illegal state");
			} catch (SecurityException e){
				Log.v("Service", "Security exception thrown");

What I try to do here is to create a virtual interface with IP
10.0.6.2, belonging to the 10.6.0.0/24 subnet. The exception is thrown
by the b.establish() call.

This is the full stack trace:

	11-30 17:51:10.863: W/System.err(2741):
java.lang.IllegalStateException: Cannot create interface
	11-30 17:51:10.875: W/System.err(2741): 	at
android.os.Parcel.readException(Parcel.java:1335)
	11-30 17:51:10.875: W/System.err(2741): 	at
android.os.Parcel.readException(Parcel.java:1281)
	11-30 17:51:10.875: W/System.err(2741): 	at
android.net.IConnectivityManager$Stub
$Proxy.establishVpn(IConnectivityManager.java:1321)
	11-30 17:51:10.875: W/System.err(2741): 	at android.net.VpnService
$Builder.establish(VpnService.java:472)
	11-30 17:51:10.875: W/System.err(2741): 	at no.simtel.TestVpnService
$TestVpn.run(TestVpnService.java:37)

Thanks in advance for any help.

/Kristian

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
android-developers+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

<Anterior por Tema] Tema Actual [Siguiente por Tema>