Page 1 of 3 123 LastLast
Results 1 to 16 of 39

Thread: Do we have any J2EE gurus on the forums?

  1. #1
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts

    Do we have any J2EE gurus on the forums?

    Hey guys and gals,
    I am having some problems with a j2ee application I am creating and I was wondering whether there are any guru's on the forums?

    Thanks in advance,
    Leon

  2. #2
    DsW
    DsW is offline
    Senior Member
    Join Date
    Aug 2003
    Location
    Glasgow
    Posts
    292
    Thanks
    0
    Thanked
    0 times in 0 posts
    There are several people on here with Java and J2EE experience - including me.

    Post your problem...

    cheers,
    dave

  3. #3
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    Let's see what's troubling you and maybe someone can help.
    To err is human. To really foul things up ... you need a computer.

  4. #4
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts
    Cool nice one guys:

    Right I have two beans, route and delivery request. There is a relationship between them to say a delivery request has many routes. This deploys fine. However I am using asant run-client together with code used to test the beans without sitting them in a jsp/serlet.

    However when I run the command I get the following error:

    Buildfile: C:\Documents and Settings\Leon Allen\My Documents\Parcel_Tracking\build.xml
    run-client:
    [java] java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    [java] java.rmi.RemoteException: Bean class for ejb [DeliveryRequestBean] does not define a method corresponding to [Home] interface method [public abstract model.DeliveryRequest model.DeliveryRequestHome.create(model.DeliveryRequestDTO) throws java.rmi.RemoteException,javax.ejb.CreateException]
    [java] at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:170)
    [java] at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
    [java] at model._DeliveryRequestHome_Stub.create(Unknown Source)
    [java] at client.RouteClient.exerciseBusinessMethods(RouteClient.java:97)
    [java] at client.RouteClient.main(RouteClient.java:35)
    [java] Caused by: java.rmi.RemoteException: Bean class for ejb [DeliveryRequestBean] does not define a method corresponding to [Home] interface method [public abstract model.DeliveryRequest model.DeliveryRequestHome.create(model.DeliveryRequestDTO) throws java.rmi.RemoteException,javax.ejb.CreateException]
    [java] at com.sun.ejb.containers.EJBHomeInvocationHandler.invoke(EJBHomeInvocationHandler.java:128)
    [java] at $Proxy42.create(Unknown Source)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at java.lang.reflect.Method.invoke(Method.java:585)
    [java] at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:117)
    [java] at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequest DispatcherImpl.java:651)
    [java] at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatche rImpl.java:190)
    [java] at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImp l.java:1653)
    [java] at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java: 1513)
    [java] at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:89 5)
    [java] at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:17 2)
    [java] at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java: 668)
    [java] at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl .java:375)
    [java] at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.jav a:284)
    [java] at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73)
    [java] at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:382)
    BUILD SUCCESSFUL
    Total time: 3 seconds
    I know that the problem is in the parcel request bean because my test code works without the call to DeliveryRequest newDR = drHome.create(dr);.

    Any ideas?

    Thanks for any help,
    Leon

  5. #5
    DsW
    DsW is offline
    Senior Member
    Join Date
    Aug 2003
    Location
    Glasgow
    Posts
    292
    Thanks
    0
    Thanked
    0 times in 0 posts
    Does your bean class have the corresponding ejbCreate(DeliveryRequestDTO) and ejbPostCreate(DeliveryRequestDTO) methods?

    cheers,
    dave

  6. #6
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    A server runtime exception perhaps? Could the delivery requets bean not 'like' asant? A server runtime exception would happen if you didnt have the right delivery requests.
    To err is human. To really foul things up ... you need a computer.

  7. #7
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts
    Wilkied - thanks for that, I did have the methods but I was specifying that it took the other class not DeliveryRequestDTO. So thanks!

    However got another one now (sorry about this!)

    run-client:
    [java] java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    [java] java.rmi.RemoteException: nested exception is: javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/routeBean; nested exception is:
    [java] javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/routeBean
    [java] at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:170)
    [java] at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
    [java] at model._DeliveryRequestHome_Stub.create(Unknown Source)
    [java] at client.RouteClient.exerciseBusinessMethods(RouteClient.java:97)
    [java] at client.RouteClient.main(RouteClient.java:35)
    [java] Caused by: java.rmi.RemoteException: nested exception is: javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/routeBean; nested exception is:
    [java] javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/routeBean
    [java] at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.java:213)
    [java] at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:797)
    [java] at com.sun.ejb.containers.EJBHomeInvocationHandler.invoke(EJBHomeInvocationHandler.java:194)
    [java] at $Proxy58.create(Unknown Source)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at java.lang.reflect.Method.invoke(Method.java:585)
    [java] at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:117)
    [java] at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequest DispatcherImpl.java:651)
    [java] at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatche rImpl.java:190)
    [java] at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImp l.java:1653)
    [java] at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java: 1513)
    [java] at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:89 5)
    [java] at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:17 2)
    [java] at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java: 668)
    [java] at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl .java:375)
    [java] at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.jav a:284)
    [java] at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73)
    [java] at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:382)
    [java] Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/routeBean
    [java] at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:665)
    [java] at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:108)
    [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
    [java] at model.DeliveryRequestBean.establi****emHome(DeliveryRequestBean.java:458)
    [java] at model.DeliveryRequestBean.ejbCreate(DeliveryRequestBean.java:291)
    [java] at model.DeliveryRequestBean_586119849_ConcreteImpl.ejbCreate(DeliveryRequestBean_586119849_ConcreteImp l.java:654)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at java.lang.reflect.Method.invoke(Method.java:585)
    [java] at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:146)
    [java] at java.security.AccessController.doPrivileged(Native Method)
    [java] at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:93 0)
    [java] at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:151)
    [java] at com.sun.ejb.containers.EJBHomeInvocationHandler.invoke(EJBHomeInvocationHandler.java:166)
    [java] ... 17 more
    I have checked the ejb ref's tab for the RouteBean and it is set to be ejb/routeBean. Any ideas?

    Thanks again,
    Leon

  8. #8
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts
    Doh, just realised I was being stupid, had the reference on the wrong bean

    Gotta restart the server now and fingers crossed it may work ....

    Mwuh ha ha (weird manical laughter)

  9. #9
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts
    You fix one problem, and another one pops up

    run-client:
    [java] java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    [java] java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.; nested exception is:
    [java] javax.transaction.RollbackException: Transaction marked for rollback.
    [java] at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:170)
    [java] at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
    [java] at model._DeliveryRequestHome_Stub.create(Unknown Source)
    [java] at client.RouteClient.exerciseBusinessMethods(RouteClient.java:97)
    [java] at client.RouteClient.main(RouteClient.java:35)
    [java] Caused by: java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.; nested exception is:
    [java] javax.transaction.RollbackException: Transaction marked for rollback.
    [java] at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.java:213)
    [java] at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:797)....
    Any ideas on this one?

    Sorry about this barrage of questions,
    Leon

  10. #10
    Goat Boy
    Join Date
    Jul 2003
    Location
    Alexandra Park, London
    Posts
    2,428
    Thanks
    0
    Thanked
    0 times in 0 posts
    That one is probably a little hard to decipher without the code to hand. What application server are you using out of interest? Are you handling your own transactional model or is the container doing it?
    "All our beliefs are being challenged now, and rightfully so, they're stupid." - Bill Hicks

  11. #11
    Don't feed the trolls... tiggerai's Avatar
    Join Date
    Aug 2003
    Location
    Milk & Beans
    Posts
    9,286
    Thanks
    271
    Thanked
    479 times in 313 posts
    • tiggerai's system
      • Motherboard:
      • Gigabyte MA770T-UD3P
      • CPU:
      • AMD PhenomII 955BE
      • Memory:
      • 4Gb Corsair XMS DDR3
      • Storage:
      • Lots
      • Graphics card(s):
      • Sapphire X1950XT
      • PSU:
      • Hiper Type-R 550w
      • Case:
      • Antec lovely black thing
      • Operating System:
      • Windows 7
      • Monitor(s):
      • 2x 20" widescreen
      • Internet:
      • Pipexpants
    THAT is sooooo cheating.

    How did i know it would be leon, without even looking?! he he he

  12. #12
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts
    Rai: How is this cheating? I'm not asking them to do my assignment just help me with teething problems

    DaBeeenster: I'm using the sun application server with container managed persitance.

  13. #13
    Don't feed the trolls... tiggerai's Avatar
    Join Date
    Aug 2003
    Location
    Milk & Beans
    Posts
    9,286
    Thanks
    271
    Thanked
    479 times in 313 posts
    • tiggerai's system
      • Motherboard:
      • Gigabyte MA770T-UD3P
      • CPU:
      • AMD PhenomII 955BE
      • Memory:
      • 4Gb Corsair XMS DDR3
      • Storage:
      • Lots
      • Graphics card(s):
      • Sapphire X1950XT
      • PSU:
      • Hiper Type-R 550w
      • Case:
      • Antec lovely black thing
      • Operating System:
      • Windows 7
      • Monitor(s):
      • 2x 20" widescreen
      • Internet:
      • Pipexpants
    I was joking hun, you know what i'm like... CHILLL OUT!

    gimme a few days, and i'll be on here racking their brains!

  14. #14
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts
    Wahooo think it works, time to backup That's for all the help guys.

    I'm sure I will be back later with more questions.

    Thanks again.

  15. #15
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts
    Right guys I have another question (sorry ). If I use a jsp page to access a bean e.g.

    Code:
    <%--
    * Allowing customers to choose how they want the parcel to be sent 
    --%>
    
    <%@ page language="java" %>
    <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
    
    
    <%@ page import="model.DeliveryRequest, model.DeliveryRequestHome, model.DeliveryRequestDTO, javax.ejb.*, java.math.*, javax.naming.*, javax.rmi.PortableRemoteObject, java.rmi.RemoteException" %>
    <%!
       private DeliveryRequest dRequest = null;
       
       public void jspInit() 
       {   
       }
       
       public void jspDestroy() 
       {
          dRequest = null;    
       }
    
    %>
    
    <html>
    
    <head><link rel="stylesheet" type="text/css" href="pts_style.css"/></head>
    
    <body>
    <center><h3>Delivery Request Testing</h3></center>
    <p>
    <%
       String fullname = request.getParameter("fullname");
       String pack_weight = request.getParameter("pack_weight");
       String coll_address1 = request.getParameter("coll_address1");
       String coll_address2 = request.getParameter("coll_address2");
       String coll_towncity = request.getParameter("coll_towncity");
       String coll_postcode = request.getParameter("coll_postcode");
       String coll_country = request.getParameter("coll_country");
       String dest_address1 = request.getParameter("dest_address1");
       String dest_address2 = request.getParameter("dest_address2");
       String dest_towncity= request.getParameter("dest_towncity");
       String dest_postcode = request.getParameter("dest_postcode");
       String dest_country = request.getParameter("dest_country");
    %>
    
    <%
      try {
             InitialContext ic = new InitialContext();
             Object objRef = ic.lookup("java:comp/env/ejb/TheDelivery");
             DeliveryRequestHome drHome = (DeliveryRequestHome)PortableRemoteObject.narrow(objRef, DeliveryRequestHome.class);
             DeliveryRequestDTO newDR = new DeliveryRequestDTO("1235",fullname,pack_weight,coll_address1,coll_address2,coll_towncity,coll_postcode,coll_country,dest_address1,dest_address2,dest_towncity,dest_postcode,dest_country); 
             dRequest = drHome.create(newDR);
                      
          } catch (RemoteException ex) {
                System.out.println("Couldn't create delivery request bean."+ ex.getMessage());
          } catch (CreateException ex) {
                System.out.println("Couldn't create delivery request bean."+ ex.getMessage());
          } catch (NamingException ex) {
                System.out.println("Unable to lookup home: "+ "TheDelivery "+ ex.getMessage());
          }
    %>
    
    
    </body>
    </html>
    This will input a row into my database table but it is always the same row. i.e. when I reload the page it overwrites the row I have just inputed.

    Can anyone tell me how to fix this?

    Thanks again,
    Leon

  16. #16
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    When you reload the page? Are you certain it's just not the same record that was inserted before, that it is not being overwritten?
    To err is human. To really foul things up ... you need a computer.

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. The new forums...
    By Aaron in forum HEXUS Suggestions
    Replies: 16
    Last Post: 27-05-2004, 06:25 PM
  2. excluding forums in searches
    By petrefax in forum HEXUS Suggestions
    Replies: 2
    Last Post: 04-05-2004, 09:06 AM
  3. p4 forums anyone
    By Planetside in forum General Discussion
    Replies: 6
    Last Post: 26-12-2003, 04:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •