Same EJB in multiple EARs
Is it possible to somehow prepend some sort of EAR based context to the JNDI
name of an EJB? We think we will eventually have multiple EARs that have
different versions of the same EJBs in them. I'm guessing we can somehow
specify the version name in the JNDI name, but it might be nicer if all EJBs
in the same EAR have the same prefix or specification.
Any ideas?
Thanks,
Eric
Having same ejb in multiple ears does not matter as long as you package your ear.
This link talks how weblogic resolves the class loading for two different ears.
http://e-docs.bea.com/wls/docs61/programming/packaging.html#1048725
"Eric F" <[email protected]> wrote:
Is it possible to somehow prepend some sort of EAR based context to the
JNDI
name of an EJB? We think we will eventually have multiple EARs that
have
different versions of the same EJBs in them. I'm guessing we can somehow
specify the version name in the JNDI name, but it might be nicer if all
EJBs
in the same EAR have the same prefix or specification.
Any ideas?
Thanks,
Eric
Similar Messages
-
Sharing common libraries and ejbs between multiple ears
Hi
I have been going through various articles at O'Reilly and discussions at serverside
(some outdated) on the packaging options in J2EE.
http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html?page=2
http://www.onjava.com/pub/a/onjava/2001/07/25/ejb.html
http://www2.theserverside.com/home/thread.jsp?thread_id=7530
I am still undecided as to what is the best way to package and deploy
- a set of EJBs (Stateless Session beans) and
- utility libraries
that need to be shared by multiple ears.
We have a set of components - 4 session ejbs and 15 utility classes like log4java,
xerces, custom utilities etc... which need to be shared by all applications running
on the server (in a clustered environment).
There are over 22 applications and these will be packaged in individual ear files.
If we choose to put the common EJBs and utilities in each of the application's
ear, then for every change to this common library all the applications will need
to be repackaged and redeployed, which obviously is not desirable.
If we choose to use the 'Class-Path' option in manifest file, from what I understand
the path to be specified is a relative path within the ear i.e. the path cannot
point to archives outside the .ear file, which does not serve our purpose. Am
I right in this understanding?
What is the best way to package and deploy these common components under these
circumstances?
Has anybody tried something like this before?
Would appreciate your comments on this.
Thank you."Kumar" <[email protected]> wrote in message
news:[email protected]...
In My opinion,
I would be packaging the all utilities into a single jar file and be using
in the application server class path directly. whenever I want to change
this jar file I can change at one shot and package this jar file and keepit
in the classpath again. This works very well, if and only if each EAR file
is not using its own version of a libary of utility jar file. All earfiles
should be using a single and common library.In this case when you update the .jar file, you would have to restart the
server. I am not aware of any good solution which alleviates this.
>
If I include this utility jar file into all ear files, the following arethe
difficulties we need to handle in the future.
- What if utility library has been changed frequently, it leads to
re-package all .ears and re-deployment
- Unnecessarily adding a copy of a single jar file to all ear files,
increases complexity
- Any new application needed to be deployed, again which uses utility, we
need add the utility jar file to ear file
- There is no logical separation and simplicity
Thanks
Kumar
"Kiran P" <[email protected]> wrote in message
news:[email protected]...
Hi
I have been going through various articles at O'Reilly and discussions
at
serverside
(some outdated) on the packaging options in J2EE.
http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html?page=2
http://www.onjava.com/pub/a/onjava/2001/07/25/ejb.html
http://www2.theserverside.com/home/thread.jsp?thread_id=7530
I am still undecided as to what is the best way to package and deploy
- a set of EJBs (Stateless Session beans) and
- utility libraries
that need to be shared by multiple ears.
We have a set of components - 4 session ejbs and 15 utility classes likelog4java,
xerces, custom utilities etc... which need to be shared by allapplications running
on the server (in a clustered environment).
There are over 22 applications and these will be packaged in individualear files.
If we choose to put the common EJBs and utilities in each of theapplication's
ear, then for every change to this common library all the applicationswill need
to be repackaged and redeployed, which obviously is not desirable.
If we choose to use the 'Class-Path' option in manifest file, from what
I
understand
the path to be specified is a relative path within the ear i.e. the pathcannot
point to archives outside the .ear file, which does not serve our
purpose.
Am
I right in this understanding?
What is the best way to package and deploy these common components underthese
circumstances?
Has anybody tried something like this before?
Would appreciate your comments on this.
Thank you. -
Using common jars containing EJBs in multiple ears
I was wondering if there was an easy way to have references to jars that is contained in one ear in another ear. The main question is that if we have some EJBs that are commonly used in multiple ears then is there a way to have those common EJBs in a single ear and have the other ears that need these EJBs reference them in some way without having to copy them into those ears? Thanks ahead of time
If you think about it carefully, one .ear file represents one enterprise application. In other words, a .ear file represents a packaged unit that must be deployable by itself.
If one desires to use some reusable business component in one's enterprise application, all dependencies that that component might be having will need to be included in the deployable unit, i.e. the .ear file, for that application.
On similar lines, the following is an extract from the Enterprise JavaBeans specification 1.1 (pay particular attention to the first paragraph therein)...
The ejb-jar file must also contain the class files for all the classes and interfaces that the enterprise bean
class, and the remote and home interfaces depend on. This includes their superclasses and superinter-faces,
and the classes and interfaces used as method parameters, results, and exceptions.
An ejb-jar file does not have to include the class files of the home and remote interfaces of an enterprise
bean that is referenced by an enterprise bean in the ejb-jar, or other classes needed by the referenced
enterprise bean, if the referenced enterprise bean or needed classes are defined in another jar file that is
named in the Class-Path attribute in the Manifest file of the referencing ejb-jar file, or the transitive clo-sure
of such Class-Path references. Note that this Class-Path mechanism only works with JDK 1.2 and
later.
You can extrapolate a similar notion for enterprise archives also.
I guess, the simplest way to put this is, when deploying one application one cannot assume the existence of another application. -
Remote and local interface on same ejb 3.0 bean instance
Hi,
Is it posible to get remote and local interface on same ejb 3.0 bean instance.
For example get local interface of a bean and than pass it as remote to client.
Both interfaces must operate on same bean instance.
Thanks
Zlajayes. You can implement multiple interfaces on a single class, so you can add a local and a remote interface. One trick to avoid duplicate code is to simply make the remote interface extend the local interface; then you only have to add the @Remote annotation and you're done.
For example get local interface of a bean and than pass it as remote to client.You don't pass an instances to a client, a client looks up a remote instance of the bean through JNDI. -
How to access same ejb from different applications
Hi
I have two applications (.ear). Each application has 4 EJBs. These EJBs are same in both applications including their names. JNDI names are also same in each application.
in detail
ApplicationA (appA.ear) contains
web1.war
ejb1.jar
ejb2.jar
ejb3.jar
ejb4.jar
and
ApplicationB (appB.ear) contains
web2.war
ejb1.jar
ejb2.jar
ejb3.jar
ejb4.jar
both web1.war and web2.war has same JNDI references to these EJBs.
The problem:
If you access the applicationA, works fine. But if you access applicationB, it throws ClassCast Exception
After restarting.....
If you access the applicationB, works fine. But if you access applicationA, it throws ClassCast Exception
Both the applications are not working same time.
I suspect that It is because both applications have same ejbs and with same JNDI names.
Please validate.
Thanks
SrinivasHi Timo,
Very sorry for reply so late!
My case is that accessing a task flow(MaintainJobInstanceTaskFlow) through NevigationBean of UI Shell. please see the coding as following:
taskFlowId_SubNavigation =
"/WEB-INF/oracle/apps/pas/shell/ui/flow/SystemSetupTabFlow.xml#SystemSetupTabFlow";
taskFlowId_TaskListNavigation =
"/WEB-INF/oracle/apps/pas/shell/ui/flow/SystemSetupTaskListFlow.xml#SystemSetupTaskListFlow";
taskFlowId_QuickSearch =
"/WEB-INF/oracle/apps/pas/shell/ui/flow/SystemSetupQuickSearchFlow.xml#SystemSetupQuickSearchFlow";
taskFlowId_LocalArea =
"/WEB-INF/oracle/apps/pas/transactions/ui/flow/MaintainJobInstanceTaskFlow.xml#MaintainJobInstanceTaskFlow";
break;
In my case, how to transfer parameters to MaintainJobInstanceTaskFlow in java?
Thanks!
Susan -
Lately at work we have been having a lot of discussion on the pros and cons of having one ear file for multiple projects or breaking the model down into multiple ear files. Its basically a portal environment with a lot of different portlets as separate projects. WSAD is being used for development while the project is deployed on WAS. Rach portlet is a separate WAR file packaged into the same EAR file.
The topic of discussion is incase one of the WAR files is changed whether
1) We should have a new build for the whole ear file.
2) Just update the one war file in the ear file.
3) redesign the whole thing so that each portlet rather than having a separate war file should have a separate ear file.
It is with this in mind that I am asking you gurus of your opinions and preferences. In case you could point out to some useful links that would be welcome too. I am sure you people would put in your ideas and it would be a good learning exercise for me.
ThanksThe pro is an absence of cons. If you don't needa
bunch of EAR files, don't make a bunch of EARfiles.
That simplifies deployment, tracking, management,
etc.But exactly the same arguement exists the other way
around.
deployment:-
If you have to deploy one module you donot have to
regenerate the whole ear file rather just building
this one ear file would do.Not on my watch. If any code changes you need to run
the acceptance tests again for the whole shebang. I'd
want ant to figure out which components get rebuilt,
not a human.
tracking:-
Since you are in control of which modules aredeployed
and each module is deplyed separately so you donot
need to do the regression test each time there is a
deployment. And you donot need to test the
fuctionality of the rest of the modules.Being in control doesn't mean you shouldn't run the
acceptance tests.
management:-
in case a bug is found in one of the modules onlythat
module could be replaced with a previous buildrather
than losing the changes in the rest of the modules.But you have to regression test everything else to
make sure that bug fix didn't break something else, or
that the bug fix is applied to every component that
shares the same source code.
Strive for more testing instead of less.as per the def of an ear file
An EAR is a deployment contract. Each EAR should represent a complete application and should not rely on code external to the EAR file, except what is provided by the application server itself.
so we donot need to run tests for the rest of the ear files and thats one of the benefits but what are the drawbacks? -
How to handlle multiple ear and common database.
Hi Friends,
Need urgent help.
I working on a project where there will be multiple ear ,each for one application.
There are 4 project and 4 ears and one common util war file which will be shared by all ears.
Problem is : 3 of the projects will use same database tables. I am using hibernate ORM mapping for database table.
Q1. In the above scenario db access table are 90% common in 3 projects. Should I go for instead of 3 ears club into 1 EAR and current 3 project as a 3 module in 1 club ear or per project one ear?
Pls suggest me the approach and advantage and disadvantages of the approach.
Q2 : Should I put the data-beans and table mapping files (e.g account.hbn.xml) & hibenate.cfg.xml file in common war(centralized or shared) or replicate the copies of all beans mapping xml and beans classes in every ear.
If you suggesting to use the centralized/shared data configuration approach then how EAR 's jvms will handle Transaction for every ear.
I am using Websphere app server6.1, hibernate3 and db2 8.0
Waiting for your interesting replies.
Thanking you in advance.
Navin.How are you going to handle upgrades if a database change is needed?
If it is per application then you need to keep the code by app. If across applications then you need to keep the code separate. -
Deploying same WAR file multiple times
I am attempting to deploy the same WAR file with different parameters [Differnt
data sources, etc.] Has anyone deployed the exact same war file multiple times?
I know one way to do this is to rename the war file, is there a way other than
this without EAR it up?you edit your html file to embed multiple copies of your swf.
it's generally easier to control the layout if you use swfobject (but you can just copy the code published by flash pro) to embed the swf. -
Share http session across multiple EARs
I am curious to know the following:-
--> is it possible to share http session across multiple EARs running on same Weblogic application server.
i.e weblogic server/Jboss
--> is it possible to share http session across multiple EARs running on different Weblogic application server.
i.e weblogic server/Jboss
Please share the steps/way to acheive the same.What are you trying to achieve / accomplish by splitting it up?
e.g. Clean Build in workshop will be faster for multiple EAR's , but unless you have all your application level libraries as shared libraries you might increase your runtime footprint. or you might want independent deploy/redeploy for your apps etc.
If however you need the session to be shared , that these aren't really independent web-applications and shouldn't be separate ear's. In most cases though you dont actually need the session as shared (e.g. a user's data is fetched from the database , you dont really need the session shared, you need a single shared sign on). So when you say is the session shared, what is the data that you need shared? should it be in the session in the first place?
And finally are these webapp's really independent (functionally ) or not?
Edited by: deepshet on Oct 13, 2009 2:09 PM -
Applying the same ActivationConfigProperties to multiple MDBs
Is there a portable way of applying the same ActivationConfigProperties to multiple MDBs?
I think it's typical for many applications to contain MDBs which differ only in the destination name so it should promote ease of use and convention over config to have such a feature, say for JMS 2?
Motivation for asking is:
In Jboss 5.1.0 one could use a container defined AspectDomain to define a set of properties that an MDB inherits and overrides at will. This allowed externalization of config properties as well as reuse. This is no longer available in Jboss 7.1.X. and I found myself having to create an ejb-jar.xml file
that contains
<ejb-name>MDBName</ejb-name>
<activation-config>
<activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>providerSpecificProperty.eg.queueManagerHostName</activation-config-property-name>
<activation-config-property-value>${departmentA.queueManager.hostName}</activation-config-property-value>
</activation-config-property>
</activation-config>
...where ${departmentA.queueManager.hostName} is an ant style variable configured in Jboss 7 standalone.xml. There's quite a lot of those provider specific properties that I had to define. Then I had to copy and paste the same configs for all the MDBs I had keeping only the queue name definitions on the MDB.
I'm not really looking for the externalization in this request since that's container specific but putting the properties in one place to apply them to multiple MDBs could be helpful in the spec.
One very crude approach would be to allow wildcards on the <ejb-name> values as is allowed for intercepted classes in interceptor definitions (which would make it a request for the EJB spec rather than JMS?)
Anyone know something I can use now with the current specs that allows definition of config properties at one place and reusing the configs over multiple MDBs?I've asked around (and checked the EJB spec), but I haven't found any way to do this.
Nigel -
How to check empty string and null? Assign same value to multiple variables
Hi,
1.
How do I check for empty string and null?
in_value IN VARCHAR2
2. Also how do I assign same value to multiple variables?
var_one NUMBER := 0;
var_two NUMBER := 0;
var_one := var_two := 0; --- Gives an error
ThanksMichaelS wrote:
Not always: Beware of CHAR's:
Bug 727361: ZERO-LENGTH STRING DOES NOT RETURN NULL WHEN USED WITH CHAR DATA TYPE IN PL/SQL:
SQL> declare
2 l_str1 char (10) := '';
3 l_str2 char (10) := null;
4 begin
5
6 if l_str1 is null
7 then
8 dbms_output.put_line ('oh STR1 is null');
9 elsif l_str1 is not null
10 then
11 dbms_output.put_line ('oh STR1 is NOT null');
12 end if;
13
14 if l_str2 is null
15 then
16 dbms_output.put_line ('oh STR2 is null');
17 elsif l_str2 is not null
18 then
19 dbms_output.put_line ('oh STR2 is NOT null');
20 end if;
21 end;
22 /
oh STR1 is NOT null
oh STR2 is null
PL/SQL procedure successfully completed.
SQL> alter session set events '10932 trace name context forever, level 16384';
Session altered.
SQL> declare
2 l_str1 char (10) := '';
3 l_str2 char (10) := null;
4 begin
5
6 if l_str1 is null
7 then
8 dbms_output.put_line ('oh STR1 is null');
9 elsif l_str1 is not null
10 then
11 dbms_output.put_line ('oh STR1 is NOT null');
12 end if;
13
14 if l_str2 is null
15 then
16 dbms_output.put_line ('oh STR2 is null');
17 elsif l_str2 is not null
18 then
19 dbms_output.put_line ('oh STR2 is NOT null');
20 end if;
21 end;
22 /
oh STR1 is null
oh STR2 is null
PL/SQL procedure successfully completed.
SQL> SY. -
Report generation same Logo in multiple pages
hi all
In NI report generation (word) , how can i generate same Logo(small image) in multiple pages.
I can able to generate Logo in single page. but i am looking for generating same Logo in multiple pages.HI
You can create the Word template file and place logo in header
Then generate report using word template file (you can use MS office Report express VI)
Hope this helps
Regards
Santosh -
Bapi_po_create1 is giving same system messages multiple time in the joblog
Hi Experts,
Bapi_po_create1 is giving same system messages multiple times in the job log when we ran the program in the background
can u plz suggest how to prevent these multiple appearances of same messages.
I am pasting the code below whn i ran this program in backgorund job log is having the messages.
Date Time Message text Message class Message no. Message type
08/06/2009 08:11:53 Job started 00 516 S
08/06/2009 08:11:53 Step 001 started (program ZZZTEST, variant &0000000000008, user ID BREDDY) 00 550 S
08/06/2009 08:11:54 Commitment plan contains no account assignment data MECP 020 S
08/06/2009 08:11:54 Commitment plan contains no account assignment data MECP 020 S
08/06/2009 08:11:54 Status "Initial Block" of material 20111 does not allow external procurement ME 053 E
08/06/2009 08:11:54 Status "Initial Block" of material 20111 does not allow external procurement ME 053 E
08/06/2009 08:11:54 Source not included in list despite source list requirement 06 722 E
08/06/2009 08:11:55 Pricing/euro: Attention: Euro Customizing not maintained VH 777 S
08/06/2009 08:11:55 Pricing/euro: Attention: Euro Customizing not maintained VH 777 S
08/06/2009 08:11:55 Status "Initial Block" of material 20111 does not allow external procurement ME 053 E
08/06/2009 08:11:55 Purchase order still contains faulty items MEPO 000 E
08/06/2009 08:11:55 Job finished 00 517 S
Edited by: bhavani prasad kotharu on Aug 6, 2009 3:09 PMHERE IS THE CODE OF THE PROGRAM, WE R JUST PASSING SOME PO DATA TO THE BAPI_PO_CREATE1,ON RUNNING THIS PROGRAM IN BACKGROUND SAME SYSTEM MESSAGES ARE APPEARED MULTIPLE TIMES,----
REPORT zzztest.
DATA : lwa_bapimepoheader TYPE bapimepoheader
,lwa_bapimepoheaderx TYPE bapimepoheaderx
,li_bapimepoitem TYPE STANDARD TABLE OF bapimepoitem
,lwa_bapimepoitem TYPE bapimepoitem
,li_bapimepoitemx TYPE STANDARD TABLE OF bapimepoitemx
,lwa_bapimepoitemx TYPE bapimepoitemx
,li_conditions TYPE STANDARD TABLE OF komv
,li_return TYPE STANDARD TABLE OF bapiret2
, n TYPE c
PARAMETERS: p1 TYPE c AS CHECKBOX.
IF p1 = 'X'.
lwa_bapimepoheader-doc_type = 'NB'.
lwa_bapimepoheader-purch_org = 'NA00'.
lwa_bapimepoheader-pur_group = 'C02'.
lwa_bapimepoheaderx-doc_type = 'X'.
lwa_bapimepoheaderx-purch_org = 'X'.
lwa_bapimepoheaderx-pur_group = 'X'.
lwa_bapimepoitem-po_item = '10'.
lwa_bapimepoitem-material = '000000000000020111'.
lwa_bapimepoitem-plant = 'CA01'.
lwa_bapimepoitem-vend_mat = '1000'.
lwa_bapimepoitem-quantity = '10'.
lwa_bapimepoitem-orderpr_un = 'M'.
lwa_bapimepoitem-no_more_gr = 'K'.
lwa_bapimepoitem-agreement = '4600000095'.
lwa_bapimepoitem-agmt_item = '10'.
lwa_bapimepoitem-pricedate = 'X'.
lwa_bapimepoitem-price_date = '20071030'.
lwa_bapimepoitem-no_rounding = 'X'.
APPEND lwa_bapimepoitem TO li_bapimepoitem.
lwa_bapimepoitemx-po_item = '10'.
lwa_bapimepoitemx-po_itemx = 'X'.
lwa_bapimepoitemx-po_itemx = 'X'.
lwa_bapimepoitemx-material = 'X'.
lwa_bapimepoitemx-plant = 'X'.
lwa_bapimepoitemx-quantity = 'X'.
lwa_bapimepoitemx-po_unit = 'X'.
lwa_bapimepoitemx-orderpr_un = 'X'.
lwa_bapimepoitemx-acctasscat = 'X'.
lwa_bapimepoitemx-agreement = 'X'.
lwa_bapimepoitemx-agmt_item = 'X'.
lwa_bapimepoitemx-pricedate = 'X'.
lwa_bapimepoitemx-price_date = 'X'.
lwa_bapimepoitemx-preq_no = 'X'.
lwa_bapimepoitemx-preq_item = 'X'.
lwa_bapimepoitemx-no_rounding = 'X'.
APPEND lwa_bapimepoitemx TO li_bapimepoitemx.
DATA: lo_msg_handler TYPE REF TO cl_message_handler_mm.
CALL METHOD cl_message_handler_mm=>get_handler
IMPORTING
ex_handler = lo_msg_handler.
lo_msg_handler->remove_all( ).
lo_msg_handler->cleanup( ).
CALL FUNCTION 'BAPI_PO_CREATE1' "in background task
EXPORTING
poheader = lwa_bapimepoheader
poheaderx = lwa_bapimepoheaderx
testrun = 'X'
NO_MESSAGING = c_x
NO_MESSAGE_REQ = c_x
no_authority = 'X'
IMPORTING
expheader = lwa_bapimepoheader
TABLES
return = li_return
poitem = li_bapimepoitem
poitemx = li_bapimepoitemx
conditions = li_conditions.
ENDIF.
Edited by: bhavani prasad kotharu on Aug 6, 2009 3:38 PM -
Printing Multiple Copies of Same Image on Multiple Pages
I have Photoshop Elements 11 on a Windows 8 platform. I can NOT get it to print multiple copies of the same file on multiple pages. I need one file printed on one page multiple times. I have tried the CTRL-ALT-SHIFT and nothing changes. It still just prints one and is done.
I use this for label printing, so I need it to print more than one copy at a time. It also is not saving the settings, so everytime I hit print, I have to readjust the print requirements. This just is not going to work when you need to print a few hundred copies at a time.You can create your own picture package, if none of the options in the PSE print window>Type of Print work for you. Just make a blank file, copy/paste your image and alt drag it to make multiple copies. You can use the move tool to position things as you want them.
Generally speaking, though, for something like label printing, it's simplest to use PSE to create the image, then use your word processing/desktop publishing program to print the actual labels. -
How to use rule and send the same email to multiple recipents
Hi,
My requirement is to send the workitem to the multiple recipents. one of my reiend suggest me to use the rule but i don't know how to use that .
can any one of you suggest me how to use rule in workflow.
Also i want to send the same email to multiple recipent .how can i do it by using the multiline variable...please advice me with example if possible..
Note :- Is it necessary to saparate the email id with comma or i will add all the email next one another..
Please suggest.
Thanks in advance ,
AnandHi Anand,
I would suggest you first follow the guidelines of the forum and a little searching. One of your questions has been asked just a few threads below.
Regards,
Martin
Maybe you are looking for
-
SQL statement using result of aggregate min function to fetch a row - how?
Need help trying to get to something seemingly simple. I'll provide a simple example to illustrate the problem. I'll be using a simple addresses table with 4 fields. Create the table: CREATE TABLE "ADDRESSES" ( "OWNER_NAME" VARCHAR2(20 BYTE)
-
Error when trying to compile with cos.jar
When compiling on linux/tomcat machine I put the path to cos.jar in my javac command and get the following error: .../cos.jar: cannot execute binary file I can compile servlets that do not require this jar file but cannot compile servlets that need i
-
Somehow, my Maps app is missing on my home screen. It only appears when I double tap the home button, and then it appears at bottom of screen with all the recently opened apps. Any way I can get it back on the home screen where it was when I bought t
-
Help to know abt standard print program
Hi, I am working in billing.In NACE,i went to V3-Billing and check inside the RD00.There in the processing routines some zprogram is there. Now i need to check out the print format of this,How to execute this and i also need to know which is the stan
-
AS2 setMask: can a mask be a movie clip composed of child movieclips?
Hi, I create dynamically a empty movieclip and attach to it several movieclips symbols from the library and call it "mcMask". Then I try to mask another dynamicaly created movieclip called "mc" using : mc.setMask(mcMask). But it only partially works