JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » EJB / 其它Java EE 討論區 » EJB  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to postflat modego to previous topicgo to next topic
話題被移動
該話題已被移動 - worookie , 2004-04-09 01:36
如果您尚不清楚該話題被移動的原因,請參考論壇規則以及本版公告或者聯系本版版主。
本主題所含的標籤
無標籤
作者 j2ee deploy時發生的問題
sly





發文: 17
積分: 0
於 2004-03-29 23:32 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
各位有經驗的前輩好

小弟在deploy時, 發生了點錯誤的訊息.

不知道是版本不同還是什麼問題..
希望大家不吝指教

C:\j2sdkee1.3.1\logs\sylveste\j2ee\j2ee
error
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Logging for J2EE Server Version: 1.3.1-b17 stopped at: Mon Mar 29 22:35:26 CST 2004.
 
Logging for J2EE Server Version: 1.3.1-b17 started at: Mon Mar 29 23:10:54 CST 2004..
Using the Java HotSpot(TM) Client VM and the version number 1.4.2 from Sun Microsystems Inc..
VM is using the classpath: C:\j2sdkee1.3.1\lib\system\cloudscape.jar;C:\j2sdkee1.3.1\lib\system\tools.jar;C:\j2sdkee1.3.1\lib\cloudscape\RmiJdbc.jar;C:\j2sdkee1.3.1\lib\cloudscape\cloudclient.jar;C:\j2sdkee1.3.1\lib\classes;C:\j2sdkee1.3.1\classes;C:\j2sdkee1.3.1\lib\j2ee.jar;C:\j2sdkee1.3.1\lib\toolclasses;C:\j2sdkee1.3.1\lib\j2eetools.jar;C:\j2sdkee1.3.1\lib\locale;;C:\j2sdk1.4.2_02\lib\tools.jar;C:\j2sdkee1.3.1\lib\jhall.jar .
J2EE Home Directory has been set to: C:\j2sdkee1.3.1.
 
Logging for J2EE Server Version: 1.3.1-b17 started at: Mon Mar 29 23:11:07 CST 2004..
Using the Java HotSpot(TM) Client VM and the version number 1.4.2 from Sun Microsystems Inc..
VM is using the classpath: C:\j2sdkee1.3.1\lib\system\cloudscape.jar;C:\j2sdkee1.3.1\lib\system\tools.jar;C:\j2sdkee1.3.1\lib\cloudscape\RmiJdbc.jar;C:\j2sdkee1.3.1\lib\cloudscape\cloudclient.jar;C:\j2sdkee1.3.1\lib\classes;C:\j2sdkee1.3.1\classes;C:\j2sdkee1.3.1\lib\j2ee.jar;C:\j2sdkee1.3.1\lib\toolclasses;C:\j2sdkee1.3.1\lib\j2eetools.jar;C:\j2sdkee1.3.1\lib\locale;;C:\j2sdk1.4.2_02\lib\tools.jar;C:\j2sdkee1.3.1\lib\jhall.jar .
J2EE Home Directory has been set to: C:\j2sdkee1.3.1.
 
Compilation failed.
  at com.sun.ejb.codegen.GeneratorDriver.compileClasses(GeneratorDriver.java:232)
  at com.sun.ejb.codegen.GeneratorDriver.preDeploy(GeneratorDriver.java:603)
  at com.sun.enterprise.tools.deployment.backend.JarInstallerImpl.deployEjbs(JarInstallerImpl.java:707)
  at com.sun.enterprise.tools.deployment.backend.JarInstallerImpl.deployApplication(JarInstallerImpl.java:221)
  at org.omg.stub.com.sun.enterprise.tools.deployment.backend._JarInstallerImpl_Tie._invoke(Unknown Source)
  at com.sun.corba.ee.internal.corba.ServerDelegate.dispatch(ServerDelegate.java:355)
  at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:255)
  at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:84)
  at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:99)


在j2ee -verbose中的錯誤訊息
1
2
3
4
5
6
7
C:\j2sdkee1.3.1\repository\sylveste\gnrtrTMP\Bookstore\com\deitel\advjhtp1\books
tore\ejb\ProductEJB_PM.java:69: unreported exception javax.ejb.CreateException;
must be caught or declared to be thrown
        return (java.lang.String) partition.afterEjbCreate(this);
                                                          ^
1 error
Compilation failed ...


我有去找一下這裡面的資料
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// ProductEJB.java
// Entity EJB Product represents a Product, including the 
// ISBN, publisher, author, title, price number of pages 
// and cover image.
package com.deitel.advjhtp1.bookstore.ejb;
 
// Java extension packages
import javax.ejb.*;
 
// Deitel packages
import com.deitel.advjhtp1.bookstore.model.*;
import com.deitel.advjhtp1.bookstore.*;
 
public class ProductEJB implements EntityBean {
   private EntityContext entityContext;
 
   // container-managed fields
   public String ISBN;
   public String publisher;
   public String author;
   public String title;
   public double price;
   public int pages;
   public String image;
 
   // get Product details as ProductModel
   public ProductModel getProductModel() 
   {
      // construct new ProductModel
      ProductModel productModel = new ProductModel();
      
      // initialize ProductModel with data from Product
      productModel.setISBN( ISBN );
      productModel.setPublisher( publisher );
      productModel.setAuthor( author );
      productModel.setTitle( title );
      productModel.setPrice( price );
      productModel.setPages( pages );
      productModel.setImage( image );
      
      return productModel;
      
   } // end method getProductModel
   
   // set Product details using ProductModel
   private void setProductModel( ProductModel productModel ) 
   {
      // populate Product's data members with data in 
      // provided ProductModel
      ISBN = productModel.getISBN();
      publisher = productModel.getPublisher();
      author = productModel.getAuthor();
      title = productModel.getTitle();
      price = productModel.getPrice();
      pages = productModel.getPages();
      image = productModel.getImage();
      
   } // end method setProductModel 
 
   // create instance of Product EJB using given ProductModel
   public String ejbCreate( ProductModel productModel ) 
   {
      setProductModel( productModel );      
      return null;
   }
   
   // perform any necessary post-creation tasks
   public void ejbPostCreate( ProductModel productmodel ) {}
 
   // set EntityContext
   public void setEntityContext( EntityContext context ) 
   { 
      entityContext = context; 
   }
 
   // unset EntityContext
   public void unsetEntityContext() 
   { 
      entityContext = null; 
   }
   
   // activate Product EJB instance
   public void ejbActivate() 
   {
      ISBN = ( String ) entityContext.getPrimaryKey();
   }
   
   // passivate Product EJB instance
   public void ejbPassivate() 
   {
      ISBN = null;
   }
   
   // remove Product EJB instance
   public void ejbRemove() {}
      
   // store Product EJB data in database
   public void ejbStore() {}
      
   // load Product EJB data from database
   public void ejbLoad() {}
}
 

是因為版本不同嗎??
這個範例是用j2ee1.2版的
而我本身是灌1.3版的

我該怎麼解決呢??


reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
2514 j2ee deploy時發生的問題 sly 5768 2004-03-29 23:32
1891 Re:j2ee deploy時發生的問題 worookie 248 2004-03-30 00:08
1825 Re:j2ee deploy時發生的問題 worookie 77 2004-03-30 02:15
2111 Re:j2ee deploy時發生的問題 sly 225 2004-03-30 12:26
» JWorld@TW »  EJB / 其它Java EE 討論區 » EJB

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8