Skip to Main Content

Enterprise Manager

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Does weblogic12c support OSGi deployments with JSF usage

e12a10cc-8368-4d4a-833e-ecb9757b093cJun 12 2019 — edited Jun 12 2019

We have an osgi project which uses JSF 1.2, this osgi project is part of ServletBridge.war (it’s a WEB Application which contains the OSGi container and other bundles which start the OSGi container) and this needs to be deployed on web logic 12C Server. We currently support our deployment only in weblogic 11g.

We tried multiple approach provided in the documentation (making backward compatibility of JSF1.2 and 2.0 jar, by adding shared library) but no luck.

Does weblogic12c support OSGi deployments with JSF usage (either by allow packaging jsf within their own bundles or referring from weblogic server's classpath)?

Comments

Gaz in Oz
Answer

In answer to your questions:

|  Variables from js scripts live on in SQLcl past execution of the script?

Yes. Of course.

is there a way to 'clear' all previous variables etc at the end of a script, or start of the next script, without having to exit and restart?

Yes.

Use javascript delete operator to remove the variable.

For example:

SQL> $type test_1.js

test_variable = "this is a test";

delete test_variable;

SQL> $type test_2.js

ctx.write(test_variable + "\n");

SQL> script test_1.js

SQL> script test_2.js

javax.script.ScriptException: ReferenceError: "test_variable" is not defined in <eval> at line number 1

        at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470)

...

Caused by: <eval>:1 ReferenceError: "test_variable" is not defined

        at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)

...etc.

Marked as Answer by ptfl · Sep 27 2020
ptfl

Interesting, this is standard behaviour?

Is there no way to reset the entire environment, rather than variable by variable?

I'm curious about situations where you might be running scripts from different developers, any of which might clash on a variable name in an unexpected way.

ptfl

Gaz in Oz

Interesting, this is standard behaviour?

Yes. A UI session that gets a variable defined, I would expect it to stay defined until it is explicitly undefined or the UI session is terminated/ended.

Is there no way to reset the entire environment, rather than variable by variable?

Yes, there is a way, which is also standard, terminate and restart the UI session.

Instead of keeping your single session "running" and worrying about how the "developers" have defined javscript variables as "local" or "global", review the script/s before running, approve them, then run  them up in their own sqlcl instances:

I'm curious about situations where you might be running scripts from different developers, any of which might clash on a variable name in an unexpected way.

If a developer "uses" a variable before defining it, then the script is run in a UI session that already had that variable defined and NOT undefined, then sure, it will pick up the value that is already defined. That is a bug in the developers code that used a variable before defining it (and thus not setting/resetting/changing its value). Not the UI's fault, the developers.

To make sure that sort of bug is picked up, run all scripts in their own sqlcl instance. No big deal.

If there were two different UI sessions running at the same time, then those variables would be exclusive to the individual UI session.

For example, if you had 5 scripts to run, from different developers, who's code you haven't reviewed and so can not trust, you could loop through each, in a shell script and run them one by one.

1 - 3

Post Details

Added on Jun 12 2019
0 comments
326 views