兄台!救命呀!

05-05-24 tanjianming
不借助ide,如何把war和ejb的jar打包成ear!

请问都需要改动哪些.xml文件!

我是直接把war 文件和ejb的jar 放在jboss4中的。我的war中的index.jsp调用jar中的ejb时总是出错:

Looking up home interfaces..

ejb not bound

我的index.jsp原文件是:

请哪位兄台帮我一下!

<%@ page contentType="text/html;charset=GBK" %>


<%@ page import="com.titan.processpayment.*"%>
<%@ page import="com.titan.customer.*"%>

<%@ page import="java.util.Properties"%>
<%@ page import="java.util.Calendar"%>
<%@ page import="javax.naming.InitialContext"%>
<%@ page import="javax.naming.Context"%>
<%@ page import="javax.naming.NamingException"%>
<%@ page import="javax.ejb.*"%>
<%@ page import="javax.rmi.PortableRemoteObject"%>
<%@ page import="java.rmi.RemoteException"%>


<%

         Properties p = new Properties( );
         p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
         p.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
         p.put(Context.PROVIDER_URL, "localhost");

      try
      {


         Context jndiContext =new InitialContext(p);
         out.print("Looking up home interfaces..<br>");
         Object ref = jndiContext.lookup ("java:comp/env/ejb/ProcessPaymentHomeRemote");
         ProcessPaymentHomeRemote procpayhome = (ProcessPaymentHomeRemote)
         PortableRemoteObject.narrow (ref,ProcessPaymentHomeRemote.class);
         ProcessPaymentRemote procpay = procpayhome.create();
         out.print("Dropping database table...<br>");
         procpay.dropDbTable ();
      }
      catch(java.rmi.RemoteException re)
      {
         out.print(re.getMessage ());
         return;
      }
      catch(Throwable t)
      {
        out.print(t.getMessage());
        return;
      }
    out.print("Droping successfully..<br>");
%>
<p>

kalparser
2005-05-25 03:02
I think you'll need an application.xml and a jboss-app.xml, package them into META-INF folder with the other jar and war.

Search on internet to see what these xml look like.

猜你喜欢