java webstar,Java Web Star java.lang.NullPointerException(JnlpxArgs.execProgram)

I have a JNLP file which is generated by a servlet dynamically . The JNLP generated is:

JSGD

evconsul

JSGD

JSGD

Hooolas

The error in a client machine:

java.lang.NullPointerException

at com.sun.javaws.JnlpxArgs.execProgram(Unknown Source)

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

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

at com.sun.javaws.Launcher.prepareAllResources(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.access$000(Unknown Source)

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

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

Missing Application-Name manifest attribute for: http://192.168.0.17:8080/Secu/huella/JSGD.jar

#### Java Web Start Error:

#### null

I have packed all libraries in one jar called JSGD.jar its struct is:

JSGD.jar

-jsgd

-META-INF

-org

-SecugenLib

I have packed my app via on Netbeans 8.1

Files->/buil.xml right click Run Target->Other Targets->package-for-store.

This generates a jar inside in Store folder. This jar has the struct described above.

In my machine runs ok(when codebase attribute is: codebase="http://localhost:8080/Secu/" of course! ). What would be the problem?

JRE version 1.7.0_79-b15(Client Machine)

I use Netbeans 8.1

DETAILS:

I have overwritten build.xml adding the next lines; to pack all classes in one jar:

value="http://192.168.0.17 http://localhost"/>

excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>

Update

Following the advices from @mosquito-x, seems the thing goes better, but Java 7(I'm trying in jre-8u91 too) block it.

The message is:

Application Blocked by Java Security.

Name: JSGD

From: http://192.168.0.17

Reason: The Java Security Settings have this application from running. You may change this behavior in Java Control Panel.

In Java control panel Site list. I have added these sites:

http://192.168.0.17:8080

http://192.168.0.17:8080/Secu

http://192.168.0.17:8080/Secu/huella

http://192.168.0.17:8080/Secu/launch

Thanks in advance!

解决方案

The JNLP :

a hardcoded codebase="http://192.168.0.17:8080/Secu/"

will only work on localhost

cause java blocked

CAUSE

Java has further enhanced security to make the user system less vulnerable to external exploits.

Starting with Java 7 Update 51, Java does not allow users to run applications that are not signed (unsigned), self-signed (not signed by trusted authority) or that are missing permission attributes.

Risks involved in running applications

Unsigned application

An application without a certificate (i.e. unsigned apps), or missing application Name and Publisher information are blocked by default. Running this kind of application is potentially unsafe and present higher level of risk.

Self-signed application (Certificate not from trusted authority)

An application with self-signed certificate is blocked ............

Application-Name Attribute

The Application-Name attribute is used in security prompts to provide a title for your signed RIA. Use of this attribute is recommended to help users make the decision to trust and run the RIA. The value can be any valid string, for example:

Application-Name: Hello World

If the Application-Name attribute is not present in the JAR file manifest ............

Modifying a Manifest File

You use the m command-line option to add custom information to the manifest during creation of a JAR file. This section describes the m option.

The Jar tool automatically puts a default manifest with the pathname META-INF/MANIFEST.MF into any JAR file you create. You can enable special JAR file functionality, such as package sealing, by modifying the default manifest. Typically, modifying the default manifest involves adding special-purpose headers to the manifest that allow the JAR file to perform a particular desired function.

To modify the manifest, you must first prepare a text file containing the information you wish to add to the manifest. You then use the Jar tool's m option to add the information in your file to the manifest.

Warning: The text file from which you are creating the manifest must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.

The basic command has this format:

jar cfm jar-file manifest-addition input-file(s)

Let's look at the options and arguments used in this command:

The c option indicates that you want to create a JAR file.

The m option indicates that you want to merge information from an existing file ...

The f option indicates that you want the output to go to a file (the JAR file) ...

manifest-addition is the name (or path and name) of the existing text file ....

jar-file is the name that you want the resulting JAR file to have.

The input-file(s) argument is a space-separated list of one or more files ....

example one of mine

MANIFEST.MF

Manifest-Version: 1.0

Ant-Version: Apache Ant 1.8.3

Main-Class: DataSummaryApplet

Class-Path: lib/plugin.jar

Application-Name: appJSN

Trusted-Only: true

Permissions: sandbox

Created-By: 1.7.0_51-b13 (Oracle Corporation)

Codebase: http://www.asitexx.com http://localhost

EDIT:

1.)

Most IDE's who creates the jar file, uses a build.xml.

The bad thing this file is always new created if you change something in the project.

You can test if you change :

with (change to your needs)

you can add domains to the codebase seperated by a blank

2.) Remove the code base from JNLP file it's not needed anymore

to

Hope it helps,

Thomas

Update

from comments

You think that I should sign with a certificate?? and How do that?

that is not that easy and you have to be careful to do everything in the correct sequence.

Be careful:

Only pure .jar file use, that has all libs and even your self created MANIFEST.FM in it.

Test this, open the jar file must contain only except the libs plain text.

No SHA-256-Digest or other parts like 7fnH8YhS5mkYtZoJqiWEI2bfSXSYd2alrKCEdvieyEketc.

Then you can with the next steps proceed.

only two links of many that may help you.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值