From: Brian P. C. <bm...@bm...> - 2006-05-23 13:33:28
|
> That's really weird. So the only way you can get a UserDetail from a > PrimaryKey is if you have the PrimaryKey of the UserDetail which you > got from the UserDetail? and PrimaryKey can mean anything! It's a > VARIANT in COM speak. Roll on Tetra! <*>This is an automated response, please do not reply.<*> This program searches for the term "Tetra" and issues the reply: Go Tetra....<DAOSystemException: no statement begin/> bus .<DAOSystemException: no statement middle/> JBI. <*>End of automatic response.<*> <*>End of automatic response.<*> <*>End of automatic res com.sun.appserv.server.ServerLifecycleException: java.rmi.server.ExportException: Listen failed on port: 0; nested exception is: java.net.SocketException: Cannot assign requested address at com.sun.enterprise.admin.server.core.channel.Admin Channel.createRMIChannel(AdminChannel.java:79) at com.sun.enterprise.admin.server.core.AdminChannelL ifecycle.onInitialization(AdminChannelLifecycle.ja va:43) at com.sun.enterprise.server.ss.ASLazyKernel.initiali zeAdminService(ASLazyKernel.java:131) at com.sun.enterprise.server.ss.ASLazyKernel.startASS ocketServices(ASLazyKernel.java:51) at com.sun.enterprise.server.PEMain.run(PEMain.java:2 74) at com.sun.enterprise.server.PEMain.main(PEMain.java: 220) Caused by: java.rmi.server.ExportException: Listen failed on port: 0; nested exception is: java.net.SocketException: Cannot assign requested address at sun.rmi.transport.tcp.TCPTransport.listen(TCPTrans port.java:245) ... 731 more > > Alistair > > > On 22 May 2006, at 21:22, Matthew Buckett wrote: > > > Alistair Young wrote: > >> Before I dive off into bodguts, has anyone seen this before, or > >> any suggestions as to why it happens? > >> UserDetail bodUserDetail = UserDetail.findUserDetail > >> (user.getPrimaryKey()) > >> where user = org.bodington.server.realm.User > > > > Yep this is because UserDetail has it's own primary key and the > > primary key of the refering User. Your asking for the UserDetail > > object with the primary key of the User which doesn't exist. > > > >> always gives a ClassCastException. Is a User.PrimaryKey different > >> from a UserDetail.PrimaryKey? > > > > You get this because the database layer is trying to case a User > > object found by its primary key into a UserDetail object. > > > >> Always have to use sql to get UserDetail from a User. > > > > Yep. UserDetail.findUserDetail("user_id = ?"); Or make a > > findUserDetailByUser which does the SQL behind the scenes. You may > > also want to make user_id an indexkey if performance becomes a > > problem. > > > > -- > > -- Matthew Buckett, VLE Developer > > -- Learning Technologies Group, Oxford University Computing Services > > -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ > > > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, > > security? > > Get stuff done quickly with pre-integrated technology to make your > > job easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > > Geronimo > > http://sel.as-us.falkag.net/sel? > > cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > Bodington-developers mailing list > > Bod...@li... > > https://lists.sourceforge.net/lists/listinfo/bodington-developers > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers > |