Trying to deploy on WebLogic 10.3, getting modjy error

350 views
Skip to first unread message

Bill K

unread,
Jan 21, 2010, 3:29:50 PM1/21/10
to django-jython-dev
I am trying to deploy a WAR file on a WebLogic server. And I am
getting the following error:

<Stack trace for message 149004
weblogic.application.ModuleException: [HTTP:101216]Servlet: "modjy"
failed to preload on startup in Web application: "myapp.war".
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named modjy

I verified that the module modjy was included in the WAR file in WEB-
INF/lib-python/Lib/modjy.

My next thought was that WebLogic was using its internal Jython which
is only at 2.2, and that was somehow causing an issue. So I added a
weblogic.xml file to the WAR file and used the following descriptor:
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
Which is supposed to make WebLogic use the classes in the WAR file.

But I received the same error.

Thanks for the assistance.
-Bill

PS - Great job on Django-Jython, it has worked really well. I
imported a project developed under Django for CPython and with just a
few config changes everything came up great on the internal django web
server. Hopefully I can get it running on WebLogic.

Allan Davis

unread,
Jan 22, 2010, 12:23:11 AM1/22/10
to django-j...@googlegroups.com
Weblogic has an special version of jython 2.2.1 in it's classpath. 

you need to a weblogic.xml to the template

<weblogic-web-app>

   <container-descriptor>
       <prefer-web-inf-classes>true</prefer-web-inf-classes>
   </container-descriptor>
</weblogic-web-app>

Thanks,
--------------------------------------------------------------
Allan Davis
Member of NetBeans Dream Team
http://wiki.netbeans.org/NetBeansDreamTeam
Lead Developer, nbPython
http://wiki.netbeans.org/Python
http://codesnakes.blogspot.com (my blog)
Co-Chair, CajunJUG
http://www.cajunjug.org


--
You received this message because you are subscribed to the Google Groups "django-jython-dev" group.
To post to this group, send email to django-j...@googlegroups.com.
To unsubscribe from this group, send email to django-jython-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-jython-dev?hl=en.




Bill K

unread,
Jan 22, 2010, 10:53:26 AM1/22/10
to django-jython-dev
Thanks Allan, for the response.

But I tried that prior to posting and it did not resolve the issue.

> > My next thought was that WebLogic was using its internal Jython which
> > is only at 2.2, and that was somehow causing an issue. So I added a
> > weblogic.xml file to the WAR file and used the following descriptor:
> > <container-descriptor>
> > <prefer-web-inf-classes>true</prefer-web-inf-classes>
> > </container-descriptor>
> > Which is supposed to make WebLogic use the classes in the WAR file.

Thanks again for the suggestion.

- Bill

On Jan 22, 12:23 am, Allan Davis <javaal...@gmail.com> wrote:
> Weblogic has an special version of jython 2.2.1 in it's classpath.
>
> you need to a weblogic.xml to the template
>
> <weblogic-web-app>
>    <container-descriptor>
>        <prefer-web-inf-classes>true</prefer-web-inf-classes>
>    </container-descriptor>
> </weblogic-web-app>
>
> Thanks,
> --------------------------------------------------------------
> Allan Davis
> Member of NetBeans Dream Teamhttp://wiki.netbeans.org/NetBeansDreamTeam
> Lead Developer, nbPythonhttp://wiki.netbeans.org/Pythonhttp://codesnakes.blogspot.com(my blog)

> Co-Chair, CajunJUGhttp://www.cajunjug.org

> > django-jython-...@googlegroups.com<django-jython-dev%2Bunsu...@googlegroups.com>

Allan Davis

unread,
Jan 22, 2010, 11:14:39 AM1/22/10
to django-j...@googlegroups.com
Well what you need to do thin is modify the PRECLASSPATH in the setDomainEnv file for the domain.  Add the Jython jar to that so it overrides the weblogic file.  This was always my backup plan when the weblogic.xml file fails. 


--------------------------------------------------------------
Allan Davis
To unsubscribe from this group, send email to django-jython-...@googlegroups.com.

Leo Soto M.

unread,
Jan 22, 2010, 3:50:01 PM1/22/10
to django-j...@googlegroups.com
On Fri, Jan 22, 2010 at 1:14 PM, Allan Davis <java...@gmail.com> wrote:
> Well what you need to do thin is modify the PRECLASSPATH in the setDomainEnv
> file for the domain.  Add the Jython jar to that so it overrides the
> weblogic file.  This was always my backup plan when the weblogic.xml file
> fails.

