- Local JNDI Lookup (EJB3)
- Custom JNDI Names (EJB3)
- MDB3.0 Application in WLS
- EJB3.0 Dependency Injection In Servlet
- Securing EJB2.x Stateless Using RunAs
- EJB3.0 (Stateless) TimerService
- Generating EJB3 ClientJar using APPC Utility
- EJB3 WebLogic10.3 and Generics Issue
- Resource DataSource Injection in EJB3
- MDB With Non-Container-Specific-Annotations
- Tuning EJB3 Application using Plan.xml
- MDB Starting before the Server resource Activation
- Calling EJB3 to EJB3 Locally using @EJB Annotation
February 4th, 2010 on 5:54 pm
Hello Jaysen,
I have read your postings through Oracle forums and they have been very helpful.
Though I am stuck at the following issue, not sure if I am supposed to raise it here and I am sorry for that. The issues is: –
Not able to lookup EJB3 session bean from a JSF Managed bean. Lookup fails with NullpointerException. It seems abcRemote is not accessible.
If I do JNDI lookup for the remote interface as following, it works.
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, “weblogic.jndi.WLInitialContextFactory”);
props.put(Context.PROVIDER_URL, “t3://localhost:7001”);
InitialContext ctx = new InitialContext(props);
abcRemote = (ABCRemote)ctx.lookup(“abcRemote#com.def.im.ejb.ABCRemote”);
But it doesn’t work as following, which ideally should?
I am using Weblogic 10.3.
JSF Managed Bean: –
public class ABCController {
@EJB private ABCRemote abcRemote;
public String getHospital() {
List list = abcRemote.getProductList();
}
}
Stateless Bean: –
@Stateless(name=”abcLocal”,mappedName=”abcRemote”)
@TransactionManagement(TransactionManagementType.CONTAINER)
public class ABCSessionBean implements ABCLocal, ABCRemote {
public List getHospitalList(){
IABCDAO abcDAO = new ABCDAO();
List list = abcDAO.getProductData();
return list;
}
}
Interfaces: –
@Remote
public interface ABCRemote {
public List getProductList();
}
@Local
public interface ABCLocal {
public List getProductList();
}
Also – I tried looking up ejb from a servlet and it works. Could you please throw some insight?
Thanks!
February 4th, 2010 on 8:13 pm
Hi Abc79,
The Dependency injection has some limitations as well…Please referto the following link: (Web Component Classes That Support Annotations)http://download.oracle.com/docs/cd/E13222_01/wls/docs100/webapp/annotateservlet.html…which says that DI is not possible from every web component…In your case you are trying to Inject EJB in a Plain Java Class…Which is wrong.
I have developed a Sample which will demonstrate that How it is possible in Servlets and Why it is not possible in a Plain Java Class..Please refer to the following Link and Download the TestCase: http://www.4shared.com/file/215158731/fbeca645/Injection_In_PlainJavaClass.html ”
Injection_In_PlainJavaClass.zip”
Keep Posting 🙂
Thanks
Jay SenSharma
February 5th, 2010 on 3:31 pm
Thanks Jay. Your examples are always helpful.
One more question – According to EJB 3.0 spec, DI should work in any web component as long as it is in a managed environment( more specifically in the same container?)
So, in this case – the JSF managed bean, is the part of the same .ear file or can be said is part of the same container? If yes, then DI should work?
Also – one more thing that confused me is – it works from a servlet which also runs in the web server like a managed bean does, then why is it partial that DI works in a servlet and not a POJO?
Thanks again for your time.
February 5th, 2010 on 4:06 pm
Hi ABC79,
I am not sure about the specification but…In weblogic Container the class “weblogic.servlet.WeblogicServletContext” is actually responsible for the annotations to be processed…May be weblogic has not implemented this feature. But if you are sure that EJB DI specification 14.5.2 allows that EJB injection should be possible even from POJO classes…then We can maximum file an “Enhancement Request” with Oracle WebLogic Support, it cannot be treated as BUG because in the Document they have clearly mentioned that WebLogic supports @EJB injection for the given list of components only….mentioned in the link: http://download.oracle.com/docs/cd/E13222_01/wls/docs100/webapp/annotateservlet.html
Keep Posting 🙂
Thanks
Jay SenSharma
April 10th, 2010 on 3:45 am
Hi, there I have a problem injecting a local EJB bean (3.0) in my web service which is also a stateless session bean. I’ve looked at your example injecting using a servlet. Tried that with no success. I’ve tried almost all combination I can think of but no success. Using wls 10.3.2, and below the code to explain better.
Here’s the business interface:
public interface AccountService {
public double getBalance(int accountId);
}
Here is the Stateless EJB
@Local
public interface AccountEJBLocal extends AccountService {
}
@Remote
public interface AccountEJBRemote extends AccountService {
}
@Stateless(name=”AccountBean”)
public class AccountEJBImpl implements AccountEJBLocal, AccountEJBRemote {
public double getBalance(int accountId) {
// return the account balance
return 0.00;
}
}
@Stateless
@WebService(name = “AccountPortType”,
serviceName = “AccountWSService”,
targetNamespace=”http://account.jws.pp.starcomsoft.com”)
public class AccountWSImpl {
// Different combination tested
/*
* Does not work
* @EJB(name=”AccountService”)
* private AccountEJBLocal ejbLocal;
*/
/*
* Does not work
* @EJB(name=”AccountBean”)
* private AccountEJBLocal ejbLocal;
*/
// or from your example
@EJB AccountService service;
// or this does not work
//@EJB AccountEJBLocal ejbLocal;
}
The only way that works with me right now is using a weblogic-ejb-jar.xml and web.xml and to do a lookup thru InitialContext.
What am I doing wrong or any help or suggestion is welcome.
Thanks
April 14th, 2010 on 12:40 am
(1) Injecting an ejb3 in my jaxws webservice (also implemented as a stateless session bean) is not working in wls 10.3.2. My sample scenario was mentioned in my previous post above. I tried adding the weblogic-ejb-jar.xml and web.xml, but no success. I tried adding an ejb-jar.xml (3 version), but the deployment failed because getting an error of “In EJB AccountBean, both the remote home and remote component interface must be specified. Currently, only one of them is specified”. It looks like if I use the ejb-jar.xml deployment it’s still thinking ejb2.x version even though I got the right descployment schema space, so what’s up with that one. Below is my ejb-jar.xml descriptor:
AccountBean
com.starcomsoft.pp.ejb.account.AccountEJBRemote
com.starcomsoft.pp.ejb.account.AccountEJBLocal
com.starcomsoft.pp.ejb.account.AccountEJBImpl
Stateless
Bean
2. Also if I don’t create a weblogic-ejb-jar.xml & web.xml for my ejb3 beans (local & remote), when I deploy I couldn’t see the bean’s in the wls admin console deployment window neither or it shows on the JNDI tree.
I don’t what I’m doing wrong or not doing. I’m really stuck on this one, any help or suggestion are really needed.
thanks.
April 14th, 2010 on 12:42 am
I think my post got messed-up. Reposting …
(1) Injecting an ejb3 in my jaxws webservice (also implemented as a stateless session bean) is not working in wls 10.3.2. My sample scenario was mentioned in my previous post above. I tried adding the weblogic-ejb-jar.xml and web.xml, but no success. I tried adding an ejb-jar.xml (3 version), but the deployment failed because getting an error of “In EJB AccountBean, both the remote home and remote component interface must be specified. Currently, only one of them is specified”. It looks like if I use the ejb-jar.xml deployment it’s still thinking ejb2.x version even though I got the right descployment schema space, so what’s up with that one. Below is my ejb-jar.xml descriptor:
”
AccountBean
com.starcomsoft.pp.ejb.account.AccountEJBRemote
com.starcomsoft.pp.ejb.account.AccountEJBLocal
com.starcomsoft.pp.ejb.account.AccountEJBImpl
Stateless
Bean
”
2. Also if I don’t create a weblogic-ejb-jar.xml & web.xml for my ejb3 beans (local & remote), when I deploy I couldn’t see the bean’s in the wls admin console deployment window neither or it shows on the JNDI tree.
I don’t what I’m doing wrong or not doing. I’m really stuck on this one, any help or suggestion are really needed.
thanks.
April 15th, 2010 on 11:25 pm
I’m using wls 10.3.2, what is the use of wlappc for ejb3. I can compile the ejb3 and deploy it and use it without using the wlappc for my ejb3 beans. Can anyone clarify for me what’s the real use of wlappc.
Thanks
April 15th, 2010 on 11:33 pm
Hi Jun,
wlappc is a Tool which is used by the WLS as soon as wedeploy any Application EJB(JAR), WebApp(WAR) or EAR. This tool basically generates the Artifacts like in case of EJBs it generates stub/skeletons etc…In Case of Web Applications it Compiles our JSPs and it does the Actual mapping and resolution of Tag Libraries.
If we dont use APPC on our Application…and directly deploy it on WLS server …then That time WLS runs this tool internally to perform the Tasks mentioned in First Paragraph. Which Consumes more time …specially in case of Production envs we want that deployment time should be reduced and the server resources should be purely working on the Request processing task rather that compiling the resources.
Thats is the reason …It is recommended that we Precompile the Applications using APPC to reduce the Burdon on the Server at the time of deploying the Applications….Thats why it is recommended in production scenarios that we use APPC to precompile the Applications.
Jun I am very sorry …because i could not reply your previous post on @EJB injection inside WebService….Because i am also stuck in that…I will update you soon ..as soon as i will be able to do that. If you willl be able to do it ..then please update me as well.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
April 22nd, 2010 on 4:17 am
My mistake is on the weblogic-ejb-jar.xml and make sure it’s in the META-INF folder where your ejb classes are. Adding ejb-jar.xml is not necessary, the DI work either with local or remote ejb’s being called from a web service. Also I’m using wls10.3.2 (11g) therefore all descriptors are using xml schema (xsd) instead of dtd, so make sure you got the correct headers for your descriptors. Hope this help somebody (but right now stuck on work manager stuff).
Below is the corrected descriptor that is working for me.
[?xml version=”1.0″ encoding=”UTF-8″?]
[weblogic-ejb-jar xmlns=”http://xmlns.oracle.com/weblogic/weblogic-ejb-jar”
xmlns:j2ee=”http://java.sun.com/xml/ns/j2ee”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://xmlns.oracle.com/weblogic/weblogic-ejb-jar
http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd“]
[weblogic-enterprise-bean]
[ejb-name]CustomerBean[/ejb-name]
[stateless-session-descriptor]
[pool]
[max-beans-in-free-pool]100[/max-beans-in-free-pool]
[initial-beans-in-free-pool]10[/initial-beans-in-free-pool]
[/pool]
[/stateless-session-descriptor]
[transaction-descriptor]
[trans-timeout-seconds]180[/trans-timeout-seconds]
[/transaction-descriptor]
[ejb-reference-description]
[ejb-ref-name]ejb.CustomerService[/ejb-ref-name]
[jndi-name]ejb.CustomerBean[/jndi-name]
[/ejb-reference-description]
[enable-call-by-reference]true[/enable-call-by-reference]
[dispatch-policy]CustomerWM[/dispatch-policy]
[remote-client-timeout]0[/remote-client-timeout]
[/weblogic-enterprise-bean]
[weblogic-enterprise-bean]
[ejb-name]AccountBean[/ejb-name]
[stateless-session-descriptor]
[pool]
[max-beans-in-free-pool]100[/max-beans-in-free-pool]
[initial-beans-in-free-pool]10[/initial-beans-in-free-pool]
[/pool]
[/stateless-session-descriptor]
[transaction-descriptor]
[trans-timeout-seconds]180[/trans-timeout-seconds]
[/transaction-descriptor]
[ejb-reference-description]
[ejb-ref-name]ejb.AccountService[/ejb-ref-name]
[jndi-name]ejb.AccountBean[/jndi-name]
[/ejb-reference-description]
[enable-call-by-reference]true[/enable-call-by-reference]
[dispatch-policy]AccountWM[/dispatch-policy]
[remote-client-timeout]0[/remote-client-timeout]
[/weblogic-enterprise-bean]
[work-manager]
[name]CustomerWM[/name]
[/work-manager]
[/weblogic-ejb-jar]
April 20th, 2010 on 4:45 am
Do you have an example of ejb-jar.xml for wls 11g (using schema instead of dtd). I tried looking for some example for wls 11g and have not found one. So a good sample will help a lot.
Thanks
April 20th, 2010 on 2:35 pm
Hi Jun,
You can try the following to generate the Correct “ejb-jar.xml” file.
First develop a EJB application with Annotations….then compile it and make a Jar Like: “SFSB_EJB3.jar”
Now
To generate the Deployment descriptors from the Jar “SFSB_EJB3.jar” we can use the following “weblogic.appc” Attribute:
java weblogic.appc -source 1.5 -output OUTPUT -writeInferredDescriptors SFSB_EJB3.jar
You will find thet OUTPUT directory is created in the current Directory with the Correct DDs.
Keep posting 🙂
Thanks
Jay SenSharma
May 28th, 2010 on 7:13 am
I’m relatively new to Weblogic, most of my experience has been with JBoss. I have an EAR file that contains 25 jars and each one of them contains an EJB. When I deploy the application, the PermGen grows to > 550 MB and jconsoles lists 170,000 classes. If I take the same applicaation an repackage my EJBs into a single jar in the EAR file, then PermGen only grows to 338 MB and jconsole list 119,000 classes loaded. I’m using the JVM from jdk1.6. Any idea why this would happen?
I left a similar question at the Weblogic forum, but this is an urgent problem and this seems to be “thee place” to get the answers 😉
May 28th, 2010 on 11:57 am
Hi Vinny,
I saw your posting in “http://forums.oracle.com/forums/thread.jspa?threadID=1078802&tstart=0” but could not reply bcoz i dont have any immediate solution for that. I m planning to write a simple reproducer in order to see the issue at my end.
I will definately update you as soon as i will get some useful informations regarding this.
Just a Query: Do u have some Duplicate classes in these JArs….which is common in some other Jars as well?
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
May 28th, 2010 on 6:03 pm
Thanks for the quick response. That was the first thing that I checked, but there were no duplicates. Even if there were, wouldn’t they all get loaded by the same classloader and thus duplicates would be eliminated?
-Vinny
May 28th, 2010 on 9:02 pm
Hi Vinny,
Every application has it’s own classloader. Which is called as Application ClassLoaders. So if suppose there are 4 classes commonly present in 4 Different EJB-Jars deployments then the class will be loaded 4 times.
But if we place those Jars as part of an EAR application then Application Classloader will detect the ModuleClassloader are already having some classes loaded or not…if yes then the classes will be unloaded and reloaded from the correct classloaders.
In WebLogic we have a Concept of classLoader filtering …that feature is totally based on the concept of:
BootStrapClassLoader
SystemClassLoader (includes BootStratClassloader+extended Dirextory ClassLoader)
ApplicationClassLoader
Module ClassLoaders
http://download.oracle.com/docs/cd/E11035_01/wls100/programming/classloading.html
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
June 3rd, 2010 on 12:59 am
Thanks. All of this sounds good, but from what I’m seeing things don’t seem to be working as advertised. The latest that I’ve seen is that when the EJBs are deployed within an EAR file but in multiple jars, the trace (using TraceClassLoading) shows the classes loaded 20+ times each and I don’t see them unloaded (using TraceClassUnloading) When the EAR file is deployed with all of the EJBs within a single jar, I still see the classes loade multiple times, but quite a bit less (6x). I used jmap to dump the heap and I’m using jhat to analyze it, but I’m not sure that I have the correct query to find the duplicate classes.
Any additional input would be greatly appreciated.
Thanks,
Vinny
June 9th, 2010 on 10:55 pm
Hi Jay,
The more that I look into this, the more it looks like the problem is related to a leak in the PermGen memory. The classes are being loade mulitple times and when I have a simple application without a leak then the duplicates are unloaded. So far, I’ve noticed that having an EJB with a remote interface causes a leak. Using a webservice built use JAX-WS also seems like it introduces a leak. Have you had any experiences similar to this?
Thanks,
Vinny
October 15th, 2010 on 1:09 pm
Hi Jay,
I wish to move my applications from OC4J to WLS10.3.3.
Could you provide me some informational links for the same.
Regards,
Vicky
October 15th, 2010 on 9:08 pm
Hi Vicky,
Migration from OC4J to WebLogic10.3.3 … will depend on what kind of application u have. And what all OC4J specific deployment descritors u have inside your application. There is no fixed step mentioned/available to achieve the same. Because it depends on nature/technology used in application.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
December 26th, 2010 on 10:08 pm
Hi,What is the best way of load balancing between clustered weblogic servers and EJB Stub?Thanks is advance.
December 26th, 2010 on 11:40 pm
Hi Adrian,
Weight Based Algorithm and Random and their Affinity based Algorithms are specially designed for RMI based implementations (EJB falls into this category) and those are managed By WebLogic specially using t3 protocol. Round-Robin (Default) is the default Load Balancing algorithm applied to the Cluster. Based on your requirement you can chose any of the algorithm.
Random Algorithm is the very less used and less useful algorithm. Any request can fall on any server.
Weight Based algorithm for loadbalancing is used when some of the WLS Server Boxes are more efficient and powerful compared to other Nodes of the Cluster. So in that case we give some weight to the cluster members for load balancing. like 40%,30%,30% load.
For homogeneous systems (where all the Managed Server Boxes has the same power) we must chose the default load balancing algorithm (Round Robin)
The above configuration we need to do from WLS Side… Means chosing the right LoadBalancing algorithm.
But at client side we need to just write the following code to get the Clustered Initial Context….pass the ClusterAddress to the PROVIDER_URL
String clusterAddress=”t3://ManagedServer1:7003,ManagedServer2:7005,ManagedServer3:7009″;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,”weblogic.jndi.WLInitialContextFactory”);
ht.put(Context.PROVIDER_URL,clusterAddress);
ht.put(Context.SECURITY_PRINCIPAL,ar[0]);
ht.put(Context.SECURITY_CREDENTIALS,ar[1]);
.
.
Keep Posting 🙂
Thanks
Jay Sensharma
January 27th, 2011 on 6:55 pm
Hi,
I am migrating one of the wls application from wls8.1 to wls10.3
In this process i have
1)Wrote new Webservices files *Impl.java files with Annotations and generated the jar file for webservices of type JAXRPC using jwsc
2)Then generated client files using clientgen @ task
3)Among the three EJB’s,i have changed code in Session Beans and Message Driven beans to new EJB3.0 using annotations and removed Local Interface.
4)Did not change Entity Beans to new EJB3.0,They are same as there where with DAO and TO objects.
5)In Web modules where ever there were import *Home,i have added private @EJB
Questions:
Is the above approach good.
How do i compile EJB’s [javac/wlappc?] and how is the code generated for annotated files.
How to i get deployment decsriptors like application.xml and weblogic-application.xaml,
i thought they are generated automaticaly and read they are not required?
Please advice.
January 27th, 2011 on 9:36 pm
Hi Sureshadapa,
Is the above approach good.
Due to backward compatibility it is possible to run the WLS8.1 Application directly to WLS10.3…Though it is not recommended. Yes, the above approach which you are using is good and recommended. Except one thing….As you are converting all your EJBs to EJB3 using annotation …it is good to have your Entity beans converted to Persistence Units as well.. Because in many cases you will see that mixing EJB2.x and EJB3 in the same application causes many issues. You can see many discussions on this causes issues.
How do i compile EJB’s [javac/wlappc?] and how is the code generated for annotated files.
EJB3 applications do not require XML Deployment descriptors rather you can use annotations to define the descriptions using Deployment descriptors only. Using Standard Deployment descriptors makes your EJB3 application more compatible so that in future you can directly move to any other J2EE Specific Application Server without making any changes in your Application.
So from container (WLS) side you need not to use any special compiler to compile your EJB3 application. You need to just use the simple “javac” compiler to compile your EJB3 classes. You will require the “weblogic.appc” compiler only to generate the clientside artifacts as described in the following link: http://middlewaremagic.com/weblogic/?p=854
How to i get deployment decsriptors like application.xml and weblogic-application.xaml, i thought they are generated automaticaly and read they are not
required?
Some deployment descriptors are mandatory for a valid J2EE application like EAR file must have at least “META-INF/application.xml” file similarly a Valid WebApplication must have atleast a “WEB-INF/web.xml” file. For EJB3.0 Applications it is optional to provide any deployment descriptors. Please refer to the following link for more details: http://middlewaremagic.com/weblogic/?p=1952
As you have mentioned that you are using JAXRPC based webservices in your application then it is required to use “JWSC” to build and archive your WebService components…and to generate required Deployment descriptors. Similarly “CLIENTGEN” utilities to required for your Clients to run on the WSDL file sothat they can get the Client Side artifacts to invoke your WebServices …for more information on WebServices please refer to: http://middlewaremagic.com/weblogic/?page_id=131
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
April 12th, 2011 on 10:12 pm
Hello Jay,Ravish and Rene,
I gives me great pleasure in becoming a member of middleware magic, impressive work from you all.I have learnt a lot from this place and also recommended to my peers.
I have an issue.
I am using WL 10.0 , Java 5 on SunOS.
I have a foreign server configured (IBM MQ) . In one of the stateless EJBs, i see there are idle beans even when there are messages in the queue that have to be processed. What could be the problem?
Thank you,
Manish
May 18th, 2011 on 10:50 pm
####
#### <> <Error publishing a Diary Creation event: EJB Exception: : java.lang.NullPointerException
We are getting the above error in 1 of our production server, but not in the other servers which are in the same cluster . Can you please through some light on this. Thanks
July 30th, 2011 on 3:13 am
Hi Jay,
I know i’m a bit late to the party, but there is an issue i’m loosing my mind over nd i’m hoping you can help me out !
I am upgrading an application from EJB2 to EJB3
We have a Stateless Session EJB exposed as a web web service. This was being compiled by the jwsc ant task and resulted in an EJB.
After migrating to EJB3, the same web service using the same ant task no results in a war file.
Please let me know how i can get jwsc to create a jar file using the EJB3 specification please.
Code provided below :
package com.qwest.online.services.business.facade;
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL, parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
@WLHttpTransport(contextPath=”AMWS”, serviceUri=”AMWebSvc”, portName=”AMWebSvcPort”)
@WebService(name=”AMWebSvcPortType”, serviceName=”AMWebSvc”, targetNamespace=”http://com/qwest/amws/services/business/facade”)
@Stateless (name=”AMWebSvcMgr”, mappedName=”AMWebSvcManager”)
@Remote(AMWebSvcRemote.class)
@Local(AMWebSvcLocal.class)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@TransactionManagement(TransactionManagementType.CONTAINER)
@JNDIName(value=”AMWebSvcManager”)
@CallByReference
public class AMWebSvcManager implements AMWebSvcLocal, AMWebSvcRemote
{
/**
* @ejb:interface-method view-type=”remote”
* @ejb:transaction type=”NotSupported”
* @ejb:transaction-type type=”Container”
*/
@WebMethod(operationName=”process”)
public String process(String message, String operation)
{
return (new OnlineSvcManagerHelper()).process(message, operation);
}
}
Any help you can provide me regarding this will be much appreciated !
Thanks a lot
Sanat
July 30th, 2011 on 3:28 am
Hi Sanat,
Your WeService Annotations looks good and JWSC Task will always create a JAR file inside an EAR if your WebService is built using EJB Annotations (Means for an EJB Based WebService the JWSC Task creates an exploded Enterprise Application directory that contains the JAR file). So please refer to the ANT Script mentioned in the following article which might be useful.
http://middlewaremagic.com/weblogic/?p=107
NOTE-1): the ejb-gen based annotations (like @ejb:transaction type=”NotSupported”) will be ignored which you are using in your WebService program because ejb-gen annotations are based on EJB2.x and those annnotations are WebLogic specific, Where as JAXWS supports standard annotations…so you can not mix them.
NOTE-2). Also you need not to provide the following annotations @Remote(AMWebSvcRemote.class), @Local(AMWebSvcLocal.class), @JNDIName(value=”AMWebSvcManager”) Because When an EJB is published as WebService then there is no need to access them through Remote/Local interfaces.
NOTE-3). When an EJB is published as a WebService then the Transaction control mechnism is little different so you need to handle transactions at WebService Level Not at the EJB Annotation Level…So remove @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED), @TransactionManagement(TransactionManagementType.CONTAINER)
NOTE-4): Your EJB Based WebService need not to implement implements AMWebSvcLocal, AMWebSvcRemote. So remove them. Transactions can be defined at WebService level using it;s own annotations or using “weblogic-webservice.xml” file transport-guarantee tags as described in the following link: http://download.oracle.com/docs/cd/E12840_01/wls/docs103/webserv_ref/dd.html
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
September 1st, 2011 on 7:37 pm
Hi Jay,
Could you please check this error, i see many instances of this error in my logs. Do you have any suggestions? Thank you.
#### <> <E
JB Exception occurred during invocation from home: com.ibm.maersk.hermes.scheduler.service.impl.ScheduleManager_hjoiio_LocalHomeImpl@e3f88 threw exception: javax.ejb.Transa
ctionRolledbackLocalException: EJB Exception: ; nested exception is: javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested exception is: weblogic.transacti
on.internal.TimedOutException: Transaction timed out after 101 seconds
Thank you
Manish
February 28th, 2012 on 4:13 am
hi ,
we are facing an issue while doing a remote EJB lookup.
Here is what we are doing…
we have a jsp running on weblogic node and as part of this jsp we are doing a remote EJB lookup. we will use the url to talk to other weblogic nodes running on different servers and different domain, once the t3 conenction has been established it will look for a EJB on that remote weblogic server and it is failing here. i looked at the JNDI tree of that remote weblogic server and i see that EJB in that JNDi but still jndi lookup is failing.
Here is the toString Results: from JNDI tree .
ClusterableRemoteRef(-3200183952821550049S:10.32.1.11:[12252,12252,-1,-1,-1,-1,-1]:ftcommon:remotenode11 [-3200183952821550049S:xx.xx.xx.11:[12252,12252,-1,-1,-1,-1,-1]:remotedomain:remotenode11/282])/282
May 11th, 2012 on 4:08 pm
Hi Jay,
I have the below issue, where we are really close to migration and found that in our negative testing.
Migrating from weblogic91 to weblogic10.3.5, also deploying a Exploded EAR type deployment.
This issue started when we migrated to Exploded Ear deployment in weblogic11 builded with ANT script. This was not happening in our previous weblogic91 which is deploying the jars and wars builded using Make script.
We have deployed all applications as jar file in weblogic 9.1 but deploying as one ‘ear’ file in weblogic 10. In both we are using EJB 2.0.
We have problem now when an operation for example have 5 things to do in a sessioon bean call. with 9.1 if any of the things failed then the whole thing was rolling back.
But with weblogic 10, if let’s say 4th or 5th fails, it is not rolling back 1st, 2nd or 3rd items for the same operation.
This is the core problem cause it is leaving iincomplete footprint in database.
Below is our environment:
Weblogic 10.3.5
Jdk1.6_0_25
sybase15
Solaris sparc 64bit
Deployment Type: Exploded EAR
Build Tool: Ant
Ejb Jars generated: weblogic.appc
Please shed some light on this.
Thankyou
Deepa
December 11th, 2012 on 5:03 pm
Embedded EJB Container (https://forums.oracle.com/forums/thread.jspa?messageID=10463343)
Some info can be found here: http://docs.oracle.com/cd/E24329_01/web.1211/e24972/embedejb.htm#EJBAD1403, also note here the EJB 3.1 Lite Functionality Supported in the Embedded EJB Container.
This link http://docs.oracle.com/javaee/6/tutorial/doc/gkcrr.html tells:
Running Embedded Applications
The embedded container, the enterprise bean components, and the client all are executed in the same virtual machine using the same classpath. As a result, developers can run an application that uses the embedded container just like a typical Java SE application as follows:
java -classpath mySessionBean.jar:containerProviderRuntime.jar:myClient.jar com.example.ejb.client.Main
In the above example, mySessionBean.jar is an EJB JAR containing a local stateless session bean, containerProviderRuntime.jar is a JAR file supplied by the enterprise bean provider that contains the needed runtime classes for the embedded container, and myClient.jar is a JAR file containing a Java SE application that calls the business methods in the session bean through the embedded container.
http://docs.oracle.com/javaee/6/api/javax/ejb/embeddable/EJBContainer.html
The containerproviderruntime.jar in WebLogic is called wlclient.jar (which contains a /javax/ejb/embeddable/EJBContainer.class).
The wlclient.jar is located in the MIDDLEWARE_HOME/wlserver_12.1/server/lib directory.
The weblogic.jar contains a provider implementation:
It is better to create a fullclient jar (http://docs.oracle.com/cd/E17904_01/web.1111/e13717/jarbuilder.htm#BABCGHFH) – instead of looking for the classes you will constantly be missing.
And does this work in practice, no it does not, it throws the following exception
June 3rd, 2013 on 3:37 pm
HI,
We are using weblogic 11g(10.1.3.6) and a clustered environment.. if we deploy an ejb targeting ejb on one managhed server the jndi name is created for the ejb in all the managed servers in the cluster. how to restrict it??