De: "jython-users-request@lists.sourceforge.net" <jython-users-request@lists.sourceforge.net>
Para: jython-users@lists.sourceforge.net
Enviado: miť,30 marzo, 2011 01:27
Asunto: Jython-users Digest, Vol 58, Issue 5

Send Jython-users mailing list submissions to
    jython-users@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
    https://lists.sourceforge.net/lists/listinfo/jython-users
or, via email, send a message with subject or body 'help' to
    jython-users-request@lists.sourceforge.net

You can reach the person managing the list at
    jython-users-owner@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Jython-users digest..."


Today's Topics:

  1. Re: plyjy import error (Pierre Thibault)
  2. Python file like objects and Java streams (Vasil Vangelovski)
  3. Re: Python file like objects and Java streams (Pierre Thibault)
  4. Re: Using Jython 2.5.2 with Hadoop (Greg Benson)
  5. Re: Using Jython 2.5.2 with Hadoop (Pierre Thibault)


----------------------------------------------------------------------

Message: 1
Date: Sun, 27 Mar 2011 18:37:26 -0400
From: Pierre Thibault <pierre.thibault1@gmail.com>
Subject: Re: [Jython-users] plyjy import error
To: jython-users@lists.sourceforge.net
Message-ID:
    <AANLkTikW5DDeFTgO2r8grg_bFuNiAz4vx2mSO1-PR5i_@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

2011/3/25 Josh Juneau <juneau001@gmail.com>

> Prasanna-
>
> Sorry to hear that you are running into troubles using Jython from within a
> Java application.  It is difficult to diagnose the issue without seeing the
> code for your Java class, the interface, and the Jython class that you are
> having issues with.  However, at first glance this does not appear to be an
> object factory (PlyJy) issue.
> --
>


I don't know what is wrong with this mailing list but people asking for help
are giving so little information. It is really hard to help.

So don't be afraid to be explicit. Tell us the context and how to reproduce
the problem. This will help a lot.

A+

