Wednesday, December 19, 2012

CTUIR.org --> myCTUIR

Imagine a new: ctuir.org
Welcome to myCTUIR!  Community news and updates.  Please login.

Resources:
  • Your financial info
  • Your health info
  • Your education info
  • Job opportunities / online applications
  • Grant applications
  • Maps
  • Upcoming events / Calendar
  • Discussion Forum
This would be our front-end to the CTUIR-as-a-Service that would power the back-end.

Wednesday, February 15, 2012

Getting rolling with drools rules engine server

We are trying out drools as a rules engine and it took me a little while to understand and get drools-server setup in tomcat and interact via soap. So here are my notes for future reference.

0) Documentation can be found here, but it wasn't fully helpful:
http://docs.jboss.org/drools/release/5.3.0.Final/droolsjbpm-integration-docs/html_single/#d0e666

1) Download and install a fresh copy of Tomcat. I used 6.0.35 (not 7). My JRE was 1.6.0_24-b07.

2) Download and unzip the Drools integration project:
http://download.jboss.org/drools/release/5.3.0.Final/droolsjbpm-integration-distribution-5.3.0.Final.zip

 3) Take the "drools-server-app.war" file from the "binaries" directory unpacked above and drop it in your Tomcat webapps directory and fire up tomcat. It will unpack the war file into webapps/drools-server-app directory.

4) Tomcat wouldn't actually deploy my drools-server-app because of the following error:

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [META-INF/cxf/cxf-extension-jaxrs-binding.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-jaxrs-binding.xml] cannot be opened because it does not exist
       at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
       at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
       at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
       at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
       at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:174)
       ... 52 more
Caused by: java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-jaxrs-binding.xml] cannot be opened because it does not exist
       at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143)
       at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

I found this:
http://stackoverflow.com/questions/6349424/apache-cxf-rs-extensions-issue-in-2-4-0
so in my webapps/drools-server-app/WEB-INF/classes/camel-server.xml I removed:

 <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/>
 <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
 <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

which did the trick and I could then restart Tomcat and it would successfully load the drools-server-app.

5) Now I could visit http://localhost:8080/drools-server-app/kservice which gave me a list of available services.

6) I wanted to try interacting via soap, so I clicked on the soap service WSDL link (http://localhost:8080/drools-server-app/kservice/soap?wsdl) but that gave me a soap fault error.

7) I went to my webapps/drools-server-app/WEB-INF/classes/soap.wsdl and edited my binding soap address and made it:

  <wsdl:service name="CommandExecutor">
    <wsdl:port binding="tns:CommandExecutorSoapBinding" name="CommandExecutorPort">
        <soap:address location="http://127.0.0.1:8080/drools-server-app/kservice/soap"/>
    </wsdl:port>
  </wsdl:service>

8) I restarted tomcat and tried again to view the wsdl. That still did not work. I decided to ignore that for now and see if I could still communicate via soap anyway.

 9) I downloaded soapUI:
http://sourceforge.net/projects/soapui/files/soapui/4.0.1/soapui-4.0.1-win32-standalone-bin.zip/download
unzipped it and ran bin/soapui.bat

10) I created a new project in soapui and browsed to my local webapps/drools-server-app/WEB-INF/classes/soap.wsdl file as my initial wsdl since the url wouldn't work for me.

11) I created a soap request message in soapui according to salaboy:
http://salaboy.com/2011/04/05/drools-in-real-life-droolsjbpm5-server-first-steps/
(Thanks!)
like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.jax.drools.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <soap:execute>
    <soap:arg0><![CDATA[

<batch-execution lookup="ksession1">
<insert out-identifier="person1">

 <org.test.Message>
    <text>salaboy</text>
 </org.test.Message>
 </insert>
 <fire-all-rules/>
</batch-execution>
]]>
</soap:arg0>
      </soap:execute>
   </soapenv:Body>
</soapenv:Envelope>

and when I clicked send (green arrow) button, I received:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <ns1:executeResponse xmlns:ns1="http://soap.jax.drools.org/">
         <ns1:return><![CDATA[<?xml version='1.0' encoding='UTF-8'?><execution-results><result identifier="person1"><org.test.Message><text>echo:salaboy</text></org.test.Message></result><fact-handle identifier="person1" external-form="0:2:16823234:1:2:DEFAULT"/></execution-results>]]></ns1:return>
      </ns1:executeResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

12) So it looks like everything is working. I'm very much looking forward to getting into drools now that I have an engine up!

Friday, March 18, 2011

Rough Steps to enable maven + eclipse + tomcat with existing maven project

this was my environment:

* eclipse version is helios j2ee
* tomcat should be installed locally somewhere.
* maven (mvn) is installed and available from the command line.
* install m2eclipse (maven integration for eclipse) plugin

1) clone git repository to a local directory. cd to directory and run: mvn eclipse:eclipse
2) open eclipse and create a new workspace (not the globalidm git directory)
3) file -> import -> general -> existing projects into workspace. choose the globaldm cloned directory
4) right-click web project, choose properties. click "Project Facets" and check the "Dynamic Web Module" box.
5) click servers tab. right click in pane, choose New. Define a new server.
6) right-click on server, choose "Add and Remove" and move your web project to the right to configure it.
7) now follow instructions here: http://www.devx.com/java/Article/36785/1763/page/2 starting with "Enable Maven" until you get to "Configuring J2EE Module Dependencies" (which if you can, great, but I didn't have a "J2EE Module Dependencies" option, so the following is the workaround)
8) right-click web project, choose properties. click "Deployment Assembly". Click "Add" button, "Java Build Path Entries", select all, finish.
9) use right-click project, Run-As -> maven build to build your project as a test. fix any problems until you can build clean.

Note: if you need to add/remove dependencies, open the pom.xml and choose 'dependencies' tab (below pom.xml editor pane). m2 makes it very easy to search, find and maintain dependencies. don't miss the 'dependency hierarchy' tab, too, very helpful. Once you make dependency changes, however, note that your classpath will not reflect those changes until you run: mvn eclipse:eclipse. After you do that, maven will regenerate the classpath file for eclipse based on the dependencies but note: you'll have to re-do step 8 ("Deployment Assembly"). Quite possibly, using a version number for WTP will fix this, but I haven't tried yet (http://maven.apache.org/plugins/maven-eclipse-plugin/wtp.html)

Also, for projects with dependency on submodules, you'll need to "mvn install" each project so that the jar is available to the local repository.

Tuesday, March 15, 2011

Integrating M2Eclipse with an existing Maven project

If you're importing an existing Maven project into Eclipse, you have to so some manual configuration to get both of them happy.  The problem is that Eclipse constructs a webapp directory structure a certain way while Maven has slightly different expectations.  You need to modify you classpath and build directives manually.

This was extremely helpful: 

http://www.devx.com/java/Article/36785/1763/page/2

It was especially relevant in the section toward the bottom called "Some Manual Tweaking of WTP Internals".

Wednesday, February 16, 2011

Tuesday, February 15, 2011

I can never remember a time when I was discouraged,

Mighty good stuff...

From: "Dave McCarty" <weakdave@yahoo.com>
Date: February 15, 2011 10:00:12 AM PST
Subject: I can never remember a time when I was discouraged,

I can never remember a time when I was discouraged, 

 

that I wasn't also concerned about my own righteousness/performance/reputation/somebodiness: my passion to feel good about myself based on my performance. Same is true for every time I've been fearful, or frustrated/angry. My unhappiness, lack of joy/peace, always has to do with me and my performance, or my inability to fix someone I love, which is another example of my performance, or lack thereof. Whenever I'm fearful, frustrated, discouraged or bored, Jesus means very little to me, and His righteousness is definitely unsatisfying: I want something more: some righteousness of my own: I want more than anything in the world, to be able to feel good about self, and I don't.
 
So the next time I'm stuck there, what can I do? Confess my sin of unbelief, my sin of dissatisfaction with Jesus and His righteousness.
 
--IndependentDave, needing prayer to be so freshly captivated by Jesus, that nothing else hardly matters, and the nonbelievers around him are wowed and want what he has (please pray now)

  To read past updates or free subscribe: http://gospelfriendships.icontact.com


This message was sent to kenburcham@gmail.com from:

GospelFriendships | 13 E Broad St | Hatfield, PA 19440

Email Marketing by iContact - Try It Free!

Manage Your Subscription
View this message in the iContact Community:   View message   Comment on this message   Receive as RSS

Thursday, February 3, 2011

Confirmation of directory selections made at National Yellow Pages Opt-Out Site

If you haven't looked up a number in the yellow pages in, like 3 years, visit yellowpagesoptout.com


Begin forwarded message:

Date: February 3, 2011 8:31:37 AM PST
Subject: Confirmation of directory selections made at National Yellow Pages Opt-Out Site

Thank you ken Burcham,

The National Yellow Pages Opt-Out Site received your request on
February 3, 2011 at 11:31 am.

Your selection:
- No copies of Blue Book West - Statewide Publishing
- No copies of Umatilla-Morrow Cos - Yellow Book
- No copies of Pendleton-Athena-Wes - Dex One
- No copies of Northeast Oregon - Ziplocal
- No copies of Eastern Oregon - CenturyLink Published By Berry Company LLC, The

Will be sent to your address in:
  PENDLETON, OR
  97801

Directory selections have been sent to the relevant publishers for processing.

Thank you,


-- National Yellow Pages Opt Out Site Team