官方文档:
http://docs.oracle.com/javaee/6/tutorial/doc/gijre.html
package converter.ejb; import java.math.BigDecimal; import javax.ejb.Stateless; @Stateless public class ConverterBean { private BigDecimal yenRate = new BigDecimal("83.0602"); private BigDecimal euroRate = new BigDecimal("0.0093016"); public BigDecimal dollarToYen(BigDecimal dollars) { BigDecimal result = dollars.multiply(yenRate); return result.setScale(2, BigDecimal.ROUND_UP); } public BigDecimal yenToEuro(BigDecimal yen) { BigDecimal result = yen.multiply(euroRate); return result.setScale(2, BigDecimal.ROUND_UP); } }
package converter.web; import java.io.IOException; import java.io.PrintWriter; import java.math.BigDecimal; import javax.ejb.EJB; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import converter.ejb.ConverterBean; @WebServlet public class ConverterServlet extends HttpServlet { private static final long serialVersionUID = 1L; @EJB ConverterBean converterBean; @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String amount = request.getParameter("amount"); if (amount != null && amount.length() > 0) { // convert the amount to a BigDecimal from the request parameter BigDecimal d = new BigDecimal(amount); // call the ConverterBean.dollarToYen() method to get the amount // in Yen BigDecimal yenAmount = converterBean.dollarToYen(d); // call the ConverterBean.yenToEuro() method to get the amount // in Euros BigDecimal euroAmount = converterBean.yenToEuro(yenAmount); response.setCharacterEncoding("utf-8"); PrintWriter writer = response.getWriter(); writer.write("yenAmount:" + String.valueOf(yenAmount) + " "); writer.write("euroAmount:" + String.valueOf(euroAmount) + " "); writer.flush(); writer.close(); } } }
<?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <servlet> <servlet-name>ConverterServlet</servlet-name> <servlet-class>converter.web.ConverterServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ConverterServlet</servlet-name> <url-pattern>/ConverterServlet</url-pattern> </servlet-mapping> </web-app>
<html> <body> <h2>Hello World!</h2> </body> </html>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>converter.ejb</groupId> <artifactId>converter</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>converter Maven Webapp</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.openejb</groupId> <artifactId>javaee-api</artifactId> <version>6.0-6</version> </dependency> </dependencies> <build> <finalName>converter</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build> </project>
启动log:
Aug 25, 2016 4:54:21 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:converter' did not find a matching property.
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat (TomEE)/7.0.68 (1.7.4)
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Feb 8 2016 20:25:54 UTC
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.68.0
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: F:ejavajdk1.7.0_79jre
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.7.0_79-b15
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: F:eapache-tomee-webprofile-1.7.4
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:27025
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=F:eapache-tomee-webprofile-1.7.4
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebapps
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=F:eapache-tomee-webprofile-1.7.4endorsed
Aug 25, 2016 4:54:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Aug 25, 2016 4:54:21 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: F:ejavajdk1.7.0_79in;C:WindowsSunJavain;C:Windowssystem32;C:Windows;F:ejavajdk1.7.0_79jrein;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program FilesMicrosoftWeb Platform Installer;C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0;C:Program Files (x86)Windows Kits8.0Windows Performance Toolkit;C:Program FilesMicrosoft SQL Server110ToolsBinn;F:ejavajdk1.7.0_79in;C:Program FilesTortoiseSVNin;E:apache-ant-1.9.6in;C:Program Files (x86)HPLoadRunnerstrawberry-perlperlin;E:Program Files;.
Aug 25, 2016 4:54:21 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Aug 25, 2016 4:54:21 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Aug 25, 2016 4:54:22 PM org.apache.openejb.util.OptionsLog info
INFO: Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
Aug 25, 2016 4:54:22 PM org.apache.openejb.OpenEJB$Instance <init>
INFO: ********************************************************************************
Aug 25, 2016 4:54:22 PM org.apache.openejb.OpenEJB$Instance <init>
INFO: OpenEJB http://tomee.apache.org/
Aug 25, 2016 4:54:22 PM org.apache.openejb.OpenEJB$Instance <init>
INFO: Startup: Thu Aug 25 16:54:22 CST 2016
Aug 25, 2016 4:54:22 PM org.apache.openejb.OpenEJB$Instance <init>
INFO: Copyright 1999-2015 (C) Apache OpenEJB/TomEE Project, All Rights Reserved.
Aug 25, 2016 4:54:22 PM org.apache.openejb.OpenEJB$Instance <init>
INFO: Version: 4.7.4
Aug 25, 2016 4:54:22 PM org.apache.openejb.OpenEJB$Instance <init>
INFO: Build date: 20160304
Aug 25, 2016 4:54:22 PM org.apache.openejb.OpenEJB$Instance <init>
INFO: Build time: 09:05
Aug 25, 2016 4:54:22 PM org.apache.openejb.OpenEJB$Instance <init>
INFO: ********************************************************************************
Aug 25, 2016 4:54:22 PM org.apache.openejb.OpenEJB$Instance <init>
INFO: openejb.home = F:eapache-tomee-webprofile-1.7.4
Aug 25, 2016 4:54:22 PM org.apache.openejb.OpenEJB$Instance <init>
INFO: openejb.base = F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0
Aug 25, 2016 4:54:22 PM org.apache.openejb.cdi.CdiBuilder initializeOWB
INFO: Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@20ec6f2f
Aug 25, 2016 4:54:22 PM org.apache.openejb.cdi.CdiBuilder initializeOWB
INFO: Succeeded in installing singleton service
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.ConfigurationFactory init
INFO: openejb configuration file is 'F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0confopenejb.xml'
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.ConfigurationFactory configureService
INFO: Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.ConfigurationFactory configureService
INFO: Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.ConfigurationFactory configureService
INFO: Configuring Service(id=My DataSource, type=Resource, provider-id=Default JDBC Database)
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.ConfigurationFactory configureService
INFO: Configuring Service(id=My Unmanaged DataSource, type=Resource, provider-id=Default JDBC Database)
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.ConfigurationFactory configureService
INFO: Configuring Service(id=My Singleton Container, type=Container, provider-id=Default Singleton Container)
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.ConfigurationFactory configureService
INFO: Configuring Service(id=My Stateful Container, type=Container, provider-id=Default Stateful Container)
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.ConfigurationFactory configureService
INFO: Configuring Service(id=My Stateless Container, type=Container, provider-id=Default Stateless Container)
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.DeploymentsResolver loadFrom
WARNING: File error: <Deployments dir="apps/"> - Does not exist: F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0apps
Aug 25, 2016 4:54:22 PM org.apache.openejb.util.OptionsLog info
INFO: Using 'openejb.system.apps=true'
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.ConfigurationFactory configureApplication
INFO: Configuring enterprise application: openejb
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.InitEjbDeployments deploy
INFO: Using openejb.deploymentId.format '{ejbName}'
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.InitEjbDeployments deploy
INFO: Auto-deploying ejb openejb/Deployer: EjbDeployment(deployment-id=openejb/Deployer)
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.InitEjbDeployments deploy
INFO: Auto-deploying ejb openejb/ConfigurationInfo: EjbDeployment(deployment-id=openejb/ConfigurationInfo)
Aug 25, 2016 4:54:22 PM org.apache.openejb.config.InitEjbDeployments deploy
INFO: Auto-deploying ejb MEJB: EjbDeployment(deployment-id=MEJB)
Aug 25, 2016 4:54:23 PM org.apache.openejb.config.AppInfoBuilder build
INFO: Enterprise application "openejb" loaded.
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createRecipe
INFO: Creating TransactionManager(id=Default Transaction Manager)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createRecipe
INFO: Creating SecurityService(id=Tomcat Security Service)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createRecipe
INFO: Creating Resource(id=My DataSource)
Aug 25, 2016 4:54:23 PM org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource readOnly
INFO: Disabling testOnBorrow since no validation query is provided
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createRecipe
INFO: Creating Resource(id=My Unmanaged DataSource)
Aug 25, 2016 4:54:23 PM org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource readOnly
INFO: Disabling testOnBorrow since no validation query is provided
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createRecipe
INFO: Creating Container(id=My Singleton Container)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createRecipe
INFO: Creating Container(id=My Stateful Container)
Aug 25, 2016 4:54:23 PM org.apache.openejb.core.stateful.SimplePassivater init
INFO: Using directory C:UserswlAppDataLocalTemp for stateful session passivation
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createRecipe
INFO: Creating Container(id=My Stateless Container)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createAppClassLoader
INFO: Not creating another application classloader for openejb
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Assembling app: openejb
Aug 25, 2016 4:54:23 PM org.apache.openejb.util.OptionsLog info
INFO: Using 'openejb.jndiname.format={deploymentId}{interfaceType.openejbLegacyName}'
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=openejb/DeployerBusinessRemote) --> Ejb(deployment-id=openejb/Deployer)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer) --> Ejb(deployment-id=openejb/Deployer)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/openejb/openejb/Deployer) --> Ejb(deployment-id=openejb/Deployer)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=openejb/ConfigurationInfoBusinessRemote) --> Ejb(deployment-id=openejb/ConfigurationInfo)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/openejb/openejb/ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=MEJB) --> Ejb(deployment-id=MEJB)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/openejb/MEJB!javax.management.j2ee.ManagementHome) --> Ejb(deployment-id=MEJB)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/openejb/MEJB) --> Ejb(deployment-id=MEJB)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Created Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=My Stateless Container)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Created Ejb(deployment-id=MEJB, ejb-name=MEJB, container=My Stateless Container)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Created Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=My Stateless Container)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Started Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=My Stateless Container)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Started Ejb(deployment-id=MEJB, ejb-name=MEJB, container=My Stateless Container)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Started Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=My Stateless Container)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler deployMBean
INFO: Deployed MBean(openejb.user.mbeans:application=openejb,group=org.apache.openejb.assembler.monitoring,name=JMXDeployer)
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Deployed Application(path=openejb)
Aug 25, 2016 4:54:23 PM org.apache.openejb.server.SimpleServiceManager start
INFO: ** Bound Services **
Aug 25, 2016 4:54:23 PM org.apache.openejb.server.SimpleServiceManager printRow
INFO: NAME IP PORT
Aug 25, 2016 4:54:23 PM org.apache.openejb.server.SimpleServiceManager start
INFO: -------
Aug 25, 2016 4:54:23 PM org.apache.openejb.server.SimpleServiceManager start
INFO: Ready!
Aug 25, 2016 4:54:23 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3185 ms
Aug 25, 2016 4:54:23 PM org.apache.tomee.catalina.OpenEJBNamingContextListener bindResource
INFO: Importing a Tomcat Resource with id 'UserDatabase' of type 'org.apache.catalina.UserDatabase'.
Aug 25, 2016 4:54:23 PM org.apache.openejb.assembler.classic.Assembler createRecipe
INFO: Creating Resource(id=UserDatabase)
Aug 25, 2016 4:54:23 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 25, 2016 4:54:23 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat (TomEE)/7.0.68 (1.7.4)
Aug 25, 2016 4:54:23 PM org.apache.tomee.catalina.TomcatWebAppBuilder init
INFO: ------------------------- localhost -> /
Aug 25, 2016 4:54:23 PM org.apache.openejb.config.ConfigurationFactory configureApplication
INFO: Configuring enterprise application: F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebappsROOT
Aug 25, 2016 4:54:24 PM org.apache.openejb.config.AppInfoBuilder build
INFO: Enterprise application "F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebappsROOT" loaded.
Aug 25, 2016 4:54:24 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Assembling app: F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebappsROOT
Aug 25, 2016 4:54:24 PM org.apache.openejb.cdi.CdiBuilder initSingleton
INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@20ec6f2f
Aug 25, 2016 4:54:24 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
INFO: OpenWebBeans Container is starting...
Aug 25, 2016 4:54:24 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
Aug 25, 2016 4:54:24 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
Aug 25, 2016 4:54:24 PM org.apache.webbeans.config.BeansDeployer validateInjectionPoints
INFO: All injection points were validated successfully.
Aug 25, 2016 4:54:24 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
INFO: OpenWebBeans Container has started, it took 110 ms.
Aug 25, 2016 4:54:24 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Deployed Application(path=F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebappsROOT)
Aug 25, 2016 4:54:24 PM org.apache.tomee.catalina.TomcatWebAppBuilder init
INFO: ------------------------- localhost -> /converter
Aug 25, 2016 4:54:24 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile
INFO: validateJarFile(F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebappsconverterWEB-INFlibjavaee-api-6.0-6.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Aug 25, 2016 4:54:24 PM org.apache.openejb.config.ConfigurationFactory configureApplication
INFO: Configuring enterprise application: F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebappsconverter
Aug 25, 2016 4:54:24 PM org.apache.openejb.config.InitEjbDeployments deploy
INFO: Auto-deploying ejb ConverterBean: EjbDeployment(deployment-id=ConverterBean)
Aug 25, 2016 4:54:24 PM org.apache.openejb.config.AppInfoBuilder build
INFO: Enterprise application "F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebappsconverter" loaded.
Aug 25, 2016 4:54:24 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Assembling app: F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebappsconverter
Aug 25, 2016 4:54:24 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=ConverterBeanLocalBean) --> Ejb(deployment-id=ConverterBean)
Aug 25, 2016 4:54:24 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/converter/ConverterBean!converter.ejb.ConverterBean) --> Ejb(deployment-id=ConverterBean)
Aug 25, 2016 4:54:24 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/converter/ConverterBean) --> Ejb(deployment-id=ConverterBean)
Aug 25, 2016 4:54:24 PM org.apache.openejb.cdi.CdiBuilder initSingleton
INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@20ec6f2f
Aug 25, 2016 4:54:24 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
INFO: OpenWebBeans Container is starting...
Aug 25, 2016 4:54:24 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
Aug 25, 2016 4:54:24 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
Aug 25, 2016 4:54:24 PM org.apache.webbeans.config.BeansDeployer validateInjectionPoints
INFO: All injection points were validated successfully.
Aug 25, 2016 4:54:24 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
INFO: OpenWebBeans Container has started, it took 12 ms.
Aug 25, 2016 4:54:24 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Created Ejb(deployment-id=ConverterBean, ejb-name=ConverterBean, container=My Stateless Container)
Aug 25, 2016 4:54:24 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Started Ejb(deployment-id=ConverterBean, ejb-name=ConverterBean, container=My Stateless Container)
Aug 25, 2016 4:54:24 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Deployed Application(path=F:eworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebappsconverter)
Aug 25, 2016 4:54:24 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 25, 2016 4:54:24 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 25, 2016 4:54:24 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1222 ms
访问:
http://localhost:8080/converter/ConverterServlet?amount=100
结果:
yenAmount:8306.02 euroAmount:77.26
ps:
访问http://localhost:8080/converter/
会进入欢迎页
需要制定具体的servlet或者在index.jsp中做重定向