ClassCastException using EJB from a service
Hi all,
I developed a DeployService and currently I'm getting a ClassCastException while accessing the a EJB.
I put the lookup within a delegate which is also be used from a webDynpro application. With the WebDynpro App everything work properly, but if I call the delegate from the service a SAPClassCastException I thrown, when I cast the object to the home interface.
The coding is as follows:
Properties props = new Properties();
props.put(Context.PROVIDER_URL,"localhost:50004");
props.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sap.engine.services.jndi.InitialContextFactoryImpl");
context = new InitialContext(props);
Object obj = context.lookup(jndiName);
EJBHome ejb = EJBHomeFactory.getInstance().lookup(jndiName, ComponentHome.class);
ComponentHome componentHome = (ComponentHome)ejb;
Thanks a lot for the help.
Falk
Hi Falk,
Hey just tell me that what is the EJBHome and ComponentHome and EJBHomeFactory in your coding.....
You can try the following code for the same.
Object obj =(Object) jndicontext.lookup("<Your JNDI name>");
TestEJBHome home = (TestEJBHome) javax.rmi.PortableRemoteObject.narrow(
obj,
TestEJBHome.class);
TestEJB hello = home.create();
Here, TestEJBHome is your Home interface of the EJB and TestEJB is your remote interface. Now you can use hello object to call your business methods of EJB.
Regards,
Bhavik
Similar Messages
-
How can I using tpcall from one service to another service in the same server
When I using tpforward between two services in one server, it's working ok. However,
when I using tpcall from one service to another service, it's failed?
anybody can tell me why?
thanks
george"george" <[email protected]> wrote:
>
When I using tpforward between two services in one server, it's working
ok. However,
when I using tpcall from one service to another service, it's failed?
anybody can tell me why?Basically, tpcall:ing another service in the same server is a no-no, unless you
a) are running a multi-threaded server (requires TUXEDO 7 or newer + compilation
options) or
b) use tpacall() instead of tpcall() and specify the flag TPNOREPLY. This is probably
not what you want to accomplish, though.
The reason is that TUXEDO servers by default (and always in versions before 7)
are single-threaded. If service A and B both reside in server X, server X will
be busy taking care of the call to A. If A makes a call to B, the call will be
put on the queue to X, but X will not look at the queue until it is done with
A, which won't happen until B returns... deadlock!
You can play tricks with starting multiple instances of X, but in the end you
will always face a risk (something lika a race-condition) for a dead-lock.
Solution: Move service B to another server (usually quite easy) OR switch to multi-threading,
if that's possible. Just make sure all code your service calls is MT-safe as well...
thanks
georgeHope this helps you,
/Per -
Need to access R3 using IConnectorServiceGateway from portal service.
Hi everyone,
I need to access R3 using IConnectorServiceGateway from portal service but unable to access so as I don't get the IPortalComponentRequest. Can anyone help me out on how should i do the connection ?
Please let me know as soon as possible.
Thanks
RituHello.
I think this should work
* Méthode renvoyant une connexion au backend SAP/R3 via un pool de
* connexion.
* @param userLocale - la locale de l'utilisateur
* @param user - utilisateur pour lequel il faut une connection
* @param systemAlias - système pour se connecter
* @return une connexion au backend SAP/R3.
* @throws ConnectionPoolException
* levée en cas d'erreur.
public IConnection getConnection(
Locale userLocale,
IUserContext user,
String systemAlias) throws ConnectionPoolException {
ConnectionProperties prop = null;
IConnection connection = null;
IConnectorGatewayService cgService = null;
try {
// Connector Gateway Service.
cgService = (IConnectorGatewayService) PortalRuntime
.getRuntimeResources().getService(IConnectorService.KEY);
if (cgService == null) {
throw new ConnectionPoolException(
"Error in get Connector Gateway Service...");
IPortalComponentRequest aRequest;
if (systemAlias == null) {
throw new ConnectionPoolException(
"System alias 'systemAlias' name is null...");
// Demande la connexion au service :
prop = new ConnectionProperties(userLocale, user);
connection = cgService.getConnection(systemAlias, prop);
} catch (Exception ex) {
throw new ConnectionPoolException(ex);
regards
Guillaume PATRY -
How to call session EJB from EP service in EP 7.0?
Hi,
I am trying to invoke stateless session EJB from my portal service. Both the service and EJB are deployed on the same server which is EP 7.0.
I found [this|http://help.sap.com/saphelp_nw70/helpdata/EN/42/9ddcc9bb211d72e10000000a1553f6/frameset.htm] in SAP help and tried to implement it (added PrivateSharingReference to portalapp.xml and implemented the code), but everytime I try to lookup the session bean and cast it using P4ObjectBroker.narrow() method, I get java.lang.ClassCastException. The object found in JNDI and my portal service have different classloaders, so I suppose this is the problem, but I don't know how to handle it...
Can anyone please help me?
Regards,
TomasHi Satya ,
please go though following blog for used DC concept.
Componentization of Webdynpro Application in CE7.1
In netweaver 7.1 interface controler is abstract and component controller is implementing interface controller so the context data and methods have to be implemented by component controller -
Using Grab from Application/Services menu
Hi
Can anyone explain how to enable Grab in the App/Services menu?
whenever I try, the three options (screen, selection, timed) are all greyed out, even though Grab itself is not. I can get the screenshot fine if I use the keyboard shortcuts, however, I don't use it a lot so I never remember what they are!
It's a pain to have to look it up everytime...
ThanksYou must invoke the Grab Service from within an application that can accept the screen shot. One that can is TextEdit. (Taking screenshots from a Service this way has never seemed practical to me.)
-
Hi Everyone.
I have a question on calling an EJB from a Web Service.
Is this the correct way of calling a EJB out of a web service?
We have another implementation with the same flow, and it's not calling some of the methods, unless we add @TransactionAttribute on the mehod.
I've read some of the articles for adding a transaction attribute, but what I do not understand is that sometimes it work without the attribute and sometimes we need to add the attribute.
Our entry point is the web service and from there we call the local ejb methods.
Here is the example:
1. The Web Service
@WebService()
@Stateless()
public class HouseWS {
@EJB
private PeopleLocal people;
* Web service operation
@WebMethod(operationName = "sayHallo")
public void sayHallo() {
//TODO write your implementation code here:
people.doPeople();
}2. The Local EJB
@Local
public interface PeopleLocal {
public void doPeople();
}3. The Bean
@Stateless
public class People implements PeopleLocal {
public void doPeople() {
System.out.println("do the people local bean");
// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")
}Here is the scenario that we are struggling with.
We go into the @WebMethod(operationName = "stepOneReconciliation") method.
We also added @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) to the web service method. Is this necessary?
From the web service method we call the public String stepOneReconciliation(String requestXML) in the bean.
Web service
@WebService()
@Stateless()
public class AeReconciliationWebService {
@EJB
private ReconciliationsLocal reconciliationsLocal;
@WebMethod(operationName = "stepOneReconciliation")
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public String stepOneReconciliation(@WebParam(name = "requestXML")
String requestXML) {
return reconciliationsLocal.stepOneReconciliation(requestXML);
@WebMethod(operationName = "stepTwoReconciliation")
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public String stepTwoReconciliation(@WebParam(name = "requestXML")
String requestXML) {
return reconciliationsLocal.stepTwoReconciliation(requestXML);
The bean.
All the facade lookups work in the first if(request.getReconType().equals(REVENUE_RECON_TYPE)) statement even though we do not add the TransactionAttributeType.NEVER, but if we go into the else if(request.getReconType().equals(REVENUE_RECON_TYPE)) the lookups doesn't work.
We have added TransactionAttributeType.NEVER to the method and then the else if ejb lookups work.
Why do we need to add the attributeType for the else if lookups to work?
@EJB
GeneralLedgerFacadeLocal generalLedgerFacadeLocal;
@TransactionAttribute(TransactionAttributeType.NEVER)
public String stepOneReconciliation(String requestXML) {
String requestName = "stepOneReconciliation";
String moduleName = "Reconciliation";
AeReconciliationRequest request = null;
//read in xml
if(request.getReconType().equals(SERVICE_RECON_TYPE)) {
ServiceRecon serviceRecon = serviceReconFacadeLocal.findGreaterThanDateTo(request.getToDate(), request.getServiceCode());
if(serviceRecon != null) {
LogUtil.error("AEException", "Recon already occured for a greater date", "" + newRequestId);
return AeSystemUtils.returnResponse(SystemCodeUtils.AE_INVALID_INFORMATION, null, null, null, stanley);
} else {
//Find all values smaller than toDate
double reconAmount = 0;
Date toDateUtil = DateUtils.getDateFromString(request.getToDate());
Date fromDate = null;
List <ServiceRecon> serviceReconList = serviceReconFacadeLocal.findByServiceCode(request.getServiceCode());
if(serviceReconList != null && serviceReconList.size() > 0) {
fromDate = ((ServiceRecon) serviceReconList.get(0)).getReconToTs();
Calendar tempCal = Calendar.getInstance();
tempCal.setTimeInMillis(fromDate.getTime());
tempCal.add(Calendar.MILLISECOND, 1);
fromDate = tempCal.getTime();
List<GeneralLedger> generalLedgerList = generalLedgerFacadeLocal.findByBetweenToAndFromDateForServiceCode(request.getServiceCode(), fromDate, toDateUtil);
for (Iterator<GeneralLedger> it = generalLedgerList.iterator(); it.hasNext();) {
GeneralLedger generalLedger = it.next();
if (generalLedger.getAccountDebitId() != null && generalLedger.getAccountDebitId().getAccountTypeId().getCode().equals(AccountTypeStatic.TRADING.getCode()) && generalLedger.getAmount() != null) {
reconAmount -= generalLedger.getAmount().longValue();
if (generalLedger.getAccountCreditId() != null && generalLedger.getAccountCreditId().getAccountTypeId().getCode().equals(AccountTypeStatic.TRADING.getCode()) && generalLedger.getAmount() != null) {
reconAmount += generalLedger.getAmount().longValue();
return AeSystemUtils.returnReconciliation(SystemCodeUtils.SUCCESS, moduleName, new Double(reconAmount).longValue() + "", null, stanley);
} else if(request.getReconType().equals(REVENUE_RECON_TYPE)) {
RevenueRecon revenueRecon = revenueReconFacadeLocal.findGreaterThanDateToAndSplitRevenue(request.getToDate(), false);
if(revenueRecon != null) {
LogUtil.error("AEException", "Recon already occured for a greater date", "" + newRequestId);
return AeSystemUtils.returnResponse(SystemCodeUtils.AE_INVALID_INFORMATION, null, null, null, stanley);
} else {
//Find all values smaller than toDate
double reconFeeAmount = 0;
double reconCommissionAmount = 0;
Date toDateUtil = DateUtils.getDateFromString(request.getToDate());
Date fromDate = null;
List <RevenueRecon> revenueReconList = revenueReconFacadeLocal.findBySplitFee(false);
if(revenueReconList != null && revenueReconList.size() > 0) {
fromDate = ((RevenueRecon) revenueReconList.get(0)).getReconToTs();
Calendar tempCal = Calendar.getInstance();
tempCal.setTimeInMillis(fromDate.getTime());
tempCal.add(Calendar.MILLISECOND, 1);
fromDate = tempCal.getTime();
Long debitFeeAmount = generalLedgerFacadeLocal.findBetweenToAndFromDateForDebitFeeAccount(fromDate, toDateUtil);
Long creditFeeAmount = generalLedgerFacadeLocal.findBetweenToAndFromDateForCreditFeeAccount(fromDate, toDateUtil);
reconFeeAmount = (creditFeeAmount-debitFeeAmount);
Long debitCommissionAmount = generalLedgerFacadeLocal.findBetweenToAndFromDateForDebitCommissionAccount(fromDate, toDateUtil);
Long creditCommissionAmount = generalLedgerFacadeLocal.findBetweenToAndFromDateForCreditCommissionAccount(fromDate, toDateUtil);
reconCommissionAmount = (creditCommissionAmount-debitCommissionAmount);
reconFeeAmount = reconFeeAmount - reconCommissionAmount;
return AeSystemUtils.returnReconciliation(SystemCodeUtils.SUCCESS, moduleName, new Double(reconFeeAmount).longValue() + "", null, stanley);
} else if(request.getReconType().equals(SPLIT_REVENUE_RECON_TYPE)) {
return AeSystemUtils.returnResponse(SystemCodeUtils.AE_INVALID_XML_REQUEST, null, null, null, stanley);
} -
ClassCastException using DestinationService from an EJB
Good morning,
I am running NetWeaver 2004S SP5, and am attempting to make a call to the destination service from within a message-driven bean's onMessage() method. I can access JNDI and obtain the object returned by doing a JNDI lookup on DestinationService.JNDI_KEY, but when I cast that value to the DestinationService class, I get a ClassCastException.
I have a similar command-line client test program that makes the same call. It can connect to the destination service and query the named HTTP destination just fine.
The code I'm using is:
--- begin code snippet ---
DestinationService dstService;
try {
InitialContext jndiCtx = new InitialContext();
dstService = (DestinationService)jndiCtx.lookup(DestinationService.JNDI_KEY);
HTTPDestination dest =
(HTTPDestination)dstService.getDestination("HTTP", "OMSCBUrl");
urlString = dest.getUrl();
_logger.logInfo("Retrieved URL(" + urlString + ") from the OMSCB HTTP Destination OMSCBUrl");
} catch (RemoteException re) {
_logger.logInfo("Unable to contact the destination service : " + re);
} catch (NamingException ne) {
_logger.logInfo("Unable to contact the JNDI service : " + ne);
} catch (DestinationException de) {
_logger.logInfo("Unable to obtain the OMSCB HTTP Destination " + OMSCB_DESTINATION_NAME + " : " + de);
--- end code snippet ---
When I first got the ClassCastException, I had assumed it was from the line where I get the destination and cast it to an HTTPDestination. It turns out, though, that I was wrong, and the cast error actually happens in casting the DestinationService.
This class is in an EJB DC project, and I have checked my DC dependencies to make sure that I'm including the com.sap.exception, security.class, and tc/sec/destinations/interface DCs as Used DCs. I have also verified that the corresponding EAR project has those three libraries included as references in the application-j2ee-engine.xml. Before I had set those references, I was getting an error on deployment, but now the class deploys just fine.
I did notice (both through looking at the JNDI registry in Visual Administrator and by examining the class of the object returned by the JNDI lookup) that the object returned by the JNDI lookup is a proxy object for a P4 binding stub. I guess that's an RMI-accessible object? I was wondering if I was missing a reference to the class that contains the binding stub.
The JNDI values for the tcsecdestinations~service object are:
[Class Name]: $Proxy111
[Object Value]: RMI_P4:Dynamic Stub:com.sap.security.core.server.destinations.service.DestinationServiceImpl@3b6dbd
Anyway, I'm stumped. Any help would be greatly appreciated.
Thanks,
- BillHi Vinoth,
Thanks for the reply. Unfortunately, I've already looked at it, and it did not solve my problem. I had gotten the sample code from there, but it didn't help with the runtime ClassCastException.
However, I was able to resolve the problem. It turns out that, in additon to the three library references in the application-j2ee-engine.xml, you need to add a reference to the tcsecdestinations~service service. Once you add that and redeploy, the ClassCastException goes away.
I believe that the problem was caused by JNDI returning a proxy object to an unresolvable class.
Hope that helps someone else,
- Bill -
NoClassdefFound Problem using EJB as web service client
Hello there, I am trying to use a MDB as a web service client. The architecture,
briefly is in the form of a java program communicating with a MDB via JMS, the
MDB gets the data from some external server via SOAP. I am using JBuilder to generate
the client side classes choosing the Axis framework. When my MDB is trying to
bind using locator.getPort() it throws an error as follows:
java.lang.NoClassDefFoundError: org.apache.axis.client.AxisClient. java.lang.NoClassDefFoundError:
org.apache.axis.client.AxisClient at org.apache.axis.client.Service.getAxisClient()Lorg.apache.axis.client
AxisClient;(Service.java:143) at org.apache.axis.client.Service.<init>()V(Service.java:152)
Note that it works fine if I use the web services client as a standalone java
program(no weblogic ). I tried putting the Axis.jar file as well as the relevant
files from this jar file(JBuilder's feature) in the EJB module that is deployed,
of no avail. Following is the classloader printed from the EJB's onMessage method
if needed for better understanding
weblogic.utils.classloaders.GenericClassLoader@afdd3a finder: weblogic.utils.cla
ssloaders.MultiClassFinder@20d7479 annotation: SecurityEJBModule@
Any help will be appreciatedSlava, I did exactly that and it worked! I wish I had seen your reply before.
Thanks
"Slava Imeshev" <[email protected]> wrote:
>
"Santosh" <[email protected]> wrote in message news:405074c7$[email protected]..
Hello there, I am trying to use a MDB as a web service client. Thearchitecture,
briefly is in the form of a java program communicating with a MDB viaJMS, the
MDB gets the data from some external server via SOAP. I am using JBuilderto generate
the client side classes choosing the Axis framework. When my MDB istrying to
bind using locator.getPort() it throws an error as follows:
java.lang.NoClassDefFoundError: org.apache.axis.client.AxisClient.java.lang.NoClassDefFoundError:
org.apache.axis.client.AxisClient at org.apache.axis.client.Service.getAxisClient()Lorg.apache.axis.client
AxisClient;(Service.java:143) at org.apache.axis.client.Service.<init>()V(Service.java:152)
Note that it works fine if I use the web services client as a standalonejava
program(no weblogic ). I tried putting the Axis.jar file as well asthe relevant
files from this jar file(JBuilder's feature) in the EJB module thatis deployed,
of no avail. Following is the classloader printed from the EJB's onMessagemethod
if needed for better understandingYou need to package all Axis jars and dependancoes into the EAR and
refer tham
in your ejb-jar MANIFEST.MF. If you are running weblogic 8.1, you may
just put them
into APP-INF/lib. Than you won't need to modify manifest.
Hope this helps.
Regards,
Slava Imeshev -
ClassCastException calling EJB from EJB (diff EARs) Urgent please help !!
Hi,
I�m trying to call a Remote EJB ( in jdev BBEAN.prj ) from another EJB (in jdev ABEAN.prj) located in a different EAR.
In JDEVELOPER (oc4j 9.0.3) I also considered BBEAN as a libreary which is included in the ABEAN project.
So that the ABEAN JAR contains the class definition for the Home and remote interface.
From the ABEAN bean I call this code:
DO ()
private static Context getInitialContext() throws NamingException
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "manager");
env.put(Context.PROVIDER_URL, "ormi://GSARNO-1/BBean");
return new InitialContext(env);
BBeanHome BBeanHome = (BBeanHome)PortableRemoteObject.narrow(context.lookup("BBean"), BBeanHome.class);
BBean bBean;
������������..
After having deployed both projects I then run a client (Calling the Do function).
Doing so I keep receiving the following error when calling narrow.
java.lang.ClassCastException
java.lang.Object com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(java.lang.Object, java.lang.Class)
PortableRemoteObject.java:296
java.lang.Object javax.rmi.PortableRemoteObject.narrow(java.lang.Object, java.lang.Class)
PortableRemoteObject.java:137
java.lang.String mypackage1.impl.MySessionEJBBean.Do()
MySessionEJBBean.java:39
java.lang.String MySessionEJB_StatelessSessionBeanWrapper6.Do()
MySessionEJB_StatelessSessionBeanWrapper6.java:85
java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
native code
void com.evermind.server.rmi.RMICallHandler.run(java.lang.Thread)
RMICallHandler.java:119
void com.evermind.server.rmi.RMICallHandler.run()
RMICallHandler.java:48
void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
PooledExecutor.java:803
void java.lang.Thread.run()
Thread.java:484
Can anyone help ?
What should I do to call remote e/o local interfaces located on different EARs ?
I�m using OC4J 9.0.3Hi Giuseppe,
If both EAR files are in the same OC4J instance you do not have to use RMIInitialContextFactory to invoke the EJB. You have to do the following:
In OC4J
1) Make the BBEAN as the parent for ABEAN application defined in the server.xml as follows:
application name="ABEAN" path="../applications/abean.ear" parent="BBEAN" auto-start="true" />
2)
You can define ejb-ref or ejb-local-ref in the deployment descriptor of your application
3) You can use the default InitialContext to lookup your EJB as if both EJBs are in the same application
regards
Debu -
Error using EJB from webapp.
Hi
Im trying to move a j2ee application from BEA to SunOne A 7.0.
Im getting an error when using/creating a EJB.
But i can use any method on another EJB. I havent set any authority rules at all and the xml file looks the same for both EJBs.
This application works fine on the BEA container.
The error is:
javax.ejb.EJBException: nested exception is: javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
javax.ejb.CreateException: Could not create stateless EJB: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:528)
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:68)
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:734)
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:176)
at com.sun.ejb.containers.StatelessSessionContainer.getContext(StatelessSessionContainer.java:457)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:452)
at se.ltjkpg.itc.intra.ejb.session.db.DBinterfaceBean_EJBObjectImpl.select(DBinterfaceBean_EJBObjectImpl.java:108)
at se.ltjkpg.itc.intra.ejb.session.db._DBinterfaceBean_EJBObjectImpl_Tie._invoke(Unknown Source)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:569)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:211)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:113)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:275)
at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:83)
at com.iplanet.ias.corba.ee.internal.iiop.ServicableWrapper.service(ServicableWrapper.java:25)
at com.iplanet.ias.util.threadpool.FastThreadPool$ThreadPoolThread.run(FastThreadPool.java:283)
at java.lang.Thread.run(Thread.java:536)
javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:736)
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:176)
at com.sun.ejb.containers.StatelessSessionContainer.getContext(StatelessSessionContainer.java:457)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:452)
at se.ltjkpg.itc.intra.ejb.session.db.DBinterfaceBean_EJBObjectImpl.select(DBinterfaceBean_EJBObjectImpl.java:108)
at se.ltjkpg.itc.intra.ejb.session.db._DBinterfaceBean_EJBObjectImpl_Tie._invoke(Unknown Source)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:569)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:211)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:113)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:275)
at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:83)
at com.iplanet.ias.corba.ee.internal.iiop.ServicableWrapper.service(ServicableWrapper.java:25)
at com.iplanet.ias.util.threadpool.FastThreadPool$ThreadPoolThread.run(FastThreadPool.java:283)
at java.lang.Thread.run(Thread.java:536)
javax.ejb.EJBException: nested exception is: javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
at com.sun.ejb.containers.StatelessSessionContainer.getContext(StatelessSessionContainer.java:461)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:452)
at se.ltjkpg.itc.intra.ejb.session.db.DBinterfaceBean_EJBObjectImpl.select(DBinterfaceBeaGrant the property permission in config/server.policy file of your app server instance
for eg:
grant {
permission java.util.PropertyPermission "os.version", "read";
HTH
Satish -
Using EJB from another connection pool in WLPI
Hi All,
I've deployed an entity bean (CMP) which used the connection pool other than the
one used by WLPI. When I execute the business operation I've defined for this
bean, the following exception is encountered:
"Couldn't get connection: java.sql.SQLException: Connection has already been created
in this tx context for pool named wlpiPool. Illegal attempt to create connection
from another pool: oraclePool"
Is there any other alternative for me to use the entity bean in WLPI?
Thanks,
FredInstead of using mulitiple connection pool,we are using single connection pool.
Our one application, accessing remote db also, for that we are using simple jdbc
connection. No pool.
We also tried OracleXAdriver. In that case, at the time of startup we are getting
weird error.
Thanks
JIgnesh Patel
"Fred" <[email protected]> wrote:
>
I simply turned all my CMP to BMP and get the connection from another
connection
pool. But that was not what I want. Is there any method that allows a
CMP to use
connection pool other than the wlpiPool pool in WLPI?
Thanks
"jignesh" <[email protected]> wrote:
Hi Fred,
We are also getting same error. How did you resolve this error ?
I'd appreciate,if you can post resolution of this error.
Thanks
Jignesh Patel
"Fred" <[email protected]> wrote:
Hi All,
I've deployed an entity bean (CMP) which used the connection pool other
than the
one used by WLPI. When I execute the business operation I've defined
for this
bean, the following exception is encountered:
"Couldn't get connection: java.sql.SQLException: Connection has already
been created
in this tx context for pool named wlpiPool. Illegal attempt to create
connection
from another pool: oraclePool"
Is there any other alternative for me to use the entity bean in WLPI?
Thanks,
Fred -
Sending xsi types using Axis from web service client
Hello,
I am using axis to consume a web service, the soap message generated contain xsi types which cause the validation of the message to fail. Example:
xsi:type="xsd:string"I have tried to remove these types using call.setProperty(Call.SEND_TYPE_ATTR,Boolean.FALSE); but this does not seem to work.
OPERATION_STYLE=document
Can someone please help
ThanksHaven't worked on this, but have you tried by putting the axis libraries inside the plugin lib folder when you are building up the plugin? Also you need to check asix2 compatibility with weblogic version with R2.
-Bikash -
WLS 6.1 Webapp using EJB from WLS 9.0
I have a WLS 6.1.7 based webapp that currently accesses an EJB deployed to WLS 8.1.5. I just tried upgrading the 8.1 server to 9.0.0. I was able to deploy the EJB just fine but the 6.1.7 based webapp is giving me the following error:
javax.naming.CommunicationException. Root exception is
weblogic.socket.UnrecoverableConnectException: [Login failed: 'Incompatible version:Incompatible versions - this server: '9.0.0' client: '6.1.7.0']
at weblogic.socket.Login.checkLoginSuccess(Login.java:77)
at weblogic.rjvm.t3.T3JVMConnection.connect(T3JVMConnection.java:273)
at weblogic.rjvm.t3.T3JVMConnection.createConnection(T3JVMConnection.java:325)
at weblogic.rjvm.Protocol.createConnection(Protocol.java:206)
at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionManager.java:1121)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:373)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:274)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:222)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:189)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:186)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:157)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:207)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:309)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:213)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:660)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241)
at javax.naming.InitialContext.init(InitialContext.java:217)
at javax.naming.InitialContext.<init>(InitialContext.java:193)
The Initial Context is being created with the following properties:
java.naming.provider.url=t3://localhost:7001
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.security.principal=system
java.naming.security.credentials=xxxx
Is there a way to get WLS 6.1 to talk to WLS 9.0?
Thanks,
RickI believe the constraint is communicating within 2 releases. ie 6.0 can talk to 7.0 and 8.1, but 9.0 is 3 releases away.
That being said, you can double-check this with [email protected]
-- Rob
WLS Blog http://dev2dev.bea.com/blog/rwoollen/ -
Using ejb service from a servlet in Weblogic 6.0sp1
anybody had sucess using ejb service from a servlet in Weblogic
6.0sp1 ?
It worked in Weblogic 6.0. But in 6.0sp1, the servlet startup always
return me "ClassCastException"
when narrowing a lookup of an ejbHome to the specific class.
Using this same ejb service from a standalone Java client wotked
fine in both versions.
Any body has aby clue ?
Help greatly appreciated
hyliu
The ejbc'ed jar needs to be in the CLASSPATH of the servlet server.
Gene
"Haiyang Liu" <[email protected]> wrote in message news:3ab2670c$[email protected]..
>
> anybody had sucess using ejb service from a servlet in Weblogic
> 6.0sp1 ?
>
> It worked in Weblogic 6.0. But in 6.0sp1, the servlet startup always
> return me "ClassCastException"
> when narrowing a lookup of an ejbHome to the specific class.
> Using this same ejb service from a standalone Java client wotked
> fine in both versions.
>
> Any body has aby clue ?
>
> Help greatly appreciated
>
> hyliu
>
-
Failed to use EJB's from startup class
Hi,
we use a startup class to set up some base services of our application.
The startup class must call some remote methods in a EJB. Unfortunately
a CLassCastException is thrown when we try to create the EJB by calling
the create method on its home interface:
Fr Nov 17 10:47:50 GMT+01:00 2000:<I> <WebLogicServer> Invoking
T3StartupDef ibs
startup ch.ebs.ibs.IBSStartup with {}
java.lang.ClassCastException: weblogic.t3.srvr.StartupThread
at
weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
tHandler.java:34)
at
weblogic.rmi.extensions.BasicRequestDispatcher.dispatch(BasicRequestD
ispatcher.java:82)
at
weblogic.rmi.internal.ServerRequest.sendOneWay(ServerRequest.java:73)
at
weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:77
at
ch.ebs.ibs.ejb.SessionControllerEJBHomeImpl_WLStub.create(SessionCont
rollerEJBHomeImpl_WLStub.java:151)
at ch.ebs.ibs.IBSStartup.startup(IBSStartup.java:69)
at
weblogic.t3.srvr.StartupThread.runStartup(StartupThread.java:182)
at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java:146)
at
weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
:62)
The same code works fine if we run it as client code (not in the startup
sequence).
Any idea?
Thanks PascalRegarding your problem and the remark you posted to my question in "Calling
EJBs from a thread in a startup class": It is possible to call methods of an
EJB from a startup class. I use this functionality to route messages from
JMS to my EJBs. From what you say, I assume that you are calling the EJB
from your startup method, which might be a problem, since WL is not
initialized at this point and does not accept any connections (this
obviously includes internal connections). You should wait for this phase to
finish and then use some other mechanism (e.g. a JMS message) to trigger
your startup class to invoke any home or remote methods on the EJB.
Looking at your stack trace, I am reminded of a very similar exception I
encountered when I was experimenting with WL a short while ago. I had put my
EJB jar file on WL's JAVA_CLASSPATH, just to see how the different
classloaders work. Of course I don't know if this has any relevance to your
configuration.
Andy
PS: The only exception to what I wrote in the first paragraph seems to be if
you start a new thread from the startup class. I still haven't managed to
call my EJB from this thread.
Pascal Rudin wrote:
Hi,
we use a startup class to set up some base services of our application.
The startup class must call some remote methods in a EJB. Unfortunately
a CLassCastException is thrown when we try to create the EJB by calling
the create method on its home interface:
Fr Nov 17 10:47:50 GMT+01:00 2000:<I> <WebLogicServer> Invoking
T3StartupDef ibs
startup ch.ebs.ibs.IBSStartup with {}
java.lang.ClassCastException: weblogic.t3.srvr.StartupThread
at
weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
tHandler.java:34)
at
weblogic.rmi.extensions.BasicRequestDispatcher.dispatch(BasicRequestD
ispatcher.java:82)
at
weblogic.rmi.internal.ServerRequest.sendOneWay(ServerRequest.java:73)
at
weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:77
at
ch.ebs.ibs.ejb.SessionControllerEJBHomeImpl_WLStub.create(SessionCont
rollerEJBHomeImpl_WLStub.java:151)
at ch.ebs.ibs.IBSStartup.startup(IBSStartup.java:69)
at
weblogic.t3.srvr.StartupThread.runStartup(StartupThread.java:182)
at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java:146)
at
weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
:62)
The same code works fine if we run it as client code (not in the startup
sequence).
Any idea?
Thanks Pascal
Maybe you are looking for
-
Outgoing calls to other Viatalk users go straight to their voicemail
I recently joined Viatalk and for the most part successfully configured the Linksys SPA2102-R adapter I got from Sunrocket. Now I don't have problem calling or receiving calls from friends that are NOT Viatalk users. My 2 friends who are also Viatalk
-
Content Viewer app for iPad not logging in?
I've checked all the boxes in troubleshooting this, they don't apply. Log in first via website, check, on both Windows Chrome and iPad Safari, still get Authentication Failed error with identical logon info from the Content Viewer app. Online chat he
-
Ipod Touch - Black, apple logo, white screen, black REPEATEDLY!
My ipod touch, 2nd or 3rd generation, keeps flashing from black, to apple logo, to white screen and back to black. Then about every 10th cycle or so it flashes the low battery screen and then shuts off. Only to begin its cycle again in a few minutes.
-
Hello, I have a problem concerning the printout of a Smartform in polish language from the SAP Portal, because the program RSTXCPDF goes into arithmetic overflow. This is the error message that we obtain: Business Server Page (BSP) Error Wyst±pi³ wyj
-
RADIUS (NGS) is not disconnecting users
Hi, I have a guest network set up on a WLC with an external RADIUS server (NAC Guest Server). However when the time profile expires (user account expires) on NGS the active user is not disconnected. Now if the user logs off the guest network (either