how add jar in SU

View: New views
6 Messages — Rating Filter:   Alert me  

how add jar in SU

by gruault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I made an SE which required class name as extension parameter.
 this class depend on SU using the SE, how to make to add to a my SU a jar containing my configured class?
thanks

Re: how add jar in SU

by Christophe Hamerling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

If you are using petals maven plugin to create your SU, you must add your jar as maven dependency. It will be added to the SU archive.
Then in your code you must create a class loader from the SU resources to be able to use it.

On Thu, Sep 18, 2008 at 10:02 AM, gruault <gruault@...> wrote:

Hello,

I made an SE which required class name as extension parameter.
 this class depend on SU using the SE, how to make to add to a my SU a jar
containing my configured class?
thanks
--
View this message in context: http://www.nabble.com/how-add-jar-in-SU-tp19547943p19547943.html
Sent from the Petals Users mailing list archive at Nabble.com.



--
You receive this message as a subscriber of the petals-users@... mailing list.
To unsubscribe: mailto:petals-users-unsubscribe@...
For general help: mailto:sympa@...?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
Christophe Hamerling
PEtALS ESB Research Engineer / Product Manager @ eBM WebSourcing
http://petals.ow2.org
http://petals.ebmwebsourcing.com
Phone : +33534320314
Skype : christophe.hamerling


--
You receive this message as a subscriber of the petals-users@... mailing list.
To unsubscribe: mailto:petals-users-unsubscribe@...
For general help: mailto:sympa@...?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Christophe Hamerling
PEtALS ESB Project Leader
http://petals.ow2.org
SkypeMe on christophe.hamerling

Re: how add jar in SU

by Roland Naudin - EBM WebSourcing :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

If you want to load a class from a jar provided in your SU, you need to
create a classloader to embed the jar at deploiement time. Have a lool
to the POJO component, it's an fair simple illustration of this
mechanism.

If you are working with maven and the petals plugin, the java classes in
your maven project are automatically packaged into the SU artifact.

Le jeudi 18 septembre 2008 à 01:02 -0700, gruault a écrit :

> Hello,
>
> I made an SE which required class name as extension parameter.
>  this class depend on SU using the SE, how to make to add to a my SU a jar
> containing my configured class?
> thanks
> pièce jointe document plein texte (message-footer.txt)
> --
> You receive this message as a subscriber of the petals-users@... mailing list.
> To unsubscribe: mailto:petals-users-unsubscribe@...
> For general help: mailto:sympa@...?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Roland NAUDIN
PEtALS team
EBM Websourcing

Try PEtALS at http://petals.ow2.org




--
You receive this message as a subscriber of the petals-users@... mailing list.
To unsubscribe: mailto:petals-users-unsubscribe@...
For general help: mailto:sympa@...?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

Re: how add jar in SU

by gruault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I try this su descriptor :
<jbi:jbi version="1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:jbi="http://java.sun.com/xml/ns/jbi"
        xmlns:extensions="http://petals.ow2.org/extensions"
        xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-4.0"
        xmlns:hello="http://petals.ow2.org/Hello"
        xmlns:calculator="http://petals.ow2.org/Calculator"
        xmlns:soap="http://petals.ow2.org/components/soap/version-3.1">
        <jbi:services binding-component="false">
               
                <jbi:provides interface-name="hello:helloInterface"
                        service-name="hello:helloService" endpoint-name="helloEndpoint" >
                        <petalsCDK:wsdl xsi:nil="true"/>
                        <hello:se.sca.interface>personne.Calculator</hello:se.sca.interface>
                </jbi:provides>
                <jbi:consumes
                        interface-name="calculator:ejbCalculatorInterface"
                        service-name="calculator:ejbCalculatorService"
                        endpoint-name="ejbcalculatorEndpoint">
                        <petalsCDK:mep>InOut</petalsCDK:mep>
                </jbi:consumes>
        </jbi:services>
</jbi:jbi>

and this SU content :
+META-INF
    - jbi.xml
    - my_classes.jar  ( included  the class  personne.Calculator)


In the my Class JBIListener the code is like this :
public static final string SERVICE_INTERFACE = "se.sca.interface";
...

                String nomClassInterface = this.getExtensions().get(SERVICE_INTERFACE);
               
                ClassLoader cl = this.getClass().getClassLoader();
                Class classInterface = cl.loadClass(nomClassInterface);


but if have a ClassNotFoundException : personne.Calculator when a JBI message is processing.





Re: Re: how add jar in SU

by Roland Naudin - EBM WebSourcing :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

you must create a classloader with embed your jar.
there is an utility class in ClassLoaderUtil in the CDK to do that
easily.

Le jeudi 18 septembre 2008 à 02:11 -0700, gruault a écrit :

> Hello,
>
> I try this su descriptor :
> <jbi:jbi version="1.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jbi="http://java.sun.com/xml/ns/jbi"
> xmlns:extensions="http://petals.ow2.org/extensions"
> xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-4.0"
> xmlns:hello="http://petals.ow2.org/Hello"
> xmlns:calculator="http://petals.ow2.org/Calculator"
> xmlns:soap="http://petals.ow2.org/components/soap/version-3.1">
> <jbi:services binding-component="false">
>
> <jbi:provides interface-name="hello:helloInterface"
> service-name="hello:helloService" endpoint-name="helloEndpoint" >
> <petalsCDK:wsdl xsi:nil="true"/>
> <hello:se.sca.interface>personne.Calculator</hello:se.sca.interface>
> </jbi:provides>
> <jbi:consumes
> interface-name="calculator:ejbCalculatorInterface"
> service-name="calculator:ejbCalculatorService"
> endpoint-name="ejbcalculatorEndpoint">
> <petalsCDK:mep>InOut</petalsCDK:mep>
> </jbi:consumes>
> </jbi:services>
> </jbi:jbi>
>
> and this SU content :
> +META-INF
>     - jbi.xml
>     - my_classes.jar  ( included  the class  personne.Calculator)
>
>
> In the my Class JBIListener the code is like this :
> public static final string SERVICE_INTERFACE = "se.sca.interface";
> ...
>
> String nomClassInterface = this.getExtensions().get(SERVICE_INTERFACE);
>
> ClassLoader cl = this.getClass().getClassLoader();
> Class classInterface = cl.loadClass(nomClassInterface);
>
>
> but if have a ClassNotFoundException : personne.Calculator when a JBI
> message is processing.
>
>
>
>
>
> pièce jointe document plein texte (message-footer.txt)
> --
> You receive this message as a subscriber of the petals-users@... mailing list.
> To unsubscribe: mailto:petals-users-unsubscribe@...
> For general help: mailto:sympa@...?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Roland NAUDIN
PEtALS team
EBM Websourcing

Try PEtALS at http://petals.ow2.org




--
You receive this message as a subscriber of the petals-users@... mailing list.
To unsubscribe: mailto:petals-users-unsubscribe@...
For general help: mailto:sympa@...?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

Re: Re: how add jar in SU

by gruault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ok it's good, i changed my code like this :

String suRootPath = this.getInstallRoot();
String nomClassInterface = this.getExtensions().get(SERVICE_INTERFACE);
ClassLoader cl = ClassLoaderUtil.createClassLoader(suRootPath, this.getClass().getClassLoader());

thanks


Roland Naudin - EBM WebSourcing wrote:
you must create a classloader with embed your jar.
there is an utility class in ClassLoaderUtil in the CDK to do that
easily.

Le jeudi 18 septembre 2008 à 02:11 -0700, gruault a écrit :
> Hello,
>
> I try this su descriptor :
> <jbi:jbi version="1.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jbi="http://java.sun.com/xml/ns/jbi"
> xmlns:extensions="http://petals.ow2.org/extensions"
> xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-4.0"
> xmlns:hello="http://petals.ow2.org/Hello"
> xmlns:calculator="http://petals.ow2.org/Calculator"
> xmlns:soap="http://petals.ow2.org/components/soap/version-3.1">
> <jbi:services binding-component="false">
>
> <jbi:provides interface-name="hello:helloInterface"
> service-name="hello:helloService" endpoint-name="helloEndpoint" >
> <petalsCDK:wsdl xsi:nil="true"/>
> <hello:se.sca.interface>personne.Calculator</hello:se.sca.interface>
> </jbi:provides>
> <jbi:consumes
> interface-name="calculator:ejbCalculatorInterface"
> service-name="calculator:ejbCalculatorService"
> endpoint-name="ejbcalculatorEndpoint">
> <petalsCDK:mep>InOut</petalsCDK:mep>
> </jbi:consumes>
> </jbi:services>
> </jbi:jbi>
>
> and this SU content :
> +META-INF
>     - jbi.xml
>     - my_classes.jar  ( included  the class  personne.Calculator)
>
>
> In the my Class JBIListener the code is like this :
> public static final string SERVICE_INTERFACE = "se.sca.interface";
> ...
>
> String nomClassInterface = this.getExtensions().get(SERVICE_INTERFACE);
>
> ClassLoader cl = this.getClass().getClassLoader();
> Class classInterface = cl.loadClass(nomClassInterface);
>
>
> but if have a ClassNotFoundException : personne.Calculator when a JBI
> message is processing.
>
>
>
>
>
> pièce jointe document plein texte (message-footer.txt)
> --
> You receive this message as a subscriber of the petals-users@ow2.org mailing list.
> To unsubscribe: mailto:petals-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Roland NAUDIN
PEtALS team
EBM Websourcing

Try PEtALS at http://petals.ow2.org




--
You receive this message as a subscriber of the petals-users@ow2.org mailing list.
To unsubscribe: mailto:petals-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws