It is possible to convert all this in Annotation @Resource?
I mean, i dont want to create de DD, and if i use the @Resource i can replace all that xml?
Not sure if it is Fixed in WLS10.3 and Later versions or not….But i have tested it in WLS10.3 …and Seems it is not yet fixed. So Please get the Patches from Oracle Support.
Hi Jay,
Thanks for your inputs. I have received the same patch from Oracle for Weblogic 10.0 MP1 and it does not seem to work with the client code. Do we need to set some additional properties in the server classpath to make the patch work. I came across the below properties at an Oracle Forum – http://forums.oracle.com/forums/thread.jspa?messageID=2928773
weblogic.IdleConnectionTimeout
weblogic.iiop.IIOPIdleConnectionTimeout
However the above Java options are also not working.
Any ideas?
Hi Jay,
Thanks for your help. I am working with Oracle Support on the same issue. They have classified the issue as in internal bug making the bug report not accessible. I will provide all the relevant information on the bug and the patch as soon as I have some information available from Oracle Support.
I have an EJB that get data from and Oracle 8i database and after receive the data call a stored procedure in Oracle 11gR2 that made 2 inserts. But i get this excpetion when i try to call the procedure.
2010-08-24 10:41:44,185 2497 [[ACTIVE] ExecuteThread: ‘8’ for queue: ‘weblogic.kernel.Default (self-tuning)’] ERROR com.btick.ejb.db.MauSqlMapClient – excepcion al intentar ejecutar statement [CLIENTS.RegistrarMovimientos]
java.sql.SQLException: Connection has already been created in this tx context for pool named ConnPoolClient. Illegal attempt to create connection from another pool: ConnPoolStore
at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:608)
at weblogic.jdbc.jts.Driver.connect(Driver.java:127)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:339)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:566)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:541)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:83)
at com.btick.ejb.db.EntelSqlMapClient.queryForObject(MauSqlMapClient.java:150)
at com.btick.ejb.archivos.SyniverseBean.persistData(SynBean.java:127)
at com.btick.ejb.archivos.SyniverseBean.persist(SynBean.java:121)
Can u help me how to solve this?
I tried using differents oracle drivers but i got the same error. Is this an EJB problem or its a problem with the DataBases?
In EJBs we set different types of Transactional Attributes in the Deployment Descriptors “ejb-jar.xml” like Required, Never, Mandatory, Supports, Requires New….etc
If you are using a Tx Jdbc Driver and inside your EJBs if you will try to create a Connection Object from Different DataSources then you will get this kind of exceptions. In One Transational Context seems your application is trying to get Connections from Two DataSources…. OR There are Two EJBs which are trying to get a Connection Object from the same DataSource in the Same Transactional Context.
Not sure whether setting EJB Transactional attribute “Supports” will suit your Application requirement or not….But you can try setting the Transactional Attribute of your application…just for testing. I think tunning right kind of Transactional Attributes or Choosing a Non-Tx Jdbc Driver (DataSource) will help to resolve the issue.
Greeeeaaaaat!!! Thanx Jay…. that solved my problem… i can call the stored procedure now!!
I put the attribute “Supports” in the ejb-jar.xml 😀
Thanx so much Jay!
Hello Jay, i have a Question about EJB and Web clients of this EJB
Suppose i have my EJB in my weblogic server and i want to have different clients for it, some of them in the same weblogic server and some others in different app servers.
How it works for them to accessing to my EJB? Should i give them something, like the .jar of my EJB? Or should i just give them the remote interfaces and some entities that they need to have because some of my methods return List of entities lik: public List getAllUsers();
It would be great if u can explain how it works for this 🙂 Than so much in advance
Hi Mgaldames, In Case of Pure EJBs
If you are talking about Pure EJBs then yes you must provide the Client Side Artifacts to the Client. These Client Side can be generated by the EJB Developer using the “weblogic.appc” utility as described in :http://middlewaremagic.com/weblogic/2010/04/02/generating-ejb3-clientjar/
In Case of EJB based WebServices
If you have converted your EJBs into WebServices…or If you have developed a EJBBased WebService then …you need not to provide any thing to the Clients except the WSDL file. WSDL file contains all the required definitions ..Based on that they can generate any kind of Client Side artifacts . Example: Clients can take the WSDL and they can use “clientgen” tool to generate the ClientSide Artifacts of type “JAXWS” or “JAXRPC”…or they can use Axis utilities to generate Client Artifacts…Because in Case of WebServices the Communication between Client and Server happens on HTTP protocol which is not Container Specific. But the EJB Artifacts uses RMI Calls which are requires container specific Stubs and Skeletons.
Thanx for the reply Jay… i have an issue now that i need to deploy my app in other WLS 10.0 MP2 server.
When i deploy the application in my local develop environment (WLS 10.0 MP2) all its ok. Then i made the deploy in the develop server of my client and the app is running… but when i try a servlet that connect with an EJB 3.0 via remote interface i get this issue
#### <> <[weblogic.servlet.internal.WebAppServletContext@350fa3f – appName: 'AlertsRoaEar', name: 'alertsRoaWeb', context-path: '/alertsRoaWeb'] Servlet failed with Exception
javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:83)
at $Proxy77.consultarCostoReferencial(Unknown Source)
at com.comp.fact.web.request.ProcesaAdmin.solicitudCostos(ProcesaAdmin.java:40)
at com.comp.fact.web.request.ProcesaRequest.solicitudParametros(ProcesaRequest.java:60)
Can u help to understand why is this problem in that server? the difference between my server and that is that client server has 2 clusters in the server (at the same machine). In the other hand i have just the default server in my local Weblogic server.
Hi Mgaldames,
You need to check the 40th Line of the Method solicitudCostos() of ProcesaAdmin.java
NullPointerException indicates that some object is becoming NULL. Even if the same application is Working in One of your Local Development Setup…It means your Program is somehow dependent on your Previous environment…Or may be it is trying to get the EJB Object from a Wrong Servers JNDI Tree…
That can be easily found once we will be able to findout which Object is actually becoming NULL….By putting some Debug or System.out.println Statements inside the “solicitudCostos()” Method.
I made some changes and now i can be able to get into the ejb container but i get another exception… i guess is because null data (but i am passing real data 🙁 )
What im doing is this… get into a servlet and select a combo box and send that value to the EJB and i can get a StringBuffer with a html table with a list of mails. This is Ok in my local but when i run in the client server i get this new error
#### <> <EJB Exception occurred during invocation from home: weblogic.ejb.container.internal.StatelessEJBHomeImpl@3dc3ec0 threw exception: java.lang.NullPointerException
java.lang.NullPointerException
at com.comp.fact.ejb.admin.WebParamsAdminBean.verMailListInputDisabledBox(WebParamsAdminBean.java:240)
at com.comp.fact.ejb.admin.WebParamsAdminBean.consultarDestinatarios(WebParamsAdminBean.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
I yet dont have access to the client machine so i can not see logs generated by the app… i just can watch the server domain log and that i s wath i posted to you.
Hi Mgaldames
The Above issue is very much Application specific… And Even the Null Pointer is coming from the Application code…”com.comp.fact.ejb.admin.WebParamsAdminBean.verMailListInputDisabledBox(WebParamsAdminBean.java:240)” … Your Application is missing some resources… The only way to debug this issue is to put some debug codes inside the Application to find out wich object is becoming NULL.
I am not saying that the application code is Wrong..but may be your application is using some resources which is available in one of your Environment …and which is not present in another environment… Just For An Example: In your First Environment where your Application is working fine …may have some properties file in the CLASSPATH of the Server which your application is using…. But that properties file is missing in Second Environment.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
Thanx so much for ur help Jay… i solved the issue… well the weblogic administrator create a wrong data source to the second oracle data base… i mean the connection was ok but with wrong schema that didnt have the package pl sql that i need in my app 😛
Hello Jay, can u provide a test case with an EJB as a Web Service? im tring to made one with jax ws but i can not find the test url when i made deploy on weblogic server.
I create a WebService in wls 10.0 MP2, and method return a String is like this
@WebMethod()
public String activateUser(String id, String name){
try {
.
//activation stuff
.
return “Succesful”
} catch (SQLException e){
throw new SoapCustomException(“CODXXX”, “Problems with db”)
}
}
So when i got an exception my SOAP return a body Detail with errorCode and errorDescription (SoapCustomException was made by me following ur example about it)
My question is how can i return a SOAP env a body with a response code and a response description like
code: Succesful
description: User id [111] activated
When a calling to the web method is correct the SOAP ENV just have a single element in the xml named:
Me again, i was thinking about use complex type as return.. like an pojo class but the client doesnt want to use one because they have their own develop… i tell them that i can pass the client jar but they just want de WSDL url to call the WS
Hi Mgaldames,
You can use Complex types in your WebService. And in any case you need not to provide anything else to the Client other than WSDL. The WSDL itself has all informations of the Complex Types used by the Service. So your Client is right they need only the WSDL to generate all the Client Side artifacts.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
Hi Jay,
I finally have all the details of the patch working on Weblogic 10MP1.
Interestingly I had seen similar queries on a lot of Oracle fourms but now the links do not seem to be working.
I am happy to post the beloew details if you can point me to in the right direction.
Problem Description:
We are connecting to an EJB on WLS 8.1 over the IIOP protocol from a enterprise application on WLS 10 MP1 and using the Sun Initial Context Factory.In absence of a server side timeout setting, we needed a feature of setting client side timeout for EJB over IIOP connections.
Solution:
The patch works with both the Weblogic JNDI factory and the Sun JNDI factory i.e.
INITIAL_CONTEXT_FACTORY – com.sun.jndi.cosnaming.CNCtxFactory
INITIAL_CONTEXT_FACTORY – weblogic.jndi.WLInitialContextFactory and work as expected for the following scenarios for all EJB calls:
Connection Timeout – The connection is terminated by the client when the JNDI lookup takes a long time on the server.
Read Timeout – The connection is terminated by the client when the server takes a long time to respond to a request.
Apply the patch APFA restart the servers. Additionally you need to set the following flags in weblogic during startup.
-Dweblogic.iiop.connectTimeout= -Dweblogic.iiop.requestTimeout=
Example for setting a 2 sec timeout you need to set it as:
-Dweblogic.iiop.connectTimeout=2000 -Dweblogic.iiop.requestTimeout=2000
Bug Id – 10058874
The patch details are:
———+———-+—————-
Version | Patch ID | Passcode
———+———-+—————-
10.0mp1 | APFA | 17VRVUZA
———+———-+—————-
We are happy to give you additional 10 Magic Points .
5 Magic Points – for providing a solution for a known issue. 5 Magic Points – for explaining the issue properly by giving Problem Descriptions and Solution.
Hello admins, i got a problem in my application when i try to use servlet to call an EJB that return an StringBuffer.
Issue: OutOfMemoryError
WLS: 10.2
javax.ejb.EJBException: EJB Exception: ; nested exception is:
java.lang.OutOfMemoryError: allocLargeObjectOrArray - Object size: 33032936, Num elements: 16516460; nested exception is: java.rmi.Rem..
java.lang.OutOfMemoryError: allocLargeObjectOrArray - Object size: 33032936, Num elements: 16516460
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
at $Proxy178.getCreditReports(Unknown Source)
at com.nrtrd.web.requirement.ProcessReport.creditReport(ProcessReport.java:42)
at com.nrtrd.web.requirement.ProcessRequestPost.solicitudReport(ProcessRequestPost.java:41)
...
...
How are you doing? Its good to see you back in action. 😉
Based on your issue it seems that you might be using JRockit JVM, the OutOfMemoryError with allocLargeObjectOrArray comes, because objects size is larger than the limit of TLA.
To resolve your issue you can try adjusting the value for the below parameters and set them in your JAVA_OPTIONS of the start-up script.
-XXlargeObjectLimit=
-XXtlasize=
calling Webservice from trigger :—-
Can any one provide me beginner’s link for calling webservice using trigger(using jdeveloper)?
Database : oracle 11g AS:Weblogic10.3.3
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
You have to run a memory leak analysis. Depending on the JVM you are using, hotspot or jrockit, you can respectively use jvisualvm or jrockit mission control. By using these tools you can look how instances are created and if their is any growth rate for these instances.
I have two versions of the application TestService_V1.war and TestService_V2.war deployed in weblogic.
TestService_V1.war has the context path set to TestService/V1 and TestService_V2.war has the context path set to TestService/V2. For both the versions
I have set the service URI to be blank using child element of in ant build script as shown below :
1. contextPath setting in WLHttpTransport is not working. When I deploy the application in Weblogic, it always takes the default context path as TestService_V1
which is the module name. But if I specify the contextpath in weblogic.xml under then this works. I would like to know if I am missing anything here.
2. I found that in the generated WSDL the address location
is
Thanks for the response. In my case, I would like the context-root part to be the same (TestService) for both the versions which is not possible and hence I thought of this approach.
First of all congrats , getting so much knowledge through this site. Good job.. !!!
1.We are using weblogic 11g(10.3.6.0). we are having clustered environment. we are deploying an ear consisting of three to four ejbs targeting the cluster. we lookup the ejb from a client getting the initial context to a single managed server. but somehow some requests are going to the other managed server. we need our requests to be processed on the single managed server for a particular scenario. so how to control this??
2.on the other note if we deploy a ear targeting the single managed server. we are seeing the jndi created on the other managed servers too. how to avoid it??
Hi Jay,
I am facing some problem in EJB 3.o response in Weblogic server.
I have created an EJB3.o which internally calls another EJB2.0 deployed in another weblogic server.
In my EJB3.0 implementation I have given a logging while flow first enters into my EJB 3.0 method and another logging before returning the response from my EJB3.0 method method.
I have calculated the time between this IN/OUT from logging time.
I have written a client which calls my EJB3.0 API. I calculated the time taken for the EJB3.0 API call and I found that this time is very larger compared to the IN/OUT time calculated above.
The time from the client is 5-6 seconds more than that the actual execution time of the EJB calculated above.
Can you please help me if there is any way to minimize the response time in EJB.
I am using Weblogic 10.3.4.0.
August 10th, 2010 on 1:13 am
Hello Jay…
Some time ago you post an example about TimeManager (http://www.4shared.com/file/P2cL6ZZ5/AppLifeCycleListener.html). In this example u use ejb-jar.xml to describe session bean like this
&l;tsession>
<ejb-name>CalculatorBean</ejb-name>
<mapped-name>calc</mapped-name>
<business-remote>calculator.CalculatorRemote</business-remote>
<ejb-class>calculator.CalculatorBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<res-ref-name>tm/TimerManager</res-ref-name>
<res-type>commonj.timers.TimerManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
</session>
It is possible to convert all this in Annotation @Resource?
I mean, i dont want to create de DD, and if i use the @Resource i can replace all that xml?
@Resource(name=””, type=Object.class, MF AuthenticationType=[CONTAINER,Application], MF shareable=true, resourceType=””, mappedName=””)
Thanx in advance 😀
August 16th, 2010 on 12:44 pm
Hello,
I have an issue with weblogic.jndi.Environment.
import javax.naming.Context;
import javax.rmi.PortableRemoteObject;
import weblogic.jndi.Environment;
import weblogic.rmi.extensions.RequestTimeoutException;
import com.o2.registration.adapter.CompanionAdapter;
import com.o2.registration.adapter.CompanionAdapterHome;
public class OrangeEJBClient {
public static void main(String[] args) {
try {
Environment env = new Environment();
//STF – Orange Environment
env.setProviderUrl(“iiop://216.239.197.248:80”);
env.setRMIClientTimeout(100L);
env.setRequestTimeout(100L);
System.out.println(“Context Factory ” + env.getInitialContextFactory());
System.out.println(“Request Timeout ” + env.getRequestTimeout());
System.out.println(“RMI Client Timeout ” + env.getRMIClientTimeout());
System.out.println(“Provider URL ” + env.getProviderUrl());
Context context =env.getInitialContext();
//Context context = env.getInitialContext();
Object homeObject = context.lookup(“CompanionAdapterBean”);
System.out.println(“Obtained homeObject”);
CompanionAdapterHome home = (CompanionAdapterHome) PortableRemoteObject.narrow(homeObject,CompanionAdapterHome.class);
System.out.println(“Obtained CompanionAdapterHome”);
CompanionAdapter ca = home.create();
System.out.println(“Created CompanionAdapter”);
}
catch(RequestTimeoutException timeout){
}
In the above code I set setRMIClientTimeout and setRequestTimeout; which doesn’t seem to work when i execute.
Can you please help?
Many thanks 🙂
Shankar
August 16th, 2010 on 3:17 pm
Hi Shankar,
Please contact Oracle Support to get a Patch Already Patches are available for the Following Version of WebLogic:
9.2 MP3 | BPTS | WGICRAD6
10.0 MP1 | PIVL | GJ625MEF
Not sure if it is Fixed in WLS10.3 and Later versions or not….But i have tested it in WLS10.3 …and Seems it is not yet fixed. So Please get the Patches from Oracle Support.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
August 16th, 2010 on 7:34 pm
Hi Jay,
Thanks for your inputs. I have received the same patch from Oracle for Weblogic 10.0 MP1 and it does not seem to work with the client code. Do we need to set some additional properties in the server classpath to make the patch work. I came across the below properties at an Oracle Forum – http://forums.oracle.com/forums/thread.jspa?messageID=2928773
weblogic.IdleConnectionTimeout
weblogic.iiop.IIOPIdleConnectionTimeout
However the above Java options are also not working.
Any ideas?
Thanks,
Souvik.
August 22nd, 2010 on 2:38 am
Hi Jay,
Thanks for your help. I am working with Oracle Support on the same issue. They have classified the issue as in internal bug making the bug report not accessible. I will provide all the relevant information on the bug and the patch as soon as I have some information available from Oracle Support.
August 25th, 2010 on 4:55 am
Hello Jay, i hope u can help me with this…
Im using Weblogic 10.0MP2 in a Linux System.
I have an EJB that get data from and Oracle 8i database and after receive the data call a stored procedure in Oracle 11gR2 that made 2 inserts. But i get this excpetion when i try to call the procedure.
2010-08-24 10:41:44,185 2497 [[ACTIVE] ExecuteThread: ‘8’ for queue: ‘weblogic.kernel.Default (self-tuning)’] ERROR com.btick.ejb.db.MauSqlMapClient – excepcion al intentar ejecutar statement [CLIENTS.RegistrarMovimientos]
java.sql.SQLException: Connection has already been created in this tx context for pool named ConnPoolClient. Illegal attempt to create connection from another pool: ConnPoolStore
at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:608)
at weblogic.jdbc.jts.Driver.connect(Driver.java:127)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:339)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)
at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:566)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:541)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:83)
at com.btick.ejb.db.EntelSqlMapClient.queryForObject(MauSqlMapClient.java:150)
at com.btick.ejb.archivos.SyniverseBean.persistData(SynBean.java:127)
at com.btick.ejb.archivos.SyniverseBean.persist(SynBean.java:121)
Can u help me how to solve this?
I tried using differents oracle drivers but i got the same error. Is this an EJB problem or its a problem with the DataBases?
Thanx in advance!
August 25th, 2010 on 9:21 am
Hi Mgaldames,
In EJBs we set different types of Transactional Attributes in the Deployment Descriptors “ejb-jar.xml” like Required, Never, Mandatory, Supports, Requires New….etc
If you are using a Tx Jdbc Driver and inside your EJBs if you will try to create a Connection Object from Different DataSources then you will get this kind of exceptions. In One Transational Context seems your application is trying to get Connections from Two DataSources…. OR There are Two EJBs which are trying to get a Connection Object from the same DataSource in the Same Transactional Context.
Not sure whether setting EJB Transactional attribute “Supports” will suit your Application requirement or not….But you can try setting the Transactional Attribute of your application…just for testing. I think tunning right kind of Transactional Attributes or Choosing a Non-Tx Jdbc Driver (DataSource) will help to resolve the issue.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
August 26th, 2010 on 8:03 am
Greeeeaaaaat!!! Thanx Jay…. that solved my problem… i can call the stored procedure now!!
I put the attribute “Supports” in the ejb-jar.xml 😀
Thanx so much Jay!
September 1st, 2010 on 6:13 pm
Hello Jay, i have a Question about EJB and Web clients of this EJB
Suppose i have my EJB in my weblogic server and i want to have different clients for it, some of them in the same weblogic server and some others in different app servers.
How it works for them to accessing to my EJB? Should i give them something, like the .jar of my EJB? Or should i just give them the remote interfaces and some entities that they need to have because some of my methods return List of entities lik: public List getAllUsers();
It would be great if u can explain how it works for this 🙂 Than so much in advance
best regards!
September 2nd, 2010 on 11:19 am
Hi Mgaldames,
In Case of Pure EJBs
If you are talking about Pure EJBs then yes you must provide the Client Side Artifacts to the Client. These Client Side can be generated by the EJB Developer using the “weblogic.appc” utility as described in : http://middlewaremagic.com/weblogic/2010/04/02/generating-ejb3-clientjar/
In Case of EJB based WebServices
If you have converted your EJBs into WebServices…or If you have developed a EJBBased WebService then …you need not to provide any thing to the Clients except the WSDL file. WSDL file contains all the required definitions ..Based on that they can generate any kind of Client Side artifacts . Example: Clients can take the WSDL and they can use “clientgen” tool to generate the ClientSide Artifacts of type “JAXWS” or “JAXRPC”…or they can use Axis utilities to generate Client Artifacts…Because in Case of WebServices the Communication between Client and Server happens on HTTP protocol which is not Container Specific. But the EJB Artifacts uses RMI Calls which are requires container specific Stubs and Skeletons.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
September 6th, 2010 on 6:21 pm
Thanx for the reply Jay… i have an issue now that i need to deploy my app in other WLS 10.0 MP2 server.
When i deploy the application in my local develop environment (WLS 10.0 MP2) all its ok. Then i made the deploy in the develop server of my client and the app is running… but when i try a servlet that connect with an EJB 3.0 via remote interface i get this issue
#### <> <[weblogic.servlet.internal.WebAppServletContext@350fa3f – appName: 'AlertsRoaEar', name: 'alertsRoaWeb', context-path: '/alertsRoaWeb'] Servlet failed with Exception
javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:83)
at $Proxy77.consultarCostoReferencial(Unknown Source)
at com.comp.fact.web.request.ProcesaAdmin.solicitudCostos(ProcesaAdmin.java:40)
at com.comp.fact.web.request.ProcesaRequest.solicitudParametros(ProcesaRequest.java:60)
Can u help to understand why is this problem in that server? the difference between my server and that is that client server has 2 clusters in the server (at the same machine). In the other hand i have just the default server in my local Weblogic server.
Thanx in advance for ur help 🙂
September 6th, 2010 on 6:40 pm
Hi Mgaldames,
You need to check the 40th Line of the Method solicitudCostos() of ProcesaAdmin.java
NullPointerException indicates that some object is becoming NULL. Even if the same application is Working in One of your Local Development Setup…It means your Program is somehow dependent on your Previous environment…Or may be it is trying to get the EJB Object from a Wrong Servers JNDI Tree…
That can be easily found once we will be able to findout which Object is actually becoming NULL….By putting some Debug or System.out.println Statements inside the “solicitudCostos()” Method.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
September 6th, 2010 on 9:17 pm
Thanx Jay for the quick reply…
I made some changes and now i can be able to get into the ejb container but i get another exception… i guess is because null data (but i am passing real data 🙁 )
What im doing is this… get into a servlet and select a combo box and send that value to the EJB and i can get a StringBuffer with a html table with a list of mails. This is Ok in my local but when i run in the client server i get this new error
#### <> <EJB Exception occurred during invocation from home: weblogic.ejb.container.internal.StatelessEJBHomeImpl@3dc3ec0 threw exception: java.lang.NullPointerException
java.lang.NullPointerException
at com.comp.fact.ejb.admin.WebParamsAdminBean.verMailListInputDisabledBox(WebParamsAdminBean.java:240)
at com.comp.fact.ejb.admin.WebParamsAdminBean.consultarDestinatarios(WebParamsAdminBean.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
I yet dont have access to the client machine so i can not see logs generated by the app… i just can watch the server domain log and that i s wath i posted to you.
Thanx so much for ur help 🙂
September 7th, 2010 on 9:21 am
Hi Mgaldames
The Above issue is very much Application specific… And Even the Null Pointer is coming from the Application code…”com.comp.fact.ejb.admin.WebParamsAdminBean.verMailListInputDisabledBox(WebParamsAdminBean.java:240)” … Your Application is missing some resources… The only way to debug this issue is to put some debug codes inside the Application to find out wich object is becoming NULL.
I am not saying that the application code is Wrong..but may be your application is using some resources which is available in one of your Environment …and which is not present in another environment…
Just For An Example: In your First Environment where your Application is working fine …may have some properties file in the CLASSPATH of the Server which your application is using…. But that properties file is missing in Second Environment.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
September 8th, 2010 on 6:47 am
Thanx so much for ur help Jay… i solved the issue… well the weblogic administrator create a wrong data source to the second oracle data base… i mean the connection was ok but with wrong schema that didnt have the package pl sql that i need in my app 😛
Thanx Jay!
September 14th, 2010 on 6:17 pm
Hello Jay, can u provide a test case with an EJB as a Web Service? im tring to made one with jax ws but i can not find the test url when i made deploy on weblogic server.
Thanx in advance 🙂
September 14th, 2010 on 7:30 pm
Hi Mgaldames,
Please find the testCase in your Gmail Address. It is a Simple EJB3-JAXWS based webservice.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
September 15th, 2010 on 12:57 am
Thanx so much Jay!
September 28th, 2010 on 7:53 am
Hello Jay,
I create a WebService in wls 10.0 MP2, and method return a String is like this
@WebMethod()
public String activateUser(String id, String name){
try {
.
//activation stuff
.
return “Succesful”
} catch (SQLException e){
throw new SoapCustomException(“CODXXX”, “Problems with db”)
}
}
So when i got an exception my SOAP return a body Detail with errorCode and errorDescription (SoapCustomException was made by me following ur example about it)
My question is how can i return a SOAP env a body with a response code and a response description like
code: Succesful
description: User id [111] activated
When a calling to the web method is correct the SOAP ENV just have a single element in the xml named:
Succesful
Thanx in advance for ur guidance 😀
September 28th, 2010 on 9:47 am
Me again, i was thinking about use complex type as return.. like an pojo class but the client doesnt want to use one because they have their own develop… i tell them that i can pass the client jar but they just want de WSDL url to call the WS
Thanx
September 29th, 2010 on 3:17 pm
Hi Mgaldames,
You can use Complex types in your WebService. And in any case you need not to provide anything else to the Client other than WSDL. The WSDL itself has all informations of the Complex Types used by the Service. So your Client is right they need only the WSDL to generate all the Client Side artifacts.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
December 3rd, 2010 on 8:49 pm
Hello there,
Jay i need some help with complex type in web services… im working in a Weblogic 10.2 server and i put the service in Aqualogic
I need to create a response body like this one:
My problem is that i dont know how to add attributes to elements on my complex type
Can you help me on this please?
Thanx so much in advance
December 20th, 2010 on 3:32 am
Hi Jay,
I finally have all the details of the patch working on Weblogic 10MP1.
Interestingly I had seen similar queries on a lot of Oracle fourms but now the links do not seem to be working.
I am happy to post the beloew details if you can point me to in the right direction.
Problem Description:
We are connecting to an EJB on WLS 8.1 over the IIOP protocol from a enterprise application on WLS 10 MP1 and using the Sun Initial Context Factory.In absence of a server side timeout setting, we needed a feature of setting client side timeout for EJB over IIOP connections.
Solution:
The patch works with both the Weblogic JNDI factory and the Sun JNDI factory i.e.
INITIAL_CONTEXT_FACTORY – com.sun.jndi.cosnaming.CNCtxFactory
INITIAL_CONTEXT_FACTORY – weblogic.jndi.WLInitialContextFactory and work as expected for the following scenarios for all EJB calls:
Connection Timeout – The connection is terminated by the client when the JNDI lookup takes a long time on the server.
Read Timeout – The connection is terminated by the client when the server takes a long time to respond to a request.
Apply the patch APFA restart the servers. Additionally you need to set the following flags in weblogic during startup.
-Dweblogic.iiop.connectTimeout= -Dweblogic.iiop.requestTimeout=
Example for setting a 2 sec timeout you need to set it as:
-Dweblogic.iiop.connectTimeout=2000 -Dweblogic.iiop.requestTimeout=2000
Bug Id – 10058874
The patch details are:
———+———-+—————-
Version | Patch ID | Passcode
———+———-+—————-
10.0mp1 | APFA | 17VRVUZA
———+———-+—————-
December 20th, 2010 on 2:50 pm
Hi Souvik,
Welcome to Middleware Magic.
We are happy to give you additional 10 Magic Points .
5 Magic Points – for providing a solution for a known issue.
5 Magic Points – for explaining the issue properly by giving Problem Descriptions and Solution.
This would surely help all of us.
Regards,
Ravish Mody
February 3rd, 2011 on 6:54 pm
Hello admins, i got a problem in my application when i try to use servlet to call an EJB that return an StringBuffer.
Issue: OutOfMemoryError
WLS: 10.2
Can u help me please to solve this error?
Thanx in advance for ur help
February 3rd, 2011 on 9:30 pm
Hi Mauro,
How are you doing? Its good to see you back in action. 😉
Based on your issue it seems that you might be using JRockit JVM, the OutOfMemoryError with allocLargeObjectOrArray comes, because objects size is larger than the limit of TLA.
To resolve your issue you can try adjusting the value for the below parameters and set them in your JAVA_OPTIONS of the start-up script.
-XXlargeObjectLimit=
-XXtlasize=
February 3rd, 2011 on 11:22 pm
Thanx for sharing Ravish 😀
It is good to be back! I really like Weblogic and developing but i think there is a lot that i need to learn and you and Jay are the best 😛
Once again thanx!!
March 21st, 2011 on 2:18 pm
Hi Souvik&Ravish,
Unfortunately the problem you are talking about, is existing on WLS 10 or WLS 10.3 yet.
I have also a similar problem when trying to make connection with closed service over IIOP, i set timeout parameters but it doesn’t work.
Today i was looking fixed bugs and i’ve found the fixed bug on WLS 10.3.4
10058874 Core components 10.3.4 Although the weblogic.iiop.requestTimeout property is set, a request does not time out.
I asked oracle support whether they can build the same patch for WLS 10.3 version.
Regards,
March 21st, 2011 on 3:00 pm
Hi middleman,
Thank you for sharing that the same issue is been fixed in WLS 10.3.4 version.
You have earned yourself additional 10 Magic Points
Hope you get your patch soon for WLS 10.3.0 version.
Keep Posting 🙂
Regards,
Ravish Mody
April 5th, 2011 on 1:21 pm
calling Webservice from trigger :—-
Can any one provide me beginner’s link for calling webservice using trigger(using jdeveloper)?
Database : oracle 11g AS:Weblogic10.3.3
Waiting for reply
April 5th, 2011 on 5:35 pm
Hi Munnad,
At present we are not sure about how to invoke a WebService using JDeveloper Trigger concept.
.
.
Thanks
Jay SenSharma
May 11th, 2012 on 4:12 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
July 3rd, 2012 on 12:52 am
HI Jaya,
I have found one issue and due to this our Server Node Get down again and again every one month .
can you please help to anylysis this.we found really in trouble
Thanks you all in advance.
Today we’ve found OutOfMemory Error on MNP RealMove same as MNP TrueMove
#### <>
#### <>
#### <>
#### <>
#### <>
#### <>
#### <>
#### <>
#### <> <ExecuteRequest failed
java.lang.OutOfMemoryError.
however xmx and xms already set as 1024 and 2048 respectively on both clustered node but Manged server still have the same 128 m default.
webadm 6838 6768 1 Apr22 ? 1-06:02:06 /data/webserver/Oracle/Middleware/jrockit_160_24_D1.1.2-4/bin/java -jrockit -Xms512m -Xmx1024m -Dweblogic.Name=AdminServer -Djava.security.policy=/data/webserver/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.policy -Dweblogic.ProductionModeEnabled=true -Dfile.encoding=utf-8 -Dorg.quartz.properties=/home/webadm/conf/quartz.properties -da -Dplatform.home=/data/webserver/Oracle/Middleware/wlserver_10.3 -Dwls.home=/data/webserver/Oracle/Middleware/wlserver_10.3/server -Dweblogic.home=/data/webserver/Oracle/Middleware/wlserver_10.3/server -Dlog4j.configuration=file:/home/webadm/conf/log4j.properties -Dweblogic.management.discover=true -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole=false -Dweblogic.Stdout=/data/applog/mnp/wls_stdout.log -Dweblogic.Stderr=/data/applog/mnp/wls_stderr.log -Dweblogic.ext.dirs=/data/webserver/Oracle/Middleware/patch_wls1035/profiles/default/sysext_manifest_classpath weblogic.Server
webadm 7162 7130 0 Apr22 ? 02:51:33 /data/webserver/Oracle/Middleware/jrockit_160_24_D1.1.2-4/bin/java -jrockit -Xms128m -Xmx256m -Dbea.home=/data/webserver/Oracle/Middleware -Xverify:none -Djava.security.policy=/data/webserver/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.policy -Dweblogic.nodemanager.javaHome=/data/webserver/Oracle/Middleware/jrockit_160_24_D1.1.2-4 weblogic.NodeManager -v
Please help……………..and thanks in advance
July 3rd, 2012 on 12:54 am
#### <>
#### <>
#### <>
#### <>
#### <>
#### <>
#### <>
#### <>
#### <> <ExecuteRequest failed
java.lang.OutOfMemoryError.
java.lang.OutOfMemoryError
July 3rd, 2012 on 8:29 am
any one have clue?
July 4th, 2012 on 12:40 pm
You have to run a memory leak analysis. Depending on the JVM you are using, hotspot or jrockit, you can respectively use jvisualvm or jrockit mission control. By using these tools you can look how instances are created and if their is any growth rate for these instances.
November 17th, 2012 on 2:39 am
Hi,
Sorry, my previous post was missing the xml code ( this is my first post in this forum, so apologies).I am reposting my question below :
I am trying to version my webservice using URL versioning.
Say for example, I have a service by name “TestService” and would like the consumers to invoke different
versions of my webservice as http://hostname:port/TestService/V1?WSDL and http://hostname:port/TestService/V2?WSDL
I have two versions of the application TestService_V1.war and TestService_V2.war deployed in weblogic.
TestService_V1.war has the context path set to TestService/V1 and TestService_V2.war has the context path set to TestService/V2. For both the versions
I have set the service URI to be blank using child element of in ant build script as shown below :
With this settings, consumers will be able to invoke my webservice http://hostname:port/TestService/V1?WSDL.
I have couple of problems with this approach
1. contextPath setting in WLHttpTransport is not working. When I deploy the application in Weblogic, it always takes the default context path as TestService_V1
which is the module name. But if I specify the contextpath in weblogic.xml under then this works. I would like to know if I am missing anything here.
2. I found that in the generated WSDL the address location
is
But I would like that to be
I would appreciate any pointers on this.
I am using bottom-up approach in Weblogic 10.3.5
Thanks & Regards,
daves09.
November 19th, 2012 on 9:46 pm
Hi Rene,
Thanks for the response. In my case, I would like the context-root part to be the same (TestService) for both the versions which is not possible and hence I thought of this approach.
Thanks,
daves09
May 22nd, 2013 on 3:04 pm
Hi Jay,
First of all congrats , getting so much knowledge through this site. Good job.. !!!
1.We are using weblogic 11g(10.3.6.0). we are having clustered environment. we are deploying an ear consisting of three to four ejbs targeting the cluster. we lookup the ejb from a client getting the initial context to a single managed server. but somehow some requests are going to the other managed server. we need our requests to be processed on the single managed server for a particular scenario. so how to control this??
2.on the other note if we deploy a ear targeting the single managed server. we are seeing the jndi created on the other managed servers too. how to avoid it??
thanks in advance.
Regards,
Mallesh
October 4th, 2013 on 6:38 pm
Hi Jay,
I am facing some problem in EJB 3.o response in Weblogic server.
I have created an EJB3.o which internally calls another EJB2.0 deployed in another weblogic server.
In my EJB3.0 implementation I have given a logging while flow first enters into my EJB 3.0 method and another logging before returning the response from my EJB3.0 method method.
I have calculated the time between this IN/OUT from logging time.
I have written a client which calls my EJB3.0 API. I calculated the time taken for the EJB3.0 API call and I found that this time is very larger compared to the IN/OUT time calculated above.
The time from the client is 5-6 seconds more than that the actual execution time of the EJB calculated above.
Can you please help me if there is any way to minimize the response time in EJB.
I am using Weblogic 10.3.4.0.
Thanks in advance.
Rahul