当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 我的硬盘有cde三个区,c为主分区,d扩展分区,e我用pq7.0改为主分区。 c盘下装win2000系统,我使用ghost软件分区拷贝c盘到e盘,然后激活e为活动分区。 但是,系统启动时仍然从c盘启动,而不能从e盘启动,这是何原因? 另外,如果,我在c盘的boot.ini文件,添加如下一行: multi(0)disk(0)rdisk(0)partition(3)\winnt="m......
 ·怎样用printer来打印shape控件    »显示摘要«
    摘要: 如题: ......


:EJB的hello word问题

用JB8做,jboss服务器,编译通过,发布成功,用Servlet调用出如下错      
  Naming     Exception     caught:javax.naming.NameNotFoundException:     ejb     not     bound      
  我的servlet为:      
  package     yj;      
  import     yj.*;      
  import     javax.servlet.*;      
  import     javax.servlet.http.*;      
  import     java.io.*;      
  import     javax.ejb.*;      
  import     javax.naming.*;      
  import     java.rmi.*;      
  import     java.util.Properties;      
  public     class     HelloServlet     extends     HttpServlet      
  {      
                                public     void     service(HttpServletRequest     req,HttpServletResponse     res)throws     IOException{      
                                res.setContentType("text/html");      
                                PrintWriter     out=res.getWriter();      
                                out.println("<html><head><title>the     first     EJB</title></head>");      
                                try     {      
                                        Properties     props     =     System.getProperties();      
                                        Context     ctx     =     new     InitialContext(props);      
     
                                        HelloHome     home     =     (HelloHome)ctx.lookup("HelloHome");      
     
                        Hello     yj     =     home.create();      
                        out.println(     yj.getHello()     );      
            }catch(javax.naming.NamingException     ne){      
                                        out.println("Naming     Exception     caught:"+ne);      
                                        ne.printStackTrace(out);      
                                        }      
                                        catch(javax.ejb.CreateException     ce){      
                                        out.println("Create     Exception     caught:"+ce);      
                                        ce.printStackTrace(out);      
                                        }      
                                        catch(java.rmi.RemoteException     re){      
                                        out.println("Remote     Exception     caught:"+re);      
                                        re.printStackTrace(out);      
                                        }      
                                        out.println("</body></html>");      
                                        }      
  }      
  各位帮帮看看吧

NO.1   作者: getdown

package   你的包;  
   
  import   javax.ejb.*;  
  import   javax.naming.*;  
  import   java.rmi.*;  
  import   java.util.*;  
   
  public   class   HelloClient   {  
   
      public   static   void   main(String[]   args)   throws   Exception   {  
          Hello   hello   =   null;  
          //Hello   为你的远程接口  
          try   {  
              Context   ctx   =   new   InitialContext(System.getProperties());  
              HelloHome   home   =   (HelloHome)javax.rmi.PortableRemoteObject.narrow(ctx.lookup("HelloHome"),HelloHomeHome.class);  
          //HelloHome为你的远程home接口       “HelloHome”为你的远程Home   jndi   name  
              hello   =   home.create();  
              System.out.println(hello.getHello());            
           
          }catch   (Exception   e)   {  
              System.out.println(e.toString());  
          }  
   
      }  
   
  }


    摘要: treeview.dblclick过程中只有(sender: tobject)参数,不象treeview.change(sender: tobject;node: ttreenode)有node参数。如何解决?谢谢! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE