Glassfish应用程序不能使用maven库(gf-client) [英] Glassfish application not working with maven library (gf-client)

查看:138
本文介绍了Glassfish应用程序不能使用maven库(gf-client)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于一个学校作业,我使用Glassfish(3开源版本)使用JNDI和JMS接收了Netbeans项目。此应用程序使用的所有Glassfish库都被绝对路径引用,并且所有其他库(位于lib文件夹中)都由相对路径引用。



由于我的组正在使用版本控制系统,存储库中包含lib文件夹。这工作正常,因为它是一个小项目。然而,Glassfish库是有问题的,因为我是Linux用户,其他人是Windows用户。我们通过让Netbeans处理库路径来解决这个问题。



选择的解决方案有效但不是最好的解决方案。我认为Maven会是一个更好的解决方案。



然而,gf-client库存在问题。每当我使用Mavengf-client时,应用程序会抛出异常:环境或系统属性中的名称,或作为applet参数或应用程序资源文件中的名称:java.naming.factory.initial

这两个库的版本均为3.1.2。这些库的结构看起来完全相同,也都是MANIFEST.MF文件。然而,这两个文件的大小和md5sum是不相等的。



我尝试了所有可以在默认Maven存储库中找到的gf-client库, 。没有其他库会给我带来问题。

解决方案

能够通过将其添加到我的pom.xml来解决它:

 < dependency> 
< groupId> org.glassfish.main.extras< / groupId>
< artifactId> glassfish-embedded-all< / artifactId>
< version> 3.1.2< / version>
< /依赖关系>

gf-client jar引用了其他jar中的类。它缺少的第一个类可能是 java.naming.factory.initial 。但修复后,它仍然需要一堆其他类。最快的方法是添加glassfish-embedded-all依赖项。


For a school assignment I received a Netbeans project using JNDI and JMS with Glassfish (3 open source edition). All the Glassfish libraries this application is using are referenced by absolute path and all the other libraries (in the "lib" folder) are referenced by relative path.

Since my group is working with a version control system the "lib" folder is included in the repository. This works fine because it is a small project. However the Glassfish libraries are problematic as I am a Linux user and the others are Windows users. We have worked around this problem by letting Netbeans take care of the library paths.

The chosen solution 'works' but is not the best solution. I thought Maven would be a better solution.

However the "gf-client" library is giving problems. Whenever I use the Maven "gf-client" the application throw an exception:

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial

Both libraries have "3.1.2" as version. The structures of the libraries look identical and both MANIFEST.MF files too. The size and the md5sum of both files however are not equal.

I've tried all "gf-client" libraries I could find in the default Maven repository and none worked. No other library gives me problems.

解决方案

Was able to resolve it by adding this to my pom.xml:

<dependency>
    <groupId>org.glassfish.main.extras</groupId>
    <artifactId>glassfish-embedded-all</artifactId>
    <version>3.1.2</version>
</dependency>

The gf-client jar is referring to classes in other jars. The first class it was missing was probably java.naming.factory.initial. But after fixing this it still needed a bunch of other classes. Quickest way for me was to add the glassfish-embedded-all dependency.

这篇关于Glassfish应用程序不能使用maven库(gf-client)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