users@glassfish.java.net

Re: How can I avoid the "reloading native library error"?

From: Bernhard Thalmayr <bernhard.thalmayr_at_painstakingminds.com>
Date: Thu, 01 Dec 2011 12:22:16 +0100

Not sure how to accomplish it with NetBeans (I don't think it is aware
of the new 'asadmin' options)

However using 'asadmin' I would say...


copy the Java-lib which has the JNI code into '<domain-dir>/lib/applibs'

do 'asadmin deploy .... --target <target> --libraries <java-lib>
<path-to-app>'

either set 'native classpath prefix' to the directory where the native
part receides (and if necessary set something like 'LD_LIBRARY_PATH' for
the user the instance is run as).

-Bernhard

On 12/01/2011 11:14 AM, forums_at_java.net wrote:
> I am developing applications that use an native, shared library; I am using
> NetBeans as the IDE tool, and deploy my apps to Glassfish. In Netbeans I
> have
> to include the .jar file that encapsualtes the API for the shared
> library in
> the project; unfortunately this means that every time I re-deploy,
> Glassfish
> tries to load another instance of the native, shared library, and fails, so
> in effect I have to restart Glassfish every time I make even the smallest
> change. This is clearly not sustainable, and I don't believe that people
> who
> develop J2EE apps haven't found a way around this issue.
>
> To me it seems that one ought to be able to do the same as for JDBC
> drivers -
> you load it as part of the Glassfish configuration, independently of any
> application that wants to use it; and then you do the same in the IDE, so
> that you can use the API without having to include it in your application.
>
> So, the big questio in this forums is: how can I load my API into
> Glassfish,
> without including it in the application that needs to use it?
>
>
>
>
> --
>
> [Message sent by forum member 'janpla']
>
> View Post: http://forums.java.net/node/869657
>
>
>


-- 
Painstaking Minds
IT-Consulting Bernhard Thalmayr
Herxheimer Str. 5, 83620 Vagen (Munich area), Germany
Tel: +49 (0)8062 7769174
Mobile: +49 (0)176 55060699
bernhard.thalmayr_at_painstakingminds.com - Solution Architect
This e-mail may contain confidential and/or privileged information.If 
you are not the intended recipient (or have received this email in 
error) please notify the sender immediately and delete this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.