That's a good idea. At least it will let us know if it's a problem of
configuration or if it's a problem with the WAR file being deployed.

A similar test for determining the same thing would be to deploy the
WAR file on Tomcat or another servlet container and see if you get the
same error there.
--
Leo Soto M.
http://blog.leosoto.com

Bill K

unread,
Jan 25, 2010, 3:13:33 PM1/25/10
to django-jython-dev
Thanks for the help so far. I did test the WAR with Glassfish v3 and
it came up as expected.
But I made the changes suggested by Allan for WebLogic (adding the
jython.jar file to the PRE_CLASSPATH) and I am now receiving the
following error:

<Jan 25, 2010 3:10:38 PM EST> <Error> <HTTP> <BEA-101216> <Servlet:
"modjy" failed to preload on startup in Web application: "wlstdj.war".


Traceback (most recent call last):

File "/usr/share/jython2.5.1/Lib/modjy/modjy.py", line 43, in
__init__
HttpServlet.__init__(self)
RuntimeError: maximum recursion depth exceeded

at org.python.core.PyException.fillInStackTrace
(PyException.java:70)
at java.lang.Throwable.<init>(Throwable.java:181)
at java.lang.Exception.<init>(Exception.java:29)
at java.lang.RuntimeException.<init>(RuntimeException.java:32)
at org.python.core.PyException.<init>(PyException.java:46)
Truncated. see log file for complete stacktrace
>
<Jan 25, 2010 3:10:38 PM EST> <Error> <Deployer> <BEA-149231> <Unable
to set the activation state to true for the application 'wlstdj'.


weblogic.application.ModuleException: [HTTP:101216]Servlet: "modjy"

failed to preload on startup in Web application: "wlstdj.war".


Traceback (most recent call last):

File "/usr/share/jython2.5.1/Lib/modjy/modjy.py", line 43, in
__init__
HttpServlet.__init__(self)
RuntimeError: maximum recursion depth exceeded

