最近在研究SUN公司的PETSTORE开源项目,我是这样做的: 
我下的是sun公司的最新版javapetstore-2.0-ea5-installer.rar  我用的是:  
            1、apache-ant-1.7.0-src.zip    
            2、MyEclipse_6.0.1GA_E3.3.exe  
            3、glassfish 2.x 
            4、jDK5 
        ant 的安装:http://www.zhuoda.org/idiot/17881.html 一定要设好路径。我装在D:ant-1.7.0(ANT_HOME) 
        glassfish安装:http://www.blogjava.net/kukoo/archive/2006/07/20/59160.html 
            glassfish-installer.rar  要用在命令行下输入如下: 
              java -Xmx256m -jar glassfish-installer.rar    打开,Accept后我解压放在了D:glassfish 
              进入cmd 界面 D:glassfish>ant -f setup.xml    build success 后服务器就安装好了 
  第二步:新建工程, 首先将下载到D盘的javapetstore-2.0-ea5-installer.rar  在cmd下命令行下解压: 
          cmd下    D:> java -Xmx256m -jar javapetstore-2.0-ea5-installer.rar  
          D盘下生成javapetstore-2.0-ea5-installer文件  
        在MyEclipse 中新建一个空web project  我建的是(pet)要注意的是: 
              pet 项目的 src folder 设为:src\java        web root folder 设为:web        
                                j2ee specification level 选J2EE5。0  
            再点在pet上右击import从文件系统导入D:javapetstore-2.0-ea5-installer下的所有东西 
            为项目导入外部jar文件:D:\javapetstore-2.0-ea5-installer\lib \**.jar    (。zip 我也选上了), 
            为项目加入 JSF 支持:导入jsf框架,最好先把 pet项目下:  pet/web/WEB-INF/    下的两个文件: 
                faces-config.xml 和 sun-web.xml 改个名字备份一下,当jsf 框架导入以后再还原回来。免得被覆盖了。       第三步:修改部份文件。 
            1。pet/bp-project/app-server.properties      中有一行: 
              javaee.home=c:/Sun/SDK    改为    javaee.home=D:/glassfish    (D:/glassfish是我的glassfish服务器安装目录) 
            2。pet/bp-project/build.properties                中有两行: 
                javaee.home=c:/Sun/AppServer    改为    javaee.home=D:/glassfish    (D:/glassfish是我的服务器安装目录,大家也要改成自己的安安装目录) 
                  javaee.server.passwordfile=“{javaee}/samples/....”改为    javaee.home=D:/1.txt    (D:/glassfish是我的服务器安装目录,大家也要改成自己的安装目录) 
                  并在D:盘下建一个1.txt 文件 里面的内容为一句话:AS_ADMIN_PASSWORD=adminadmin 
    第四步:发布 
            1、打开glassfish服务器,这个可以用myeclipse打开。 
            2、发布 war 文件 在myeclipse中以ant Editor方式打开 pet\build.xml    然后运行它的default[default] 任务.  在workSpace中的pet/dist/下面就应该已经生成了petstore.war文件。将它copy到服务器下:D:\glassfish\domains\domain1\autodeploy\下 
这个时候就会以下抛出异常: 
2008-6-19 17:43:25com.sun.enterprise.server.ondemand.SystemAppLoader loadSystemApps 
信息: About to load the system app: __ejb_container_timer_app 
2008-6-19 17:43:25 com.sun.ejb.containers.ContainerFactoryImpl createContainer 
严重: EJB5090: Exception in creating EJB container [java.lang.ClassNotFoundException: com.sun.ejb.containers.TimerMigrationBean649625130_ConcreteImpl] 
2008-6-19 17:43:25 com.sun.ejb.containers.ContainerFactoryImpl createContainer 
严重: appId=__ejb_container_timer_app moduleName=ejb_jar ejbName=TimerMigrationBean 
2008-6-19 17:43:25 com.sun.enterprise.server.AbstractLoader loadEjbs 
严重: LDR5004: UnExpected error occured while creating ejb container 
java.lang.ClassNotFoundException: com.sun.ejb.containers.TimerMigrationBean649625130_ConcreteImpl 
at com.sun.enterprise.loader.EJBClassLoader.findClassData(EJBClassLoader.java:697) 
at com.sun.enterprise.loader.EJBClassLoader.findClass(EJBClassLoader.java:595) 
at java.lang.ClassLoader.loadClass(Unknown Source) 
at java.lang.ClassLoader.loadClass(Unknown Source) 
at com.sun.ejb.containers.BaseContainer. <init>(BaseContainer.java:407) 
at com.sun.ejb.containers.EntityContainer. <init>(EntityContainer.java:235) 
at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:643) 
at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:486) 
at com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:183) 
at com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:113) 
at com.sun.enterprise.server.AbstractManager.loadOneSystemApp(AbstractManager.java:319) 
at com.sun.enterprise.server.ondemand.SystemAppLoader.loadSystemApps(SystemAppLoader.java:109) 
at com.sun.enterprise.server.ondemand.EjbServiceGroup.loadSystemApps(EjbServiceGroup.java:163) 
at com.sun.enterprise.server.ondemand.EjbServiceGroup.start(EjbServiceGroup.java:122) 
at com.sun.enterprise.server.ondemand.ServiceGroup$1.run(ServiceGroup.java:180) 
at java.security.AccessController.doPrivileged(Native Method) 
at com.sun.enterprise.server.ondemand.ServiceGroup.startChildren(ServiceGroup.java:177) 
然后MYECLIPES中的CONSOLE里会不断的刷新!!最后给我提示,我的SERVER被REJECTED了! 
我去GOOGLE了,找到了一个很接近的答案,但我不知道这位仁兄说的这个东西去glassfish服务器的哪个文件里改,他的回复如下: 
I didn't realize that SJSAS 9.1 switched the default from the local OpenMQ to the embedded OpenMQ. Changing the server's configuration to use <tt>LOCAL </tt> for JMS eliminated the error. 
Should the inability of the <tt>EMBEDDED </tt> mode of OpenMQ to support serializable <tt>TemporaryDestination </tt>s be considered a bug? 
我大致知道这个异常跟TIMER有关系?但是glassfish研究了N天了,还是没有CONSOLE。希望大家帮帮忙,不胜感谢。

解决方案 »

  1.   

    你查看一下启动时的信息,有提示控制台在 http://localhost:4848E:\glassfish\bin>asadmin start-domain domain1
    Starting Domain domain1, please wait.
    Log redirected to E:\glassfish\domains\domain1\logs\server.log.
    Redirecting output to E:/glassfish/domains/domain1/logs/server.log
    Domain domain1 started.
    Domain [domain1] is running [Sun Java System Application Server 9.1_02 (build b0
    4-fcs)] with its configuration and logs at: [E:\glassfish\domains].
    Admin Console is available at [http://localhost:4848].
    Use the same port [4848] for "asadmin" commands.
    User web applications are available at these URLs:
    [http://localhost:8080 https://localhost:8181 ].
    Following web-contexts are available:
    [/web1  /__wstx-services ].
    Standard JMX Clients (like JConsole) can connect to JMXServiceURL:
    [service:jmx:rmi:///jndi/rmi://vert:8686/jmxrmi] for domain management purposes.Domain listens on at least following ports for connections:
    [8080 8181 4848 3700 3820 3920 8686 ].
    Domain supports application server clusters and other standalone instances.