Skip to main content

JXMapVIewer & JNLP

7 replies [Last post]
lbrucet
Offline
Joined: 2006-10-03

Hi,

I test this control with google maps and Netbeans 5.0 and all OK. I Run Main Project (F6) From Netbeans and I navegate with google maps with this code:

TileProviderInfo tileProviderInfo = map.getTileProviderInfo();
TileFactory tileFactory = new DefaultTileFactory(tileProviderInfo);

JXMapViewer MapViewer = new JXMapViewer();

// FormMAPA is a JInternalFrame
FormMAPA.getContentPane().add(MapViewer);

MapViewer.setFactory(tileFactory);
MapViewer.setCenterPosition(new GeoPosition(41,1.8));
MapViewer.setZoom(4);

But when I try create a JNLP, and I upload to server and chargue this JNLP from IE then I see this error in java panel and don't see the map:

Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at org.jdesktop.swingx.mapviewer.empty.EmptyTileFactory.getTile(EmptyTileFactory.java:58)
at org.jdesktop.swingx.JXMapViewer.drawMapTiles(JXMapViewer.java:231)
at org.jdesktop.swingx.JXMapViewer.paintComponent(JXMapViewer.java:179)
at javax.swing.JComponent.paint(Unknown Source)
at org.jdesktop.swingx.JXPanel.paint(JXPanel.java:389)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
.
.
.

This problem I don't believe that is google provider, because if I put only the JXMapViewer without provider, also I see the same error in java panel. Always if executed from Netbeans all ok, not errors... and see the map correctly.

I try differents options with my code, but I can't go out this error. Perhaps problem with libraries?.. This jar files are in \dist (singx and singx-ws). Very rare!!!

Some person can help me for execute my project with JNLP?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
lbrucet
Offline
Joined: 2006-10-03

Yes, too liberal, so liberal that now I need certificates...

ufff!!! I continue search info, now about certificates.

The permissions are all open. but when chargue JNLP need certificates of my libraries (swingX, .... etc).

Lluis

rbair
Offline
Joined: 2003-07-08

You can just used self-signed certs. See the deployment.dev.java.net project for some documentation on that.

Richard

lbrucet
Offline
Joined: 2006-10-03

Perfect..... The problem is solved!!!!!!

I had that certificate all my libraries (jar files) and now the JNLP run ok from my server.

Thanks all, in speciall to Fabrizio Giudici

PD: Now I will write in new post with the FAQ: How Certificate a jar file!

Lluis

Fabrizio Giudici

On Dec 5, 2006, at 22:48 , jdnc-interest@javadesktop.org wrote:

> Hi,
>
> I test this control with google maps and Netbeans 5.0 and all OK. I
> Run Main Project (F6) From Netbeans and I navegate with google maps
> with this code:
>
> TileProviderInfo tileProviderInfo = map.getTileProviderInfo();
> TileFactory tileFactory = new DefaultTileFactory(tileProviderInfo);
>
> JXMapViewer MapViewer = new JXMapViewer();
>
> // FormMAPA is a JInternalFrame
> FormMAPA.getContentPane().add(MapViewer);
>
> MapViewer.setFactory(tileFactory);
> MapViewer.setCenterPosition(new GeoPosition(41,1.8));
> MapViewer.setZoom(4);
>
> But when I try create a JNLP, and I upload to server and chargue
> this JNLP from IE then I see this error in java panel and don't see
> the map:
>
> Exception in thread "AWT-EventQueue-0"
> java.lang.ExceptionInInitializerError
> at org.jdesktop.swingx.mapviewer.empty.EmptyTileFactory.getTile
> (EmptyTileFactory.java:58)
> at org.jdesktop.swingx.JXMapViewer.drawMapTiles(JXMapViewer.java:231)
> at org.jdesktop.swingx.JXMapViewer.paintComponent(JXMapViewer.java:
> 179)
> at javax.swing.JComponent.paint(Unknown Source)
> at org.jdesktop.swingx.JXPanel.paint(JXPanel.java:389)
> at javax.swing.JComponent.paintChildren(Unknown Source)
> at javax.swing.JComponent.paint(Unknown Source)
> at javax.swing.JComponent.paintChildren(Unknown Source)
> .
> .
> .
>
> This problem I don't believe that is google provider, because if I
> put only the JXMapViewer without provider, also I see the same
> error in java panel. Always if executed from Netbeans all ok, not
> errors... and see the map correctly.
>
> I try differents options with my code, but I can't go out this
> error. Perhaps problem with libraries?.. This jar files are in
> \dist (singx and singx-ws). Very rare!!!
>
> Some person can help me for execute my project with JNLP?
>
> Thanks
> [Message sent by forum member 'lbrucet' (lbrucet)]

Did you set properly the permissions for the JNLP app? I believe that
by default a JNLP application can't connect a socket to everywhere,
so presumably it can't just connect with maps.google.com.

--
Fabrizio Giudici, Ph.D. - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941 - fax: +39
027.005.105.36

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

lbrucet
Offline
Joined: 2006-10-03

>Did you set properly the permissions for the JNLP app? I >believe that
>by default a JNLP application can't connect a socket to >everywhere,
>so presumably it can't just connect with maps.google.com.

I see that the finally of error is:

Caused by: java.security.AccessControlException: access denied (java.util.logging.LoggingPermission control)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.util.logging.LogManager.checkAccess(Unknown Source)
at java.util.logging.Logger.checkAccess(Unknown Source)
at java.util.logging.Logger.setLevel(Unknown Source)
at org.jdesktop.swingx.mapviewer.Tile.(Tile.java:47)

Then should be this cause. I try set this property connect from java panel but not found (I use JRE 1.6.0-rc). Where set this property?...

Thanks

Lluis

Fabrizio Giudici

On Dec 5, 2006, at 23:14 , jdnc-interest@javadesktop.org wrote:

>> Did you set properly the permissions for the JNLP app? I >believe
>> that
>> by default a JNLP application can't connect a socket to >everywhere,
>> so presumably it can't just connect with maps.google.com.
>
> I see that the finally of error is:
>
> Caused by: java.security.AccessControlException: access denied
> (java.util.logging.LoggingPermission control)
> at java.security.AccessControlContext.checkPermission(Unknown Source)
> at java.security.AccessController.checkPermission(Unknown Source)
> at java.lang.SecurityManager.checkPermission(Unknown Source)
> at java.util.logging.LogManager.checkAccess(Unknown Source)
> at java.util.logging.Logger.checkAccess(Unknown Source)
> at java.util.logging.Logger.setLevel(Unknown Source)
> at org.jdesktop.swingx.mapviewer.Tile.(Tile.java:47)
>
> Then should be this cause. I try set this property connect from
> java panel but not found (I use JRE 1.6.0-rc). Where set this
> property?...

I don't remember the precise syntax, but properties must be declared
in the .jnlp file. As a starter the following block:



should works, but it's a bit too liberal :-)

--
Fabrizio Giudici, Ph.D. - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941 - fax: +39
027.005.105.36

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

lbrucet
Offline
Joined: 2006-10-03

Thanks Fabrizio, I stay search more info about this permission. I will try with your sintaxis in my GSM.jnlp

I will advice to you when all correct.

Lluis