Well, that fixed my problem on the User end, but I'm still geting the same error
on the Playlist end as:

Exception in thread "main" java.rmi.ServerException: RemoteException occurred in
 server thread; nested exception is:
    java.rmi.ServerException: Internal error getting results for field member us
erId
Embedded Exception
Unable to load to deserialize result: java.io.StreamCorruptedException: invalid 
stream header; nested exception is:
    javax.ejb.EJBException: Internal error getting results for field member user
Id
Embedded Exception
Unable to load to deserialize result: java.io.StreamCorruptedException: invalid 
stream header
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
...snip...

Which field member?  Which object?  I'm lost?


I changed my relationship to: 
(changed multiplicity on role PlaylistBean to "Many")

<relationships>
    <ejb-relation>
        <ejb-relation-name>PlaylistBean-UserBean</ejb-relation-name>
        <ejb-relationship-role>
            <ejb-relationship-role-name>PlaylistBean</ejb-relationship-role-name
>
            <multiplicity>Many</multiplicity>
            <relationship-role-source>
                <ejb-name>PlaylistBean</ejb-name>
            </relationship-role-source>
            <cmr-field>
                <cmr-field-name>user</cmr-field-name>
            </cmr-field>
        </ejb-relationship-role>
        <ejb-relationship-role>
            <ejb-relationship-role-name>UserBean</ejb-relationship-role-name>
            <multiplicity>One</multiplicity>
            <relationship-role-source>
                <ejb-name>UserBean</ejb-name>
            </relationship-role-source>
        </ejb-relationship-role>
    </ejb-relation>
</relationships>


-- 
-bk


Quoting Brandon Knitter <[EMAIL PROTECTED]>:

