Java Web Start erro NINGUÉMMMMMMMM?

3 respostas
M

Bom dia Galera!
Estou tentando executar um exemplo de Java web Start, mas já fiz tudo do tutorial..mas dá erro 404.

Eu criei o projeto, a classe principal, o arquivo xml do jnlp , criei o .jar abri a pasta do tomcat e joguei dentro do ROOT o .xml e o .jar e na pasta conf o arquivo web.xml já estava configurado no mime-mapping pro jnlp.
Se alguem puder me ajudar agradeço, pois parece ser tão simples.Obrigada!!!

package com.mkyong;
 
import java.awt.*;
import javax.swing.*;
import java.net.*;
import javax.jnlp.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
 
public class TestJnlp  {
  static BasicService basicService = null;
  public static void main(String args[]) {
    JFrame frame = new JFrame("Mkyong Jnlp UnOfficial Guide");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JLabel label = new JLabel();
    Container content = frame.getContentPane();
    content.add(label, BorderLayout.CENTER);
    String message = "Jnln Hello Word";
 
    label.setText(message);
 
    try {
      basicService = (BasicService)
        ServiceManager.lookup("javax.jnlp.BasicService");
    } catch (UnavailableServiceException e) {
      System.err.println("Lookup failed: " + e);
    }
 
    JButton button = new JButton("http://www.mkyong.com");
 
    ActionListener listener = new ActionListener() {
      public void actionPerformed(ActionEvent actionEvent) {
        try {
          URL url = new URL(actionEvent.getActionCommand());
          basicService.showDocument(url);
        } catch (MalformedURLException ignored) {
        }
      }
    };
 
    button.addActionListener(listener);
 
    content.add(button, BorderLayout.SOUTH);
    frame.pack();
    frame.show();
  }
}
<?xml version="1.0" encoding="utf-8"?> 
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="Test.jnlp">
	<information>
		<title>Jnlp Testing</title>
		<vendor>YONG MOOK KIM</vendor>
		<homepage href="http://localhost:8080/" />
		<description>Testing Testing</description>
	</information>
	<security>
		<all-permissions/>
	</security>
	<resources>
		<j2se version="1.6+" />
		<jar href="TestJnlp.jar" />
	</resources>
	<application-desc main-class="com.mkyong.TestJnlp" />
	                          
</jnlp>

web.xml do tomcat


jnlp
application/x-java-jnlp-file

TESTE: URL http://localhost:8080/Test.jnlp

3 Respostas

M

Consegui mudar de erro, o arquivo jnlp estava como .xml agora está correto Test.jnlp
Agora o erro é outro: e alguém puder me ajudar agradeço.

com.sun.deploy.net.JARSigningException: Found unsigned entry in resource: <a href="http://localhost:8080/TestJnlp.jar">http://localhost:8080/TestJnlp.jar</a>

at com.sun.javaws.security.SigningInfo.getCommonCodeSignersForJar(Unknown Source)

at com.sun.javaws.security.SigningInfo.check(Unknown Source)

at com.sun.javaws.LaunchDownload.checkSignedResourcesHelper(Unknown Source)

at com.sun.javaws.LaunchDownload.checkSignedResources(Unknown Source)

at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source)

at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)

at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)

at com.sun.javaws.Launcher.launch(Unknown Source)

at com.sun.javaws.Main.launchApp(Unknown Source)

at com.sun.javaws.Main.continueInSecureThread(Unknown Source)

at com.sun.javaws.Main$1.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)
B

Acho que esse erro é por não ter os .jars do projeto assinado…

F

Um bom tópico sobre o JWS
http://www.guj.com.br/posts/list/115317.java

Criado 14 de julho de 2010
Ultima resposta 16 de jul. de 2010
Respostas 3
Participantes 3