Skip to main content

JEAP 6 - 安裝模組 modules

這是今天有人問我的問題~
因為先前已經裝了很多次,很多次,我以為大家都會了說~
原來都迷有好好的閱讀之前的東西~好桑心,好桑心啊!~>x<~

以前在JBoss EAP 5我們有一些共用的模組,都會請你把它放在 $JBoss_install_path/common/lib 下,不然就是使用shared library.. 自己去調整scope.

JBoss EAP 6 的 Class Loading與先前不同,等我有空再寫。

先來講如何安裝module(模組),(小聲地說:截至目前為止,這是第三遍囉!)

當然,這次先自己寫一個JAR檔,
我就寫了一個,christina.jar

它什麼都沒有,就只會跟你說hello~ (你可以按這裡,下載,老規矩,請把txt的副檔名去掉)
當然,如果你有自己的jar檔,請用自己的!

請到$JBOSS_HOME/modules 下建立folder.
我建立一個 demo/christina/main ,把我的jar檔放進去,並且建立一個 module.xml











module.xml的內容如下

  
    
之後,要把這個模組share 給整個JBoss 的 AP看見的話(整個JBoss 就只有一個instance),請在你的standalone or domain 的xml 加上global variable

            
                
            
            false
true 寫一支WAR 來呼叫這個模組,(你可以按這裡,下載,老規矩,請把txt的副檔名去掉)


可以使用這個模組拉~!







當然,如果你不想要把這個模組export出去,只想要給某個WAR檔使用,那上述方式就不太適合了,也可以用下列方式。
在你的WAR 下的 META-INF/MANIFEST.MF 中加入depency就可以了!(你可以按這裡,下載,老規矩,請把txt的副檔名去掉)

MANIFEST.MF設定如下:

Manifest-Version: 1.0
Dependencies: demo.christina
另外,有人問,如果是在Domain環境下,那module是每個host 都要建立嗎?答案是YES! 每一個獨立的Host 都要放喔!






Comments

一隻羊的窩 said…
您好,

我照著您的步驟設定後,有一個自己寫共用的connection jar 不管如何設定 JSP 都會抓不到...
這一個jar以前在JBoss 4.2.3 用了很多年都沒有問題...

換到JBoss EAP 6.3 就不行了...其他jar 是沒問題

測試了半天..發現原來在這一個jar裡面的class 裡面
有個method 有寫到 InitialContext ctx = new InitialContext();
只要寫到這一行就掛... 即使一開始在new這一個class 並沒有被忽叫到 也是會設定不起來...

不知道是否是JBoss EAP 6.3 的問題???

Thanks!
一隻羊的窩 said…
補充一下,

呼叫這一個jar裡面的其他class 是ok的,
就只有這一個class會有問題..

錯誤訊息就是 會找不到這一個class..>_<

Popular posts from this blog

Red Hat JBoss Fuse/A-MQ - Fuse and A-MQ Version 6.3 GA is released!

Fuse and A-MQ 6.3 GA has just went out. Maybe, you would think this is just only a minor version release why should I care? Hold your thoughts on that! Because they have done a lot of improvements and also added many new features into this release.

Besides various bug fixes and making sure Fuse Fabric is much more stable. There are two major change in this version update:

New Tooling in JBoss Developer Studio (JBDS) 9.1 GA. Newer Apache Camel version – Camel v2.17. I was really impressed by the work put in to make developing Camel application much simpler. First is the installation of tooling itself. Now it has a all-in-one installer so you don't need to worry about which plugins you need to check. See the videos below to see the new "Getting Started" of Fuse 6.3.



And If you notice from the above video, the presentation of camel route in JBDS has also updated. It fixed some of the miss representation of logic and making it easier to read.

Old Camel Route
New Camel Route
On …

Fuse Integration Service - Setup JBDS and create first quickstart application

Before we go and start creating our first application, I want to show you how to setup your JBoss Developer Studio, create a small application from the quickstart example and then running it on Fuse Integration Service.

I am using JBoss Developer Studio version 9, you can find it here.
After download the

jboss-devstudio-9.0.0.GA-installer-eap.jar
double-click it, and start installing with default values.

After successful installation, we will need install the plugins for Fuse, on JBoss Central view, select software update, select enable early access.


And select JBoss Fuse Development for the plugin,


Click on install, and we are all set to go!

First thing first, we want to create a Fuse project to deploy on the base of Fuse Integration Service, which is OpenShift. If you have not installed it, please go back to my previous post for instructions. So on your JBDS, right click and start creating the project. Select new, maven project, if you have installed the plugin correctly, you should …

Red Hat JBoss Fuse - Getting Started with Fuse Integration Service 2.0 Tech preview

I just realized that I did not do a getting started for Fuse Integration Service 2.0 Tech preview before I did the pipeline demo, thanks for those of you who reminded me! :)

To get started with FIS 2.0, for people who has just getting to know the technology, here is how I interpret it. Basically, it's divide into two aspect,

1. Integration development, FIS uses Apache Camel as the core technology that creates, orchestrate, compose microservices into a super lightweight thin integration layer, and become the API provider and service orchestrator through exposing RESTful or messaging service endpoints. And you can choose to either package and run it with Spring-Boot or Karaf.


2. Application Deployment and Management, FIS takes advantages of OpenShift platform, and allows you to separately deploy the micro-integration service among distributed environment, at the same time takes care of the failover, high availability, load balancing and service lookup problem for you.


So, now we know …