> I did notice one other thing.  When I try to get a User, I am running into
> a
> problem there the server is saying:
> 
> Exception in thread "main" java.rmi.ServerException: RemoteException occurred
> in
>  server thread; nested exception is:
>     java.rmi.ServerException: Load failed
> Embedded Exception
> ERROR:  Attribute 'playlistbean_user' not found
> ; nested exception is:
>     javax.ejb.EJBException: Load failed
> Embedded Exception
> ERROR:  Attribute 'playlistbean_user' not found
> 
> I don't know why when trying to get a user on it's own that is happening, but
> I
> actually don't want that.  I want to be able to instantiate Users on their
> own
> and not have a guaranteed relationship to a Playlist.
> 
> When I take the "<relationships>" section out of the ejb-jar.xml and
> jbosscmp-jdbc.xml files the User works again.  Did I do something wrong here.
>  
> 
> Actually the relationship is not really one-to-one now that I think about it.
> 
> It's actually:
> 
>   Playlist  to  User
>   ------------------
>    many     to  one
>    none     to  one
> 
> Meaning that a User can have 0+ Playlists.  How is that represented?  I'll
> keep
> playing!
> 
> -- 
> -bk
> 
> 
> Quoting Brandon Knitter <[EMAIL PROTECTED]>:
> 
> > Well, I'm on with my learning and now running into another problem.  I've
> > been
> > racking my head for 3 hours now and have opened up the source examples I
> > got
> > with the book from JBoss, and I'm just stuck.
> > 
> > 1) Is there a way to turn on really high debugging on the server so that
> I
> > can
> > see what's going on during this EJB's run?  I'm getting errors on the
> > remote
> > client that aren't as helpful as the ones I might get from the EJB
> > Container.
> > 
> > 2) Here's my error I'm getting when I try to ask for a data element view:
> > 
> > Exception in thread "main" java.rmi.ServerException: RemoteException
> occurred
> > in
> > server thread; nested exception is: 
> >         java.rmi.ServerException: Internal error getting results for
> field
> > member userId
> > Embedded Exception
> > Unable to load to deserialize result: java.io.StreamCorruptedException:
> > invalid
> > stream header; nested exception is: 
> >         javax.ejb.EJBException: Internal error getting results for field
> > member
> > userId
> > Embedded Exception
> > Unable to load to deserialize result: java.io.StreamCorruptedException:
> > invalid
> > stream header
> >         at
> > sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
> > 
> > 
> > Let me know what I screwed up now.  I know I'm close! :)
> > 
> > I've looked through all the examples and I know I'm close.  Just for some
> > background, I am only trying to get the User for a Playlist (one-to-one),
> > so
> > it's really nothing special.  I followed the cmp-example from the docs
> > subscription, as well as followed my Wrox Pro EJB book.
> > 
> > If you need anything else, please let me know!
> > 
> > ejb-jar.xml and jbosscmp-jdbc.xml follow:
> > 
> > == BEG ejb-jar.xml ==
> > <?xml version="1.0"?>
> > 
> > <!DOCTYPE ejb-jar PUBLIC
> >     "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
> >     "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd";>
> > 
> > <ejb-jar>
> > 
> > <enterprise-beans>
> >   <entity>
> >     <ejb-name>PlaylistBean</ejb-name>
> > 
> >     <!-- remote stuff -->
> >     <home>org.blandsite.music.play.PlaylistHome</home>
> >     <remote>org.blandsite.music.play.Playlist</remote>
> > 
> >     <!-- Local stuff -->
> >     <local-home>org.blandsite.music.play.PlaylistLocalHome</local-home>
> >     <local>org.blandsite.music.play.PlaylistLocal</local>
> > 
> >     <ejb-class>org.blandsite.music.play.PlaylistBean</ejb-class>
> > 
> >     <prim-key-class>java.lang.Integer</prim-key-class>
> >     <primkey-field>playlistId</primkey-field>
> > 
> >     <persistence-type>Container</persistence-type>
> >     <reentrant>True</reentrant>
> > 
> >     <cmp-version>2.x</cmp-version>
> > 
> >     <abstract-schema-name>playlists</abstract-schema-name>
> > 
> > 
> >     <cmp-field><field-name>playlistId</field-name></cmp-field>
> >     <cmp-field><field-name>userId</field-name></cmp-field>
> >     <cmp-field><field-name>name</field-name></cmp-field>
> > 
> >     <ejb-local-ref>
> >         <ejb-ref-name>comp/env/ejb/UserLocal</ejb-ref-name>
> >         <ejb-ref-type>Entity</ejb-ref-type>
> >         <local-home>org.blandsite.music.user.UserLocalHome</local-home>
> >         <local>org.blandsite.music.user.UserLocal</local>
> >         <ejb-link>UserBean</ejb-link>
> >     </ejb-local-ref>
> >     <ejb-ref>
> >         <ejb-ref-name>comp/env/ejb/User</ejb-ref-name>
> >         <ejb-ref-type>Entity</ejb-ref-type>
> >         <home>org.blandsite.music.user.UserHome</home>
> >         <remote>org.blandsite.music.user.User</remote>
> >         <ejb-link>UserBean</ejb-link>
> >     </ejb-ref>
> > 
> >   </entity>
> >   <entity>
> >     <ejb-name>UserBean</ejb-name>
> > 
> >     <!-- remote stuff -->
> >     <home>org.blandsite.music.user.UserHome</home>
> >     <remote>org.blandsite.music.user.User</remote>
> > 
> >     <!-- Local stuff -->
> >     <local-home>org.blandsite.music.user.UserLocalHome</local-home>
> >     <local>org.blandsite.music.user.UserLocal</local>
> > 
> >     <ejb-class>org.blandsite.music.user.UserBean</ejb-class>
> > 
> >     <prim-key-class>java.lang.Integer</prim-key-class>
> >     <primkey-field>userId</primkey-field>
> > 
> >     <persistence-type>Container</persistence-type>
> >     <reentrant>True</reentrant>
> > 
> >     <cmp-version>2.x</cmp-version>
> > 
> >     <abstract-schema-name>users</abstract-schema-name>
> > 
> > 
> >     <cmp-field><field-name>userId</field-name></cmp-field>
> >     <cmp-field><field-name>username</field-name></cmp-field>
> >     <cmp-field><field-name>password</field-name></cmp-field>
> >     <cmp-field><field-name>firstname</field-name></cmp-field>
> >     <cmp-field><field-name>lastname</field-name></cmp-field>
> >     <cmp-field><field-name>emailAddress</field-name></cmp-field>
> >     <cmp-field><field-name>bitrate</field-name></cmp-field>
> >     <cmp-field><field-name>playlink</field-name></cmp-field>
> >   
> >   </entity>
> > </enterprise-beans>
> > 
> > <relationships>
> >     <ejb-relation>
> >         <ejb-relation-name>PlaylistBean-UserBean</ejb-relation-name>
> >         <ejb-relationship-role>
> >             <ejb-relationship-role-name>
> >                 PlaylistBean
> >             </ejb-relationship-role-name>
> >             <multiplicity>One</multiplicity>
> >             <relationship-role-source>
> >                 <ejb-name>PlaylistBean</ejb-name>
> >             </relationship-role-source>
> >             <cmr-field>
> >                 <cmr-field-name>user</cmr-field-name>
> >             </cmr-field>
> >         </ejb-relationship-role>
> >         <ejb-relationship-role>
> >            
> > <ejb-relationship-role-name>UserBean</ejb-relationship-role-name>
> >             <multiplicity>One</multiplicity>
> >             <relationship-role-source>
> >                 <ejb-name>UserBean</ejb-name>
> >             </relationship-role-source>
> >         </ejb-relationship-role>
> >     </ejb-relation>
> > </relationships>
> > 
> > <assembly-descriptor>
> >     <container-transation>
> >         <method >
> >             <ejb-name>PlaylistBean</ejb-name>
> >             <method-name>*</method-name>
> >         </method>
> >         <method >
> >             <ejb-name>UserBean</ejb-name>
> >             <method-name>*</method-name>
> >         </method>
> >         <trans-attribute>Required</trans-attribute>
> >     </container-transation>
> > </assembly-descriptor>
> > 
> > </ejb-jar>
> > == END ejb-jar.xml ==
> > 
> > == BEG jbosscmp-jdbc.xml ==
> > <jbosscmp-jdbc>
> >     <enterprise-beans>
> >         <entity>
> >             <ejb-name>PlaylistBean</ejb-name>
> >             <table-name>playlists</table-name>
> >             <datasource>java:/JukeboxDS</datasource>
> >             <type-mapping>PostgreSQL</type-mapping>
> >             <debug>true</debug>
> >             <create-table>false</create-table>
> >             <remove-table>false</remove-table>
> >             <read-only>false</read-only>
> >             <time-out>300</time-out>
> >             <select-for-update>false</select-for-update>
> >             <pk-constraint>false</pk-constraint>
> > 
> >             <cmp-field>
> >                 <field-name>playlistId</field-name>
> >                 <column-name>playlist_id</column-name>
> >             </cmp-field>
> > 
> >             <cmp-field>
> >                 <field-name>userId</field-name>
> >                 <column-name>user_id</column-name>
> >             </cmp-field>
> > 
> >             <cmp-field>
> >                 <field-name>name</field-name>
> >                 <column-name>name</column-name>
> >             </cmp-field>
> > 
> >         </entity>
> > 
> >         <entity>
> >             <ejb-name>UserBean</ejb-name>
> >             <table-name>users</table-name>
> >             <datasource>java:/JukeboxDS</datasource>
> >             <type-mapping>PostgreSQL</type-mapping>
> >             <debug>true</debug>
> >             <create-table>false</create-table>
> >             <remove-table>false</remove-table>
> >             <read-only>false</read-only>
> >             <time-out>300</time-out>
> >             <select-for-update>false</select-for-update>
> >             <pk-constraint>false</pk-constraint>
> > 
> >             <cmp-field>
> >                 <field-name>userId</field-name>
> >                 <column-name>user_id</column-name>
> >             </cmp-field>
> > 
> >             <cmp-field>
> >                 <field-name>username</field-name>
> >                 <column-name>uid</column-name>
> >             </cmp-field>
> > 
> >             <cmp-field>
> >                 <field-name>password</field-name>
> >                 <column-name>pwd</column-name>
> >             </cmp-field>
> > 
> >             <cmp-field>
> >                 <field-name>firstname</field-name>
> >                 <column-name>fn</column-name>
> >             </cmp-field>
> > 
> >             <cmp-field>
> >                 <field-name>lastname</field-name>
> >                 <column-name>ln</column-name>
> >             </cmp-field>
> > 
> >             <cmp-field>
> >                 <field-name>emailAddress</field-name>
> >                 <column-name>email</column-name>
> >             </cmp-field>
> > 
> >             <cmp-field>
> >                 <field-name>bitrate</field-name>
> >                 <column-name>bitrate</column-name>
> >             </cmp-field>
> >             
> >             <cmp-field>
> >                 <field-name>playlink</field-name>
> >                 <column-name>playlink</column-name>
> >             </cmp-field>
> >         
> >         </entity>
> >     </enterprise-beans>
> >     
> >     <relationships>
> >         <ejb-relation>
> >             <ejb-relation-name>PlaylistBean-UserBean</ejb-relation-name>
> >             <foreign-key-mapping>
> >                 <ejb-relationship-role>
> >                     <ejb-relationship-role-name>
> >                         PlaylistBean
> >                     </ejb-relationship-role-name>
> >                     <foreign-key-fields>
> >                         <foreign-key-field>
> >                             <field-name>userId</field-name>
> >                             <column-name>user_id</column-name>
> >                         </foreign-key-field>
> >                     </foreign-key-fields>
> >                 </ejb-relationship-role>
> >                 <ejb-relationship-role>
> >                     <ejb-relationship-role-name>
> >                         UserBean
> >                     </ejb-relationship-role-name>
> >                     <foreign-key-fields/>
> >                 </ejb-relationship-role>
> >             </foreign-key-mapping>
> >         </ejb-relation>
> >     </relationships>
> > </jbosscmp-jdbc>
> > == END jbosscmp-jdbc.xml ==
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > -bk
> > 
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________________________
> > 
> > Don't miss the 2002 Sprint PCS Application Developer's Conference
> > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
> > 
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > 
> > 
> 
> 
> 



_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to