湘潭大学j2ee实验报告(绝对完整)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

实验一、应用服务器集成1.整合apache和tomcat安装apache到c:\j2ee\Apache中解压tomcat到c:\j2ee\Tomcat中输入测试输入测试接着关掉Apache和tomcat然后打开C:\j2ee\Apache\conf\httpd.conf去掉如下图红线框中的#符号在文件最后添加接下来启动Apache和Tomcat,在C:\j2ee\Tomcat\apache-tomcat-6.0.44\webapps\ROOT建一个文件名为host,host里面新建一个test.jsp接着,在浏览器中输入得到如下页面在浏览器中输入同样得到如下页面到此,Apache和tomecat整合成功!2.Tomcat+ActiveMQ实现消息服务在jsm-test项目中需要在tomcat的lib中导入一共导入6个包:commons-logging-1.1.jaractivemq-core-5.5.0.jaractivemq-web-5.11.1.jargeronimo-j2ee-management_1.1_spec-1.0.jargeronimo-jms_1.1_spec-1.1.1.jargeronimo-jta_1.0.1B_spec-1.0.1.jar修改文件:Tomcatconf下的context.xml!--Thecontentsofthisfilewillbeloadedforeachwebapplication--Context!--Defaultsetofmonitoredresources--WatchedResourceWEB-INF/web.xml/WatchedResource!--UncommentthistodisablesessionpersistenceacrossTomcatrestarts--!--Managerpathname=/--!--UncommentthistoenableCometconnectiontacking(provideseventsonsessionexpirationaswellaswebapplifecycle)--!--ValveclassName=org.apache.catalina.valves.CometConnectionManagerValve/--Resourcename=jms/FailoverConnectionFactoryauth=Containertype=org.apache.activemq.ActiveMQConnectionFactorydescription=JMSConnectionFactoryfactory=org.apache.activemq.jndi.JNDIReferenceFactorybrokerURL=failover:(tcp://localhost:61616)?initialReconnectDelay=100&maxReconnectAttempts=5brokerName=localhostuseEmbeddedBroker=false/Resourcename=jms/NormalConnectionFactoryauth=Containertype=org.apache.activemq.ActiveMQConnectionFactorydescription=JMSConnectionFactoryfactory=org.apache.activemq.jndi.JNDIReferenceFactorybrokerURL=tcp://localhost:61616brokerName=localhostuseEmbeddedBroker=false/Resourcename=jms/topic/MyTopicauth=Containertype=org.apache.activemq.command.ActiveMQTopicfactory=org.apache.activemq.jndi.JNDIReferenceFactoryphysicalName=MY.TEST.FOO/Resourcename=jms/queue/MyQueueauth=Containertype=org.apache.activemq.command.ActiveMQQueuefactory=org.apache.activemq.jndi.JNDIReferenceFactoryphysicalName=MY.TEST.FOO.QUEUE//ContextActivemqconf下的activemq.xml文件!--LicensedtotheApacheSoftwareFoundation(ASF)underoneormorecontributorlicenseagreements.SeetheNOTICEfiledistributedwiththisworkforadditionalinformationregardingcopyrightownership.TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0(theLicense);youmaynotusethisfileexceptincompliancewiththeLicense.YoumayobtainacopyoftheLicenseat!--STARTSNIPPET:example--beansxmlns=:amq=:xsi=:schemaLocation=://://activemq.apache.org/schema/core://activemq.apache.org/camel/schema/spring!--Allowsustousesystempropertiesasvariablesinthisconfigurationfile--beanclass=org.springframework.beans.factory.config.PropertyPlaceholderConfigurer/brokerxmlns==localhostpersistent=trueuseShutdownHook=false!--Destinationspecificpoliciesusingdestinationnamesorwildcards--destinationPolicypolicyMappolicyEntriespolicyEntryqueue=memoryLimit=5mb/policyEntrytopic=memoryLimit=5mbdispatchPolicystrictOrderDispatchPolicy//dispatchPolicysubscriptionRecoveryPolicylastImageSubscriptionRecoveryPolicy//subscriptionRecoveryPolicy/policyEntry/policyEntries/policyMap/destinationPolicy!--UsethefollowingtoconfigurehowActiveMQisexposedinJMX--managementContextmanagementContextcreateConnector=false//managementContext!--ThestoreandforwardbrokernetworksActiveMQwilllistento--networkConnectors!--bydefaultjustautodiscovertheotherbrokers--networkConnectorname=default-ncuri=multicast://default/!--Exampleofastaticconfiguration:networkConnectorname=host1andhost2uri=static://(tcp://host1:61616,tcp://host2:61616)/--/networkConnectorspersistenceAdapteramqPersistenceAdapterdirectory=activemq-datamaxFileLength=32mb//persistenceAdapter!--UsethefollowingifyouwishtoconfigurethejournalwithJDBC--!--persistenceAdapterjournaledJDBCdataDirectory=${activemq.base}/datadataSource=#postgres-ds//persistenceAdapter--!--OrifyouwanttousepureJDBCwithoutajournal--!--persistenceAdapterjdbcPersistenceAdapterdataSource=#postgres-ds//persistenceAdapter--!--Themaximumaboutofspacethebrokerwillusebeforeslowingdownproducers--systemUsagesystemUsagememoryUsagememoryUsagelimit=20mb//memoryUsagestoreUsagestoreUsagelimit=1gbname=foo//storeUsaget

1 / 27
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功