Re: BeanShell and Class: x not in namespace

Lateef Jackson <[email protected]> Fri, 16 Jun 2006 10:16:23 -0400
Newsgroups gmane.comp.java.jpublish.devel
Message-ID <[email protected]>
--===============1480174014==
Content-Type: multipart/alternative; boundary=Apple-Mail-1-361492017


--Apple-Mail-1-361492017
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	delsp=yes;
	format=flowed

There are a couple of issues (actually a lot of issues with JBoss/ 
J2EE but that would take an encyclopedia):
1) The jython issue (you are using bsh but the problem might be  
simular) :
You hopefully have a $HOME/.jython file which should have the class  
path to all your jar you want jython to have access to (including the  
ones in your EAR directory). Whatever the user that starts up jboss  
on your production server also needs to have that .jython file.
2) JPublish 3.0 is probably not going to work:
Spent a good week or two trying to get 3.0 to work and just gave up.  
It could have been that we had some other complexities with our  
classpath but I have a feeling that round peg and square hole. I  
believe I got upgraded to 2.0 (had 1 originally) but you may have  
better luck because you are starting from scratch.
3) JBoss hotdeploy in all this:
hotdeploy might be more of not cold deploy. I think we had to do some  
hacking to something to get this to work in 3.2 (Don't upgrade).  
Linux JVM seemed to be the most stable with this however minor  
version releases make a difference. So make sure you don't try to hot  
deploy when you are trying to get this to work. Go with a cold deploy.
4) Finally every WAR you have you have to have all the jar copied  
into the WEB-INF/lib separately.

If you have other issues let me know I might be able to help.
Good Luck,
Lateef
On Jun 16, 2006, at 9:51 AM, Rebel Geek wrote:

> Thanks Florin,
>
> The bsh-2.0.jar is in WEB-INF/lib of my JPublish project which is  
> in a WAR which is in an EAR which is archived. <smile> The version  
> of JBoss is 3.2 and the version if JPublish is 3.0.
>
> I did notice that BeanShell *will* find classes if they have been  
> deployed independantly in their own jar file in the deploy  
> directory as well as the all/lib of JBoss, but this is not the  
> desired effect. All the dependancies are in the WEB-INF/lib of the  
> individual project so if we need to deploy all the relevant jars  
> separately, then it becomes a management nightmare.
>
> I tried using the addClassPath in the startup bsh action (which,  
> btw, doesn't seem to be running at startup, so I had to use global- 
> action, but that's another topic) but beanshell complained that  
> addClassPath is not a known action.
>
> Do you have a solution to this? Thanks again.
>
>
>
> On 6/15/06, Florin T.PATRASCU <[email protected]> wrote:
> good old JBoss and the classpath saga:)
>
> Where exactly do you have the bsh-....jar? Is in your EAR  
> repository (EAR is expanded or archived?) or is it in the JBoss  
> server/[default|all]/lib? JBoss 4.x or 3.x? And which version of  
> JPublish are you running there?
>
> I know, is not exactly an answer ;)
> -florin
>
>
> On 15-Jun-06, at 9:48 AM, Rebel Geek wrote:
>
> Where I work, I have to deploy my application as an EAR file in a
> modified JBoss installation (the company that I work for is quite
> large and therefore capable of modifying a perfectly working app and
> making it worse <smile>). Anyway, everything works fine except when I
> call one of my classes in a bsh script, BeanShell tells me that the
> class is not in the namespace. How do I set the classpath for
> BeanShell via JPublish?
>
> Thanks.
>
>
> -- 
> Rebel Geek
> [email protected]
> 954-839-6234
> _______________________________________________
> Jpublish-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jpublish-developer
>
>
>
>
> _______________________________________________
> Jpublish-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jpublish-developer
>
>
>
>
>
> -- 
> Rebel Geek
> [email protected]
> 954-839-6234
> _______________________________________________
> Jpublish-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jpublish-developer

Lateef Jackson
[email protected]




--Apple-Mail-1-361492017
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=ISO-8859-1

<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; ">There are a couple of issues =
(actually a lot of issues with JBoss/J2EE but that would take an =
encyclopedia):<DIV>1) The jython issue (you are using bsh but the =
problem might be simular) :</DIV><DIV>You hopefully have a $HOME/.jython =
file which should have the class path to all your jar you want jython to =
have access to (including the ones in your EAR directory). Whatever the =
user that starts up jboss on your production server also needs to have =
that .jython file.</DIV><DIV>2) JPublish 3.0 is probably not going to =
work:</DIV><DIV>Spent a good week or two trying to get 3.0 to work and =
just gave up. It could have been that we had some other complexities =
with our classpath but I have a feeling that round peg and square hole. =
I believe I got upgraded to 2.0 (had 1 originally) but you may have =
better luck because you are starting from scratch.</DIV><DIV>3) JBoss =
hotdeploy in all this:</DIV><DIV>hotdeploy might be more of not cold =
deploy. I think we had to do some hacking to something to get this to =
work in 3.2 (Don't upgrade). Linux JVM seemed to be the most stable with =
this however minor version releases make a difference. So make sure you =
don't try to hot deploy when you are trying to get this to work. Go with =
a cold deploy.=A0</DIV><DIV>4) Finally every WAR you have you have to =
have all the jar copied into the WEB-INF/lib separately.</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>If you have other issues =
let me know I might be able to help.</DIV><DIV>Good =
Luck,</DIV><DIV>Lateef</DIV><DIV><DIV><DIV>On Jun 16, 2006, at 9:51 AM, =
Rebel Geek wrote:</DIV><BR class=3D"Apple-interchange-newline"><BLOCKQUOTE=
 type=3D"cite">Thanks Florin,<BR><BR>The bsh-2.0.jar is in WEB-INF/lib =
of my JPublish project which is in a WAR which is in an EAR which is =
archived. &lt;smile&gt; The version of JBoss is 3.2 and the version if =
JPublish is 3.0. <BR><BR>I did notice that BeanShell *will* find classes =
if they have been deployed independantly in their own jar file in the =
deploy directory as well as the all/lib of JBoss, but this is not the =
desired effect. All the dependancies are in the WEB-INF/lib of the =
individual project so if we need to deploy all the relevant jars =
separately, then it becomes a management nightmare. <BR><BR>I tried =
using the addClassPath in the startup bsh action (which, btw, doesn't =
seem to be running at startup, so I had to use global-action, but that's =
another topic) but beanshell complained that addClassPath is not a known =
action. <BR><BR>Do you have a solution to this? Thanks again. =
<BR><BR><BR><BR><DIV><SPAN class=3D"gmail_quote">On 6/15/06, <B =
class=3D"gmail_sendername">Florin T.PATRASCU</B> &lt;<A =
href=3D"mailto:[email protected]">[email protected]</A>&gt; wrote: =
</SPAN><BLOCKQUOTE class=3D"gmail_quote" style=3D"border-left: 1px solid =
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: =
1ex;"><DIV><DIV style=3D"">good old JBoss and the classpath =
saga:)<DIV><BR></DIV><DIV>Where exactly do you have the bsh-....jar? Is =
in your EAR repository (EAR is expanded or archived?) or is it in the =
JBoss server/[default|all]/lib? JBoss 4.x or 3.x? And which version of =
JPublish are you running there?</DIV><DIV><BR></DIV><DIV>I know, is not =
exactly an answer ;)</DIV><DIV><DIV><SPAN style=3D"border-collapse: =
separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Monaco; =
font-size: 13px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px;"> =
<DIV>-florin</DIV><BR></SPAN> </DIV><BR><DIV></DIV><DIV><SPAN class=3D"e" =
id=3D"q_10bdaf51d65cf649_1"><DIV>On 15-Jun-06, at 9:48 AM, Rebel Geek =
wrote:</DIV><BR></SPAN></DIV><DIV><BLOCKQUOTE =
type=3D"cite"></BLOCKQUOTE></DIV><DIV> <SPAN class=3D"e" =
id=3D"q_10bdaf51d65cf649_3">Where I work, I have to deploy my =
application as an EAR file in a<BR>modified JBoss installation (the =
company that I work for is quite<BR>large and therefore capable of =
modifying a perfectly working app and <BR>making it worse =
&lt;smile&gt;). Anyway, everything works fine except when I <BR>call one =
of my classes in a bsh script, BeanShell tells me that the<BR>class is =
not in the namespace. How do I set the classpath for<BR>BeanShell via =
JPublish? <BR clear=3D"all"><BR>Thanks.<BR><BR><BR>-- <BR>Rebel Geek<BR> =
<A href=3D"mailto:[email protected]" target=3D"_blank" =
onclick=3D"return =
top.js.OpenExtLink(window,event,this)">[email protected]</A><BR>954-839=
-6234</SPAN></DIV> <DIV><DIV style=3D"margin: =
0px;">_______________________________________________</DIV><DIV =
style=3D"margin: 0px;">Jpublish-developer mailing list</DIV><DIV =
style=3D"margin: 0px;"><A =
href=3D"mailto:[email protected]" target=3D"_blank"=
 onclick=3D"return top.js.OpenExtLink(window,event,this)"> =
[email protected]</A></DIV><DIV style=3D"margin: =
0px;"><A =
href=3D"https://lists.sourceforge.net/lists/listinfo/jpublish-developer" =
target=3D"_blank" onclick=3D"return =
top.js.OpenExtLink(window,event,this)"> =
https://lists.sourceforge.net/lists/listinfo/jpublish-developer</A></DIV> =
</DIV><BR></DIV></DIV> =
</DIV><BR><BR><BR>_______________________________________________<BR>Jpubl=
ish-developer mailing list<BR><A onclick=3D"return =
top.js.OpenExtLink(window,event,this)" =
href=3D"mailto:[email protected]">Jpublish-develope=
[email protected] </A><BR><A onclick=3D"return =
top.js.OpenExtLink(window,event,this)" =
href=3D"https://lists.sourceforge.net/lists/listinfo/jpublish-developer" =
target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/jpublish-de=
veloper</A><BR> <BR><BR></BLOCKQUOTE></DIV><BR><BR clear=3D"all"><BR>-- =
<BR>Rebel Geek<BR><A =
href=3D"mailto:[email protected]">[email protected]</A><BR>954-839-6=
234<DIV style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; =
">_______________________________________________</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">Jpublish-developer mailing list</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; "><A =
href=3D"mailto:[email protected]">Jpublish-develope=
[email protected]</A></DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A =
href=3D"https://lists.sourceforge.net/lists/listinfo/jpublish-developer">h=
ttps://lists.sourceforge.net/lists/listinfo/jpublish-developer</A></DIV> =
</BLOCKQUOTE></DIV><BR><DIV> <SPAN class=3D"Apple-style-span" =
style=3D"border-collapse: separate; border-spacing: 0px 0px; color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Lateef =
Jackson</DIV><DIV><A =
href=3D"mailto:[email protected]">[email protected]</A></DIV></SPAN></SP=
AN><BR class=3D"Apple-interchange-newline"></SPAN><SPAN></SPAN><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><BR =
class=3D"Apple-interchange-newline"></SPAN><SPAN></SPAN></SPAN></SPAN></SP=
AN> </DIV><BR></DIV></BODY></HTML>=

--Apple-Mail-1-361492017--


--===============1480174014==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1480174014==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Jpublish-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jpublish-developer

--===============1480174014==--