-------------
Pierre
My blog (http://pierrethibault.posterous.com)<http://pierrethibault.posterous.com>
YouTube page (http://www.youtube.com/user/tubetib)<http://www.youtube.com/user/tubetib>
Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2>
Google profile (http://www.google.com/profiles/pierre.thibault1)<http://www.google.com/profiles/pierre.thibault1>
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Tue, 29 Mar 2011 21:51:26 +0200
From: Vasil Vangelovski <vvangelovski@gmail.com>
Subject: [Jython-users] Python file like objects and Java streams
To: jython-users@lists.sourceforge.net
Message-ID: <4D92383E.8010205@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi

I'm working on a django project on Jython. I have the following problem.
I'm using jasper reports to generate a PDF report.

I write the PDF stream to a    java.io.ByteArrayOutputStream() . My
question is How do I write this output to the django HttpResponse
object. Converting the output stream to
byte array and then string then writing the string to the response won't
work.

Thanks




------------------------------

Message: 3
Date: Tue, 29 Mar 2011 18:59:28 -0400
From: Pierre Thibault <pierre.thibault1@gmail.com>
Subject: Re: [Jython-users] Python file like objects and Java streams
To: jython-users@lists.sourceforge.net
Message-ID:
    <AANLkTin-d_BM+TGX6_hUOePVrC2XqBBzQqs5_eecLFHd@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hello,

I guess you can create a Java string with String(byteArray,
java.nio.charset.Charset.forName("ISO-8859-1")) and write that string. With
this character set, all byte values are mapped to some characters.

Don't forget to set the mime type.

2011/3/29 Vasil Vangelovski <vvangelovski@gmail.com>

> Hi
>
> I'm working on a django project on Jython. I have the following problem.
> I'm using jasper reports to generate a PDF report.
>
> I write the PDF stream to a    java.io.ByteArrayOutputStream() . My
> question is How do I write this output to the django HttpResponse
> object. Converting the output stream to
> byte array and then string then writing the string to the response won't
> work.
>
> Thanks
>
>
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Jython-users mailing list
> Jython-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users
>



--


A+

-------------
Pierre
My blog and profile
(http://pierrethibault.posterous.com)<http://pierrethibault.posterous.com>
YouTube page (http://www.youtube.com/user/tubetib)<http://www.youtube.com/user/tubetib>
Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2>
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 4
Date: Tue, 29 Mar 2011 16:19:50 -0700
From: Greg Benson <benson@usfca.edu>
Subject: Re: [Jython-users] Using Jython 2.5.2 with Hadoop
To: Pierre Thibault <pierre.thibault1@gmail.com>
Cc: jython-users@lists.sourceforge.net
Message-ID: <C60AE162-5E6B-4D65-81E9-39E8DBD58F26@usfca.edu>
Content-Type: text/plain; charset="us-ascii"

I suppose this might work.

However, won't I need to have the constructors in the Java class wrappers create a Jython instance in order to load and execute the Python classes?

I was hoping to not have two layers.

Greg

On Mar 27, 2011, at 3:31 PM, Pierre Thibault wrote:

> I guess you can create Java class wrappers for your Python classes. This way, Hadoop will see them like any other Java classes in your jar. How this sounds?
>
> 2011/3/24 Greg Benson <benson@usfca.edu>
> Hi All,
>
> I'm new to Jython.
>
> I'm interested in using Jython 2.5.2 with Hadoop.
>
> My understanding is that the old Jython example that comes with the Hadoop source code no longer works because it relies on jythonc to generate Java classes.
>
> I've studied the object factories approach to allowing Java to access Jython classes.  However, don't immediately see how to make this work in the context of Hadoop.  It seems to me that Hadoop needs to be able to access your map and reduce classes from a Jar.  If I include a jython (.py) script in the jar, I don't see how to force Hadoop to run the scripts so that the classes will be available to the Hadoop runtime system (even if I use the object factory approach).  Hadoop just expects to be able to access classes that you specify in a job configuration.  I believe this is why the jythonc approach worked.
>
> I'm aware of Happy (http://code.google.com/p/happy/) and Hadoop Streaming.  However, I'm hoping to use Jython in a more native fashion with Hadoop.
>
> Thanks,
>
> Greg
>
>
>
>
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Jython-users mailing list
> Jython-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users
>
>
>
> --
>
>
> A+
>
> -------------
> Pierre
> My blog (http://pierrethibault.posterous.com)
> YouTube page (http://www.youtube.com/user/tubetib)
> Twitter (http://twitter.com/pierreth2)
> Google profile (http://www.google.com/profiles/pierre.thibault1)
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar_______________________________________________
> Jython-users mailing list
> Jython-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 5
Date: Tue, 29 Mar 2011 19:27:03 -0400
From: Pierre Thibault <pierre.thibault1@gmail.com>
Subject: Re: [Jython-users] Using Jython 2.5.2 with Hadoop
To: jython-users@lists.sourceforge.net
Message-ID:
    <AANLkTimkyxZvvLGyUKw_UL4eZDjb4bZ6uY+oJYTMuP4b@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Yes, this is the sad part but it is better than nothing and I don't have any
better to offer at the moment.

I guess that if you many classes to wrap, you can create a code generator in
Python but this is another project.

2011/3/29 Greg Benson <benson@usfca.edu>

> I suppose this might work.
>
> However, won't I need to have the constructors in the Java class wrappers
> create a Jython instance in order to load and execute the Python classes?
>
> I was hoping to not have two layers.
>
> Greg
>
> On Mar 27, 2011, at 3:31 PM, Pierre Thibault wrote:
>
> I guess you can create Java class wrappers for your Python classes. This
> way, Hadoop will see them like any other Java classes in your jar. How this
> sounds?
>
> 2011/3/24 Greg Benson <benson@usfca.edu>
>
>> Hi All,
>>
>> I'm new to Jython.
>>
>> I'm interested in using Jython 2.5.2 with Hadoop.
>>
>> My understanding is that the old Jython example that comes with the Hadoop
>> source code no longer works because it relies on jythonc to generate Java
>> classes.
>>
>> I've studied the object factories approach to allowing Java to access
>> Jython classes.  However, don't immediately see how to make this work in the
>> context of Hadoop.  It seems to me that Hadoop needs to be able to access
>> your map and reduce classes from a Jar.  If I include a jython (.py) script
>> in the jar, I don't see how to force Hadoop to run the scripts so that the
>> classes will be available to the Hadoop runtime system (even if I use the
>> object factory approach).  Hadoop just expects to be able to access classes
>> that you specify in a job configuration.  I believe this is why the jythonc
>> approach worked.
>>
>> I'm aware of Happy (http://code.google.com/p/happy/) and Hadoop
>> Streaming.  However, I'm hoping to use Jython in a more native fashion with
>> Hadoop.
>>
>> Thanks,
>>
>> Greg
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Enable your software for Intel(R) Active Management Technology to meet the
>> growing manageability and security demands of your customers. Businesses
>> are taking advantage of Intel(R) vPro (TM) technology - will your software
>> be a part of the solution? Download the Intel(R) Manageability Checker
>> today! http://p.sf.net/sfu/intel-dev2devmar
>> _______________________________________________
>> Jython-users mailing list
>> Jython-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jython-users
>>
>
>
>
> --
>
>
> A+
>
> -------------
> Pierre
> My blog (http://pierrethibault.posterous.com)<http://pierrethibault.posterous.com/>
> YouTube page (http://www.youtube.com/user/tubetib)<http://www.youtube.com/user/tubetib>
> Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2>
> Google profile (http://www.google.com/profiles/pierre.thibault1)<http://www.google.com/profiles/pierre.thibault1>
>
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today!
> http://p.sf.net/sfu/intel-dev2devmar_______________________________________________
> Jython-users mailing list
> Jython-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users
>
>
>


--


A+

-------------
Pierre
My blog and profile
(http://pierrethibault.posterous.com)<http://pierrethibault.posterous.com>
YouTube page (http://www.youtube.com/user/tubetib)<http://www.youtube.com/user/tubetib>
Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2>
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar

------------------------------

_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users


End of Jython-users Digest, Vol 58, Issue 5
*******************************************