Drools6.3.0部署(MyEclipse安装与tomcat部署)

本文详细介绍了如何在MyEclipse中安装Drools,并提供了步骤指导。此外,还讲解了如何将Drools Workbench部署到Tomcat服务器上,包括必要的配置文件设置和解决常见问题的方法。

MyEclipse安装:

官方下载Drools的两个zip包: 点击打开链接

drools-distribution-6.3.0.Final.zip 和 droolsjbpm-tools-distribution-6.3.0.Final.zip

在Myeclipse安装目录的dropins文件夹下新建文件夹drools;

将droolsjbpm-tools-distribution-6.3.0.Final.zip 解压,将droolsjbpm-tools-distribution-6.3.0.Final\binaries\org.drools.updatesite下的features和plugins复制到刚才的drools文件夹中;

重启MyEclipse,在Window->Preferences里可以看到Drools选项。



解压drools-distribution-6.3.0.Final.zip

点击上面的Add,选择binaries目录。


打勾,apply。重启MyEclipse。

新建工程选择Drools,里面有官方的例子可以打勾试一试。



将Workbench部署到tomcat上:

workbench是drools的web端,在官网下载war包。点击打开链接

其他的服务器下载对应的war包,这里先讲tomcat。


这里用linux环境,windows环境不知为什么总是出错。

准备一个纯净的tomcat服务器(linux安装tomcat请在论坛搜索)

unzip -oq kie-drools-wb-6.3.0.Final-tomcat7.war -d kie/  解压war包,主要是用到里面的readme文件,其他都没用。

根据readme文件进行安装,需要以下几个jar包:(在maven下载) 点击打开链接


将上面的jar包丢到TOMCAT_HOME/lib下;

在TOMCAT_HOME/conf下创建:

btm-config.properties

   # ************************ btm-config.properties *********************************
         bitronix.tm.serverId=tomcat-btm-node0
         bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog
         bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog
         bitronix.tm.resource.configuration=${btm.root}/conf/resources.properties

   #**********************************************************************************

resources.properties

    #************************ resources.properties *******************************
         resource.ds1.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
         resource.ds1.uniqueName=jdbc/jbpm
         resource.ds1.minPoolSize=10
         resource.ds1.maxPoolSize=20
         resource.ds1.driverProperties.driverClassName=org.h2.Driver
         resource.ds1.driverProperties.url=jdbc:h2:file:~/jbpm
         resource.ds1.driverProperties.user=sa
         resource.ds1.driverProperties.password=
         resource.ds1.allowLocalTransactions=true
    #*******************************************************************************

在TOMCAT_HOME/bin下创建:

setenv.sh

#******************************setenv.sh*******************************************

    CATALINA_OPTS="-Xmx512M -XX:MaxPermSize=512m -Dbtm.root=$CATALINA_HOME \
    -Dbitronix.tm.configuration=$CATALINA_HOME/conf/btm-config.properties \
    -Djbpm.tsr.jndi.lookup=java:comp/env/TransactionSynchronizationRegistry \
    -Djava.security.auth.login.config=$CATALINA_HOME/webapps/kie-drools-wb/WEB-INF/classes/login.config \
    -Dorg.jboss.logging.provider=jdk"

#************************************************************************************

修改TOMCAT_HOME/conf/server.xml文件,在Host标签内最下面加上:

<Valve className="org.kie.integration.tomcat.JACCValve" />

编辑 TOMCAT_HOME/conf/tomcat-users.xml 文件,保证有一个'analyst' 或'admin'的roles定义。


至此,官方readme里的配置结束,一部分机器此时已经可以启动tomcat进入 IP:PORT/kie-drools-wb-6.3.0.Final-tomcat7/index.jsp并登录了。

修改tomcat端口:

修改apache-tomcat-7.0.67/conf/server.xml

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

其中8080端口若被占用则修改为其他空闲端口。


但也有很多人遇到一下的错误:

Caused by: java.lang.RuntimeException: org.eclipse.jgit.api.errors.TransportException: https://github.com/guvnorngtestuser1/guvnorng-playground.git: cannot open git-upload-pack
        at org.kie.commons.java.nio.fs.jgit.util.JGitUtil.cloneRepository(JGitUtil.java:231) 
        at org.kie.commons.java.nio.fs.jgit.JGitFileSystemProvider.newFileSystem(JGitFileSystemProvider.java:446) 
...<snip>... 
Caused by: java.net.ConnectException: Connection time out: github.com
        at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:173) 
        at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:459) 

我遇到这个问题的时候很苦恼,明明服务器配置了代理为什么还报这种错误,后来在http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html 这里看到配置代理的选项。

于是我尝试着给catalina.sh里

cygwin=false这一行的上面加上

export JAVA_OPTS="-Dhttp.useProxy=true -Dhttp.proxyHost=web-proxy.yourdomainname.com -Dhttp.proxyPort=8080 -Dhttps.proxyHost=web-proxy.yourdomainname.com -Dhttps.proxyPort=8080"

问题就解决了。

但此时部署的时候会报下面的错误:

Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.guvnor:guvnor-asset-mgmt-project:jar:6.3.0.Final in guvnor-m2-repo (file:/opt/mount1/apache-tomcat-7.0.67/repositories/kie/)
        at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:39)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
        at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
        ... 63 more

这个问题官方已经定义为warn了,可以忽略。

https://bugzilla.redhat.com/show_bug.cgi?id=1263738






Welcome to Drools ================= Third party jars ---------------- Following third party jars are optional and are not included in Drools distribution: 1.Quartz: Quartz is an optional jar only needed if you wish to adapt existing quartz calendars. It can be downloaded from http://www.quartz-scheduler.org/. Run the examples ---------------- It&#39;s easy to run the examples: On Linux, Mac or Cygwin: examples/runExamples.sh On Windows: examples\runExamples.bat Run the examples in Eclipse --------------------------- Open Eclipse, install the Drools plugin, as described in the introduction reference manual. Open menu Window, menu item Preferences, tree item Drools, tree item Installed Drools Runtime environments Add the dir "binaries/" from the zip as a new Drools Runtime Environment. Activate the checkbox of that newly created runtime environment. Restart eclipse. Open menu File, menu item Import..., tree item General, tree item Existing Projects into Workspace, button Next and select root directory "examples/sources/" from the zip, button Finish. Alternatively, if you have the m2eclipse plugin installed: Open menu File, menu item Import, tree item Maven, tree item Existing Maven Projects, button Next and select "examples/sources/" from the zip, button Finish. Open menu Run, menu item Run configurations, add new Java Application with main class "org.drools.examples.DroolsExamplesApp" and VM arguments "-Xms256m -Xmx512m -server", click button Run. Run the examples in IntelliJ ---------------------------- Open menu File, menu item Open project, select "examples/sources/pom.xml". Open menu Run, menu item Edit Configurations, add a new Application with main class "org.drools.examples.DroolsExamplesApp" and VM parameters "-Xms256m -Xmx512m -server" and run that. Read the reference manual ------------------------- To see the reference_manual, just open: reference_manual/html_single/index.html It contains information how to use it on your project (wi
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

王义凯_Rick

遇见即是缘,路过就给个评论吧~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值