Re: grinder failed to run jmssender.py (No module named weblogic)

Philip Aston <[email protected]> Wed, 18 Mar 2015 20:58:28 +0000
Newsgroups gmane.comp.java.grinder.user
Message-ID <[email protected]>
The sample script is written to use the WebLogic Server client library.

You appear to want to use JBoss? You'll have to do a few things.

First, you need to add the JBoss messaging jars to your classpath. The
jboss-jms-api... jar will only include the API, not the runtime.
https://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/Messaging_on_JBoss-JMS_Examples.html
looks like it has an appropriate list.


Second, you need to modify the script to use JBoss JNDI. See
http://docs.jboss.org/jbossmessaging/docs/usermanual-2.0.0.beta1/html/using-jms.html
for a jndi.properties file. You should add the directory that contains
this file to your classpath. Then you should change the script to
replace these lines:

    from weblogic.jndi import WLInitialContextFactory
     
    # Look up connection factory and queue in JNDI.
    properties = Properties()
    properties[Context.PROVIDER_URL] = "t3://localhost:7001"
    properties[Context.INITIAL_CONTEXT_FACTORY] =
    WLInitialContextFactory.name
     
    initialContext = InitialContext(properties)

with

    initialContext = InitialContext()

By not passing properties to the InitialContext constructor, you're
telling it to read from the jndi.properties file.


Third, you must adjust the JNDI names of the connection factory and the
destination in these lines with whatever you are using on the server:

    |connectionFactory =
    initialContext.lookup("weblogic.examples.jms.QueueConnectionFactory")|
    |queue = initialContext.lookup("weblogic.examples.jms.exampleQueue")|


- Phil

On 18/03/15 20:31, Bill Yang wrote:
>
> Hi,
>
>  
>
> I got failed when I tried to run jmssender.py. It seems there could
> not found the weblogic.jndi module. Please help me to figure out what
> is wrong. Thanks.
>
>  
>
> Directory of C:\Users\byang\grinder\jmssenderstest
>
>  
>
> 03/18/2015  12:59 PM    <DIR>          .
>
> 03/18/2015  12:59 PM    <DIR>          ..
>
> 03/18/2015  12:59 PM    <DIR>          .grinder
>
> 03/18/2015  09:52 AM    <DIR>          billlaptop-file-store
>
> 03/18/2015  12:56 PM             6,986 grinder.properties
>
> 03/18/2015  12:48 PM             1,963 jmssender.py
>
> 03/18/2015  12:57 PM    <DIR>          log
>
> 03/18/2015  09:44 AM                80 setGrinderEnv.bat
>
> 03/18/2015  09:44 AM               124 startAgent.bat
>
> 03/18/2015  09:44 AM               104 startConsole.bat
>
>                5 File(s)          9,257 bytes
>
>                5 Dir(s)  712,526,700,544 bytes free
>
>  
>
> C:\Users\byang\grinder\jmssenderstest>startAgent.bat
>
>  
>
> C:\Users\byang\grinder\jmssenderstest>call
> "C:\Users\byang\grinder\jmssenderstes
>
> t\setGrinderEnv.bat"
>
>  
>
> C:\Users\byang\grinder\jmssenderstest>set
> GRINDERPROPERTIES="C:\Users\byang\grin
>
> der\jmssenderstest\grinder.properties"
>
> …………………………………………
>
> 2015-03-18 12:59:47,362 INFO  agent: waiting for console signal
>
> 2015-03-18 13:00:11,293 INFO  agent: Clearing file store
>
> 2015-03-18 13:00:11,324 INFO  agent: Updating file store:
> "grinder.properties" (
>
> 6986 bytes)
>
> 2015-03-18 13:00:11,324 INFO  agent: Updating file store:
> "jmssender.py" (1963 b
>
> ytes)
>
> 2015-03-18 13:00:11,417 INFO  agent: Updating file store:
> "log\billlaptop-9-data
>
> .log" (0 bytes)
>
> 2015-03-18 13:00:11,417 INFO  agent: Updating file store:
> "log\billlaptop-9.log"
>
> (990 bytes)
>
> 2015-03-18 13:00:12,556 INFO  agent: received a start message
>
> 2015-03-18 13:00:12,619 INFO  agent: Worker process command line: java
> '-javaage
>
> nt:C:\grinder\grinder-3.11\lib\grinder-dcr-agent-3.11.jar'
> '-Dpython.cachedir=/t
>
> mp' -classpath
> 'C:\grinder\grinder-3.11\lib\grinder.jar;C:\Users\byang\.m2\repos
>
> itory\org\jboss\javaee\jboss-jms-api\1.1.0.GA\jboss-jms-api-1.1.0.GA.jar'
> net.gr
>
> inder.engine.process.WorkerProcessEntryPoint
>
> 2015-03-18 13:00:12,634 INFO  agent: worker billlaptop-0 started
>
> 2015-03-18 13:00:13,820 ERROR billlaptop-0: aborting process - Jython
> exception,
>
> <type 'exceptions.ImportError'>: No module named weblogic
> [initialising test sc
>
> ript]
>
> net.grinder.scriptengine.jython.JythonScriptExecutionException: <type
> 'exception
>
> s.ImportError'>: No module named weblogic
>
>         from weblogic.jndi import WLInitialContextFactory
>
>         File
> "C:\Users\byang\grinder\jmssenderstest\.\billlaptop-file-store\curr
>
> ent\jmssender.py", line 18, in <module>
>
> 2015-03-18 13:00:13,851 INFO  agent: finished, waiting for console
> signal rom the samples. The error message as below and please help me
> to figure out the issue.
>
>
>



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use