at weblogic.servlet.internal.WebAppModule.startContexts
(WebAppModule.java:1376)
at weblogic.servlet.internal.WebAppModule.start
(WebAppModule.java:452)
at weblogic.application.internal.flow.ModuleStateDriver$3.next
(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState
(StateMachineDriver.java:37)
at weblogic.application.internal.flow.ModuleStateDriver.start
(ModuleStateDriver.java:60)
Truncated. see log file for complete stacktrace


Traceback (most recent call last):

File "/usr/share/jython2.5.1/Lib/modjy/modjy.py", line 43, in
__init__
HttpServlet.__init__(self)
RuntimeError: maximum recursion depth exceeded

at org.python.core.PyException.fillInStackTrace
(PyException.java:70)
at java.lang.Throwable.<init>(Throwable.java:181)
at java.lang.Exception.<init>(Exception.java:29)
at java.lang.RuntimeException.<init>(RuntimeException.java:32)
at org.python.core.PyException.<init>(PyException.java:46)
Truncated. see log file for complete stacktrace
>

In the setDomainEnv.sh file I added the path to the jython.jar on the
local file system. Is there a way and would it be better to reference
the one that gets added to the WAR file when it is generated?

Again thanks for the help.

Bill

On Jan 22, 3:50 pm, "Leo Soto M." <leo.s...@gmail.com> wrote:

Leo Soto M.

unread,
Jan 25, 2010, 6:35:49 PM1/25/10
to django-j...@googlegroups.com
On Mon, Jan 25, 2010 at 5:13 PM, Bill K <koc...@gmail.com> wrote:
> Thanks for the help so far.  I did test the WAR with Glassfish v3 and
> it came up as expected.
> But I made the changes suggested by Allan for WebLogic (adding the
> jython.jar file to the PRE_CLASSPATH) and I am now receiving the
> following error:
>
> <Jan 25, 2010 3:10:38 PM EST> <Error> <HTTP> <BEA-101216> <Servlet:
> "modjy" failed to preload on startup in Web application: "wlstdj.war".
> Traceback (most recent call last):
>  File "/usr/share/jython2.5.1/Lib/modjy/modjy.py", line 43, in
> __init__

Oops, so you have been hit by this Jython bug:
<http://bugs.jython.org/issue1489>. I'd recommend to add a comment to
that bug noting that it doesn't only happen on Tomcat/Windows but also
on Weblogic/[TheOSYouAreUsing].

Allan Davis

unread,
Jan 26, 2010, 8:32:19 AM1/26/10
to django-j...@googlegroups.com
After reviewing the problem.  WLST is the Weblogic extension to jython 2.2.1.  this does some of the internal functions in weblogic such as deployment.  When the pre-classpath is set to jython 2.5.1, we are saying to use the 2.5.1 for everying.  The weblogic extentions that was written for 2.2.1 does not work.  This is not a bug with jython.  This is a bug with weblogic.

 I have been doing some testing and have had the same results. 


--------------------------------------------------------------
Allan Davis
Member of NetBeans Dream Team
http://wiki.netbeans.org/NetBeansDreamTeam
Lead Developer, nbPython
http://wiki.netbeans.org/Python
http://codesnakes.blogspot.com (my blog)
Co-Chair, CajunJUG
http://www.cajunjug.org


Leo Soto M.

unread,
Jan 26, 2010, 11:02:04 AM1/26/10
to django-j...@googlegroups.com
Is there any evaluation versions of WL (ideally the same version you
are using) out there for OSX? I might be able to set some time apart
to look into the problem.

--

Allan Davis

unread,
Jan 26, 2010, 12:04:12 PM1/26/10
to django-j...@googlegroups.com
You can download JDeveloper or Weblogic server from oracle (otn.oracle.com ).  The Development version is free.  It will run on any java platform including OSX.

Thanks,

--------------------------------------------------------------
Allan Davis
Member of NetBeans Dream Team
http://wiki.netbeans.org/NetBeansDreamTeam
Lead Developer, nbPython
http://wiki.netbeans.org/Python
http://codesnakes.blogspot.com (my blog)
Co-Chair, CajunJUG
http://www.cajunjug.org


Bill K

unread,
Jan 26, 2010, 1:19:19 PM1/26/10
to django-jython-dev
Allan, I understand what you are saying about the WLST extensions.
And here is a WebLogic question then.
If you configured a Managed Server's classpath to include the Jython
2.5.1 jar, would it use that jython for admin tasks (such as
deployment) or would the jython 2.2.1 be used because the jython would
be executed by the admin server process?

I made the configuration change where I removed all the Jython 2.5.1
references I had made on the Admin server and then created a Managed
server and in the classpath added the Jython jar for 2.5.1 and I got
the same recursion error for modjy.

Bill

On Jan 26, 12:04 pm, Allan Davis <javaal...@gmail.com> wrote:
> You can download JDeveloper or Weblogic server from oracle

> (otn.oracle.com).  The Development version is free.  It will run on


> any java platform
> including OSX.
>
> Thanks,
> --------------------------------------------------------------
> Allan Davis

> Member of NetBeans Dream Teamhttp://wiki.netbeans.org/NetBeansDreamTeam
> Lead Developer, nbPythonhttp://wiki.netbeans.org/Pythonhttp://codesnakes.blogspot.com(my blog)

> Co-Chair, CajunJUGhttp://www.cajunjug.org


>
> On Tue, Jan 26, 2010 at 10:02 AM, Leo Soto M. <leo.s...@gmail.com> wrote:
>
> > Is there any evaluation versions of WL (ideally the same version you
> > are using) out there for OSX? I might be able to set some time apart
> > to look into the problem.
>

> > On Tue, Jan 26, 2010 at 10:32 AM, Allan Davis <javaal...@gmail.com> wrote:
> > > After reviewing the problem.  WLST is the Weblogic extension to jython
> > > 2.2.1.  this does some of the internal functions in weblogic such as
> > > deployment.  When the pre-classpath is set to jython 2.5.1, we are saying
> > to
> > > use the 2.5.1 for everying.  The weblogic extentions that was written for
> > > 2.2.1 does not work.  This is not a bug with jython.  This is a bug with
> > > weblogic.
>
> > >  I have been doing some testing and have had the same results.
>
> > > --------------------------------------------------------------
> > > Allan Davis
> > > Member of NetBeans Dream Team
> > >http://wiki.netbeans.org/NetBeansDreamTeam
> > > Lead Developer, nbPython
> > >http://wiki.netbeans.org/Python

> > >http://codesnakes.blogspot.com(my blog)

> > >> django-jython-...@googlegroups.com<django-jython-dev%2Bunsu...@googlegroups.com>


> > .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/django-jython-dev?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "django-jython-dev" group.
> > > To post to this group, send email to django-j...@googlegroups.com.
> > > To unsubscribe from this group, send email to

> > > django-jython-...@googlegroups.com<django-jython-dev%2Bunsu...@googlegroups.com>


> > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-jython-dev?hl=en.
>
> > --
> > Leo Soto M.
> >http://blog.leosoto.com
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "django-jython-dev" group.
> > To post to this group, send email to django-j...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > django-jython-...@googlegroups.com<django-jython-dev%2Bunsu...@googlegroups.com>

Leo Soto M.

unread,
Jan 26, 2010, 2:11:56 PM1/26/10
to django-j...@googlegroups.com
On Tue, Jan 26, 2010 at 3:19 PM, Bill K <koc...@gmail.com> wrote:
> Allan, I understand what you are saying about the WLST extensions.
> And here is a WebLogic question then.
> If you configured a Managed Server's classpath to include the Jython
> 2.5.1 jar, would it use that jython for admin tasks (such as
> deployment) or would the jython 2.2.1 be used because the jython would
> be executed by the admin server process?
>
> I made the configuration change where I removed all the Jython 2.5.1
> references I had made on the Admin server and then created a Managed
> server and in the classpath added the Jython jar for 2.5.1 and I got
> the same recursion error for modjy.

I bet the modjy error is actually a corner-case bug on Jython itself.
The traceback is too similar (if not the same) as the one reported on
the bug 1489: http://bugs.jython.org/issue1489

Bill K

unread,
Feb 2, 2010, 2:36:48 PM2/2/10
to django-jython-dev
I downloaded the latest django-jython via svn from
http://django-jython.googlecode.com/svn/trunk/ django-jython-read-only
and recreated my WAR file. But I received this same modjy error:

####<Feb 2, 2010 2:12:14 PM EST> <Error> <Deployer> <myserver.com>
<MyManagedServer-2> <[ACTIVE] ExecuteThread: '0' for queue:
'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <>
<1265137934425> <BEA-149265> <Failure occurred in the execution of
deployment request with ID '1265137917073' for task '3'. Error is:
'weblogic.application.ModuleException: [HTTP:101216]Servlet: "modjy"
failed to preload on startup in Web application: "mywar.war".


Traceback (most recent call last):

File "<string>", line 1, in <module>
ImportError: No module named modjy

'
weblogic.application.ModuleException: [HTTP:101217]Servlet: "modjy"
failed to preload on startup in Web application: "mywar.war".


Traceback (most recent call last):

File "<string>", line 1, in <module>
ImportError: No module named modjy

I tested it with and without a weblogic.xml file containg the
following information:

<?xml version="1.0" encoding="ISO-8859-1"?>

<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-
app">


<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>

Since this is what I was getting prior to correcting the CLASSPATH
issue stated above.
I attempted to deploy the WAR file on a managed node and put the
following in the CLASSPATH of the Server Start configuration:
/usr/share/jython2.5.1/jython.jar:/u01/app/bea/wlserver_10.3/server/
lib/weblogic_sp.jar:/u01/app/bea/wlserver_10.3/server/lib/weblogic.jar

And I received the recursion error once again:


Traceback (most recent call last):
File "/usr/share/jython2.5.1/Lib/modjy/modjy.py", line 43, in
__init__
HttpServlet.__init__(self)
RuntimeError: maximum recursion depth exceeded

Bill

Bill K

unread,
Feb 2, 2010, 4:02:05 PM2/2/10
to django-jython-dev
I am going to update my jython as well per Leo's suggestion.
It will be tomorrow when I am able to retest.

Bill

Bill K

unread,
Feb 3, 2010, 10:49:08 AM2/3/10
to django-jython-dev
I updated my jython using the trunk from the SVN.
And received the following error

<Feb 3, 2010 10:44:54 AM EST> <Error> <Console> <BEA-240003> <Console
encountered the following error weblogic.application.ModuleException:


[HTTP:101216]Servlet: "modjy" failed to preload on startup in Web

application: "wlstdj.war".
java.lang.NullPointerException
at org.python.core.PySystemState.<init>(PySystemState.java:
152)
at com.xhaus.modjy.ModjyJServlet.init(ModjyJServlet.java:107)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at weblogic.servlet.internal.StubSecurityHelper
$ServletInitAction.run(StubSecurityHelper.java:283)

This is getting deployed on a managed node, so I have configured the
CLASSPATH as such:

/usr/share/jython-dev/jython-dev.jar:/u01/app/bea/wlserver_10.3/server/
lib/weblogic_sp.jar:/u01/app/bea/wlserver_10.3/server/lib/weblogic.jar

Thanks for all the help.

Bill

Reply all
Reply to author
Forward
0 new messages