cancel
Showing results for 
Search instead for 
Did you mean: 

Setting application reference programmatically?

Former Member
0 Kudos

Hello Everyone,

Is there a way to specify application reference programmatically in a J2EE application at runtime (e.g. "com.sap.km.application"), instead of declaring it in the application-j2ee-engine.xml at deploy time?

Thanks,

Martin

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Martin,

No, there is no such API. And it does not make sense to have one. Application references are taken into account at deploy/start time (e.g. to determine deploy/start order, etc.), so even if it were possible to specify references at runtime, they would not have any effect.

Best regards,

Vladimir

Former Member
0 Kudos

Hello Vladimir,

Thanks for the reply.

I think part of the problem is limited understanding on my part.

What role does the application reference play besides influencing the classloader? If I were able to influence the classloader to find the relevant classes, would this be sufficient? How would I go about doing that?

Thanks,

Martin

Vlado
Advisor
Advisor
0 Kudos

Hi Martin,

Sufficient for what? Could you describe a little bit more your scenario?

-Vladimir

Former Member
0 Kudos

Hello Vladimir,

My question is what exactly setting references in the J2EE application (at deploy time) does.

So I am wondering whether being able to influence the classloader is sufficient to make an application function that references KM. (I am just using KM as an example).

Martin

Former Member
0 Kudos

Hi Martin,

Besides the classloading, that reference information is used to determine the startup order among applications.

So if your application will try to use resources and functionality from KM without reference, then it might try to start BEFORE KM and end in exceptions since they won't be available.

Please check

for a real world example.

HTH

Peter

Former Member
0 Kudos

Hi Peter,

Thank you for the reply. I understand your point about J2EE using this information to determine startup order, as the reference also defines dependencies, which makes perfect sense.

Do you know, however, whether there is a way (maybe via an API) to specify an application reference at runtime (instead of at deploy time) to be able to influence the classloader to pick up classes from another application, for example KM? That is what I am trying to do.

Regards,

Martin

Former Member
0 Kudos

Hi Martin,

Sorry, I am not aware of such API.

Btw, knowing the fame of Vladimir and the vast variety of posts over so many topics for the java web application server, I would believe him that there is no such way.

HTH

Peter

Former Member
0 Kudos

Thanks Peter.

Vladimir, I guess I owe you some points too in that case.

Regards,

Martin

Vlado
Advisor
Advisor
0 Kudos

Hi Martin,

I should have added that application classloaders are initialized at deploy/start time and there is no way to modify them once being created. So, even if you change the app references at runtime, you'll need to restart that app.

Anyway, if you are still interested in going this direction, you might want to have a look at the CHANGE_REF telnet command in the <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/01343ef3f9ff2de10000000a114084/frameset.htm">DEPLOY</a> group.

Best regards,

Vladimir

PS: Peter, thanks for the kind words

Former Member
0 Kudos

Thanks guys.

Answers (0)