Call one session EJB3 from jboss to weblogic 10
Hi everyone.
I have a big problem. I have a session ejb3 in a weblogic server. I need start this session from jboss server.The code I used is as follows:
Environment env = new Environment();
env.setInitialContextFactory(weblogic.jndi.Environment.DEFAULT_INITIAL_CONTEXT_FACTORY);
env.setProviderURL("t3://ip:7001");
env.setSecurityPrincipal("weblogic");
env.setSecurityCredentials("cajamar1");
Hashtable props = env.getProperties();
I copied all the libraries that I have been asking in the JBOSS server. In the end I managed to work but when I do the lookup on my session I get this error message.
++14:51:46,939 ERROR [STDERR] 09-sep-2010 14:51:46 weblogic.utils.classloaders.ClassPreProcessor$ClassPreProcessorSupport preProcess++
++ADVERTENCIA: Error pre-processing class com.gh.conn.GHBackEndConnectorInterface with weblogic.ejb.container.deployer.RemoteBizIntfClas++
++sPreProcessor@b1c3bc3'++
++java.lang.NoSuchMethodError: <init>++
++at weblogic.ejb.container.deployer.RemoteBizIntfClassPreProcessor.preProcess(RemoteBizIntfClassPreProcessor.java:52)++
++at weblogic.utils.classloaders.ClassPreProcessor$ClassPreProcessorSupport.preProcess(ClassPreProcessor.java:102)++
++at weblogic.utils.classloaders.GenericClassLoader.doPreProcess(GenericClassLoader.java:341)++
++at weblogic.ejb.container.deployer.RemoteBizIntfClassLoader.enhanceClass(RemoteBizIntfClassLoader.java:143)++
++at weblogic.ejb.container.deployer.RemoteBizIntfClassLoader.loadClass(RemoteBizIntfClassLoader.java:129)++
++at weblogic.ejb.container.internal.RemoteBusinessIntfGenerator.generateRemoteInterface(RemoteBusinessIntfGenerator.java:67)++
++at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.readObject(RemoteBusinessIntfProxy.java:234)++
++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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)++
++at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)++
++at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)++
++at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)++
++at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)++
++at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)++
++at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)++
++at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)++
++at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)++
++at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:197)++
Any help on the issue. Thanks for all.
Hi,
Please make sure that you have generated the Client Side Artifacts of your EJB3.0 App and Placed then at the JBoss side (Client side). Please refert to ": *http://weblogic-wonders.com/weblogic/2010/04/02/generating-ejb3-clientjar/*
Also make sure that you have "weblogic.jar" file at Cleint Application Side.
Thanks
Jay SenSharma
Similar Messages
-
Migrate EJB 3.0 from JBoss to Weblogic 10.3.5
Hi all,
I need help in deploying my ear file from Jboss to Weblogic, got this error relates to EJB module:
####<Dec 26, 2012 10:45:03 PM PST> <Warning> <Deployer> <localhost.localdomain> <AdminServer> <[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1356590703830> <BEA-149004> <Failures were detected while initiating deploy task for application 'MyScheduler'.>
####<Dec 26, 2012 10:45:03 PM PST> <Error> <Console> <localhost.localdomain> <AdminServer> <[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'> <tungpl> <> <> <1356590703869> <BEA-240003> <Console encountered the following error weblogic.application.ModuleException: Could not setup environment
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1495)
at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:438)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
at weblogic.application.internal.flow.ScopedModuleDriver.activate(ScopedModuleDriver.java:194)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:227)
at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:541)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:175)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:167)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: javax.naming.NameNotFoundException: While trying to look up ejb-info in /app/ejb/myEjb.jar#myEjb.; remaining name 'ejb-info'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
at weblogic.deployment.BaseEnvironmentBuilder.autowireEJBRef(BaseEnvironmentBuilder.java:408)
at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:513)
at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3144)
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1493)
>
I have tried some solution in this thread https://kr.forums.oracle.com/forums/thread.jspa?threadID=2174802 but it doesn't help at all.
Could sb give me any idea?
Pretty thanks!
Edited by: user12925202 on Jan 20, 2013 11:33 PMFrank,
Thanks. The @LOB annotations are missing.
Create table with:
CREATE TABLE TestBlob (id number PRIMARY KEY, xmlCol BLOB);
INSERT INTO TestBlob VALUES(1, EMPTY_BLOB());
The following is the complete listing for the EJB 3 class generated from table TestBlob.
package ejb3;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
@Entity
@NamedQueries({
@NamedQuery(name = "Testblob.findAll", query = "select o from Testblob o")
public class Testblob implements Serializable {
@Id
@Column(nullable = false)
private Long id;
private byte[] xmlCol;
public Testblob() {
public Testblob(Long id) {
this.id = id;
public Long getId() {
return id;
public void setId(Long id) {
this.id = id;
public byte[] getXmlCol() {
return xmlCol;
public void setXmlCol(byte[] xmlCol) {
this.xmlCol = xmlCol;
} -
Error in deploying entity beans - migration from JBoss to Weblogic 10.3.4
Hi,
I am migrating EJB2.x code from JBoss to Weblogic 10.3.4. As a first step, I am tyring to deploy just Entity beans. I get following error when deploying to server.
'weblogic.application.ModuleException: Exception preparing module: EJBModule(myEJB.jar)
Unable to deploy EJB: CollMetaData from myEJB.jar:
[EJB:011017]Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was:
There are 1 nested errors:
java.lang.NullPointerException
at weblogic.ejb.container.cmp.rdbms.finders.EjbqlFinder.setMethods(EjbqlFinder.java:288)
at weblogic.ejb.container.cmp.rdbms.Deployer.processFinders(Deployer.java:744)
at weblogic.ejb.container.cmp.rdbms.Deployer.readTypeSpecificData(Deployer.java:446)
at weblogic.ejb.container.persistence.PersistenceType.setTypeSpecificFile(PersistenceType.java:506)
at weblogic.ejb.container.persistence.PersistenceType.setupDeployer(PersistenceType.java:455)
at weblogic.ejb.container.deployer.CMPInfoImpl.setup(CMPInfoImpl.java:118)
at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1214)
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:442)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Can someone help me fixing the issue?
I changed schema locations of descriptor files as suggested at http://download.oracle.com/docs/cd/E17904_01/web.1111/e13706/overview.htm#i1074199 (see the third category for '*Enterprise Bean 2.1*' in the listing Table 1-1). Alternatively, you may see the schema locations for EJB2.0 directly at http://download.oracle.com/docs/cd/E17904_01/web.1111/e13719/dd_reference.htm#EJBPG481JRE version in JBoss is 1.6.0_16. JVM in web logic is pointing to jrockit_160_22_D1.1.1-3 which is come in the package. It doesn't seem to be related to JVM version mismatch.
I think it is an issue with definitions in weblogic-cmp-rdbms-jar.xml file. How should be the definition of entity-descriptor appear for entity bean which has finder methods in ejb-jar.xml?
Please see the snippets from corresponding descriptor files below.
ejb-jar.xml
=========
<entity>
<display-name>EmpBean</display-name>
<ejb-name>EmpBean</ejb-name>
<local-home>LocalEmpBeanHome</local-home>
<local>LocalEmpBean</local>
<ejb-class>EmpBeanBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>EmpBean</abstract-schema-name>
<cmp-field>
<field-name>firstName</field-name>
</cmp-field>
<cmp-field>
<field-name>lastName</field-name>
</cmp-field>
<cmp-field>
<field-name>phone</field-name>
</cmp-field>
<cmp-field>
<field-name>address</field-name>
</cmp-field>
<primkey-field>lastName</primkey-field>
<query>
<query-method>
<method-name>findByPrimaryKey</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>SELECT Object(o) FROM EmpBean o WHERE o.lastName= ?1</ejb-ql>
</query>
</entity>
weblogic-jar.xml
============
<weblogic-enterprise-bean>
<ejb-name>EmpBean</ejb-name>
<entity-descriptor>
<pool>
<max-beans-in-free-pool>20</max-beans-in-free-pool>
<initial-beans-in-free-pool>5</initial-beans-in-free-pool>
</pool>
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>meta-inf/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-use>
<finders-load-bean>true</finders-load-bean>
</persistence>
</entity-descriptor>
<local-jndi-name>ejb/EmpBean</local-jndi-name>
</weblogic-enterprise-bean>
weblogic-cmp-rdbms-jar.xml
====================
<weblogic-rdbms-bean>
<ejb-name>EmpBean</ejb-name>
<data-source-jndi-name>mysqlDS</data-source-jndi-name>
<table-map>
<table-name>emp</table-name>
<field-map>
<cmp-field>firstName</cmp-field>
<dbms-column>first_namel</dbms-column>
</field-map>
<field-map>
<cmp-field>lastName</cmp-field>
<dbms-column>last_name</dbms-column>
</field-map>
<field-map>
<cmp-field>phone</cmp-field>
<dbms-column>phone</dbms-column>
</field-map>
<field-map>
<cmp-field>address</cmp-field>
<dbms-column>address</dbms-column>
</field-map>
</table-map>
<weblogic-rdbms-bean>
Please ignore any typos that you may notice in above sample descriptions (because I just typed it here changing original names).
When I try to deploy the application, I get error message as posted in my first post above in this thread. Please correct me if I am making any erros in descriptor files.
Edited by: 839281 on Feb 25, 2011 10:55 AM
Edited by: venkatp on Mar 1, 2011 9:31 AM -
Calling one report program from another
Hi All,
i am calling one report program from my program & exporting it's output to SAP-SPOOL using SUBMIT statement. I want to fetch the spool no in my program for this spool. Please guide me how this can be achieved? i have tried SYST- SPONO but it's not working.
Thanks & Regards,
Chetan.Hi,
Initially check this it might be helpful to u.
http://help.sap.com/saphelp_sm40/helpdata/en/30/cc154219fce12ce10000000a1550b0/content.htm.
Even use the function module slike Job_open , Job_close this is also one of the methid to achive spool requests.
Regards,
Sana.
Reward with points if found helpful.. -
Calling one WAD Report from another WAD Report
Hi All,
I want to Call one WAD report from another WAD Report and I want to show that Report in a Container of the Calling Report Itself. Kindly give the Solution. Thanks for your support in advance.
Thanks & Regards
ShivaHi Shiva,
There is Command called "SET_TEMPLATE" Set Web Template.
Here you can select any of your existing web template and choose to open it in current page of in a new window.
Hope it helps.
Regards,
Pratap Sone -
How sholud we call one jframe class from another jframe class
Hi
In my application i am calling one jframe class from another jframe clas.
how sholud we make previous jframe inactve when another jframe is invoked?(user sholud not able to make any changes on on parent jframe window when another jframe is invoked)
Pls reply.Sorry for me it is not possible to change existing code,
pls suggest me any other solution so that i can inactive parent jframe when child jframe execution is going on. -
Calling a session bean from another bean
Hi,
Using weblogic server 6.1, I am trying to call a session bean, B, from a session bean A.
After importing B's package, I have added the following code to A's implementation:
try {
Properties h = new Properties(); h.putContext.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://localhost:7001" );
Context ctx = new InitialContext(h);
Object tempHome = ctx.lookup(JNDI Name of B);
BHome home;
home = (BHome)javax.rmi.PortableRemoteObject.narrow(tempHome, BHome.class);
catch(Exception e){...}
I can compile the code successfully but when I run it,I get an error saying:"java.lang.NoClassDefFoundError: B.BHome"
Can someone please tell me where I am going wrong?
Thanks in advance,
FauziaI haven't used that web server but I have had the same kind of problem with ours.
My guess is that you are compiling this in an environment where the home class is in the classpath. When you run it, though, this class cannot be resolved. Usually we have this problem when the class that is trying to get the bean is unable to find the remote jar. -
Calling a Session bean from a java client
Hi
I have been using OC4J for quite some while now, and I have a lot of programs to test my session beans. But with the new versions of the container 9.0.2.0.0 production release and 9.0.3.0.0 pre-release J2EE 1.3 certified, all my test program hang in the lookup method. I have an earlier pre-release of 9.0.3.0.0 (the same version number but not j2EE 1.3 certified -> confusing) where my test programs works without any problems.
I have included a small code sample of how I call the session beans.
I hope some one can see what I'm doing wrong or what have changed compared to the earlier versions!
/Thanks
Morten
Properties prop = new Properties();
prop.put Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
prop.put(Context.PROVIDER_URL, "ormi://mma:23791/rmitest" );
prop.put(Context.SECURITY_PRINCIPAL, "admin");
prop.put(Context.SECURITY_CREDENTIALS, "welcome");
Context ctx = new InitialContext(prop);
//look up jndi name
Object ref = ctx.lookup("Enterprise1");I got i working right now, it seems like I was using the wrong version of oc4j.jar and ejb.jar when I was building my project!
-
Is it possible to call one mathscript function from another?
HI iam bahrath..i need call the operation takin place in one mathscript in another..is it possible?pls help..
Thanks for your concern..let me explain my project.Iam actually developing a system which provides the stress strain relationship of a material..For calculating strain which is nonlinear in this case we are using image processing techniques.We take a picture of the system initially with light markers and we find the centroid of all the markers(i use four of them).After the force is applied on the particle the centroid of the markers change as the marker positions change.I use this change in the centroid and calculate the strain.Now, 90% of the code is ready in matlab(jus capturing image and usin is needed).But i have been asked to implement it in labview.so iam tryin to put the code in mathscript and try.But the problem i face is incompatibility of many functions like imshow,input etc.so im implementin parts of the code inlabview mwthod and rest in mathscript.In matlab code i have two files and call the function in in another file from one file..thus i thought i might use two mathscripts and call one from the other..pls help.
-
Trying to call stateless session bean from MDB
Folks,
Am working on RAD and WAS 8.
I have an MDB. And a stateless session bean (AOBean under EJB project).
While the listener listens to the messages from queue, it also tries to persist to db. I want to achieve this via a method of AOBean (through instantiating session bean or by injection).
I have been sucessful by invoking a method from AOBean class - that method just returns a string (without any objects being passed)
Problem:
I am getting IllegalStateException when I try to invoke a method of AOBean class, that has an object as a parameter
For eg:
MDB
@EJB(name="ejb/TransactionMgrAOBean", mappedName="ejb/TransactionMgrAOBean")
ITransactionMgrAO tranAO;
public void onMessage(Message message) {
TextMessage textMessage = (TextMessage) message;
boolean status = false;
try {
TransactionVO tranVO = getTransactionVO();//Here building the object to be passed to session bean
String status1 = tranAO.getVersion(tranVO);
}catch(Exception e){
AOBean
@Stateless
@Remote({ ITransactionMgrAO.class })
@WebService
public class TransactionMgrAOBean {
public String getVersion(TransactionVO tranVO) throws Exception{
try{
//business logic
} catch(Exception e){
throw e;
return true;
TransactionVO implements Serializable has also inner static classes that are not Serializable.
EXCEPTION: At runtime we are getting exception saying that the inner classes are not serialized.
REASON why we are invoking session bean from MDB? We found that if we invoke any service from AOBean the transaction management was successful. We are using sessionContext.setRollBackonly when an exception occurs. Tranasactions are not rolled back when any db exception occurs if we invoke business logic methods from Model layer of another NON-EJB package.
Hope I have provided enough information!My concret problem is that I want to call an ejb session contained in an ejb project from a session bean in a different web project. When I include the code in my web session bean I get the error adjunted:
- Code:
@EJB
private UserRemote userSessionBean;
- Error:
Exception Details: javax.naming.NameNotFoundException
pac.UserRemote#pac.UserRemote not found
Possible Source of Error:
Class Name: com.sun.enterprise.naming.TransientContext
File Name: TransientContext.java
Method Name: doLookup
Line Number: 216
Any suggestion? -
Calling Local Stateless session bean from Spring in weblogic 10.3
We are in the process of upgrading to Weblogic 10.3 from OC4J (OAS). We are using Spring and Stateless Session EJB 3 Local beans (Don't ask me why, it is decided before I came to the project).
Previously (OC4J):
-> There is no ejb-jar.xml. EJBs are configured with annotation @Stateless. No "name" or "mappedName" are defined.
Spring POJOs access EJBs by using "EJBMODULENAME_<<EJBBeanClass>>Local" as JNDI Name. I think this strange JNDI name is what OC4J assigns when there is no explicit JNDI name defined.
Sample Spring Bean configuration -
<bean name="securityEJB" class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean" lazy-init="true">
<property name="jndiName">
<value>myapp-ejb_SecurityEJBImplLocal</value>
</property>
<property name="resourceRef">
<value>false</value>
</property>
<property name="businessInterface">
<value>my.package.SecurityEJB</value>
</property>
</bean>
I understand that weblogic 10.x doesn't give any global JNDI name (JNDI tree is empty) and also looked at the blog, Link: [http://m-button.blogspot.com/2008/07/reminder-on-how-to-use-ejb3-with.html]
So far I have tried,
1. @EJB annotation works but, I don't want to add @EJB annotations in the entire application. Since we are using Spring and EJB3, I am trying to avoid mixing them -
2. java:comp/env is supposed to work (since it is a local session bean), but it doesn't for me.
I haven't added weblogic-ejb-jar.xml as I don't think it is going to help, as there is no global JNDI name defined. Am I missing some thing?
ThxHi,
if you don't want to use @EJB to inject the EJB, then you'll need declare the EJB reference in deployment descriptor.
Here is an example copied from EJB3 spec:
<ejb-local-ref>
<description>
This is a reference to the local business interface
of an EJB 3.0 session bean that provides a payroll
service.
</description>
<ejb-ref-name>ejb/Payroll</ejb-ref-name>
<local>com.aardvark.payroll.Payroll</local>
</ejb-local-ref>
then you can lookup the local ejb from "java:comp/env/ejb/Payroll". -
Using Session EJB from MDB in Weblogic 11G
I am having trouble with what should be a very simple operation. I have created an MDB and deployed it successfully on the Weblogic managed server. Then in a separate application, I created a Stateless session bean that I would also like to call from the MDB. My SSB deploys and works fine. I added an @EJB annotation to the MDB so I could instantiate and access the SSB from the MDB. In order to resolve the interface class in jDeveloper, I went to my MDB project properties under libraries and classpath and added the jar file for my ejb.
When I try to redeploy the MDB, I get a java.lang.ClassNotFoundException on the SSB interface class.
Is there an example somewhere of how to properly create and configure all of the deployment packages and refereneces I need on the weblogic server? The SSB is a common service that going to be called by a lot of other MDBs in my system. Optimally, what I would like to do is to deploy the ejb-client.jar as a shared library so all of my MDBs can use it.
Thanks for any pointers!I am using jDeveloper 11g, so both my MDB and SLSB were built and deployed using the wizzards in the IDE.
The MDB is inside of an ejb-jar and deployed to a managed server. I am doing my development on a box that is resource challenged so I setup my WLS on a different box. There is an admin server (AdminServer) and a separate soa server (soa_server1) on which I have installed all of the SOA Suite packages.
The SLSB represents a primary service for the system I am building. Service1SessionBean is deployed targeted to soa_server1. The MDB is also deployed to soa_server1. At least it was until I tried to add the EJB reference. Now it won't deploy at all.
I would like to avoid packaging the Service1SessionBean client jar in with the MDB because there are several other EJBs that will also need to call the service. I would like to deploy the client jar as a shared library on soa_server1 so that any EJB artifacts that need to call it may do so, I have tried to deploy the client jar as a shared library using jDeveloper but when it deploys, it seems to be under the name "j2ee-app" rather than Service1SessionBean. -
Calling one java program from another
Hello,
How can I start another java program from one? Lets
say I want Second.java to start by calling it from
First.java. How do I do it? The two programs are given
below. Any help is appreciated.
Thanks,
Amanda
First.java
import java.io.*;
import java.lang.reflect.*;
public class First
public static void main(String[] args)
Process theProcess=null;
System.out.println("Hello World from First.java!");
String second=new String("Second.java");
//System.load(second);
//Runtime.getRuntime().load(second);
try
theProcess=Runtime.getRuntime().exec( "Second.java"
System.out.println("after exec");
catch (IOException ioe)
System.out.println(">>IOException thrown in
First.java while calling
Second.java."+ioe.getMessage());
Second.java
public class Second
public static void main(String[] args)
System.out.println("Hello World from Second.java!");
}Thanks, warnerja
What if Second.java is on a remote machine i.e.
First.java and second.java are on different machines?
Will I have to use RMI?Well, you'd have to do some kind of remote invocation. Depends on what kinds of apps house the classes. There are all kinds of ways - web services, servlets, RMI, (maybe others...)
That's a totally different question than what you originally posted, and would have been very relevant to say so in the first place. -
Calling one WTC service from another WTC service
Hi,
We have a service called COLLECT defined in our WTC server.
Recently we've added a second service called SUM in the same WTC server.
We were wondering if it's possible to call SUM from COLLECT, and if it is, what configuration changes should be made in order to do it?
Currently both services are exported by the WTC server (and imported by our Tuxedo).
Thanks,
ShyHi Shy,
Although I haven't tried it, I'm fairly certain you cannot call a Tuxedo EJB using tpcall() within a WTC based application. What I normally advise customers to do when writing a Tuxedo EJB is to implement two separate interfaces. One is obviously the TuxedoService interface that all Tuxedo EJBs must implement. In particular you must implement the service() method that accepts a TPServiceInformation instance that provides access to the typed buffer passed to the EJB. Normally one then extracts the necessary fields or information from the typed buffer, performs whatever necessary business logic needs to be performed, and then constructs a reply typed buffer.
What I recommend is that you separate out the business logic into a separate interface and have your class implement both interfaces. The service() method would only deal with the marshalling/unmarshalling of the information contained in the typed buffers, and leave all business processing to methods on the second interface. Then if you need to access another "service", you would use the second interface, thus saving you from all the typed buffer manipulation.
So in your case, the business logic in the second interface of the COLLECT implementation would simply call the SUM implementations second interface (the EJB's business logic) instead of trying to call a Tuxedo service. While this helps in reuse of the business logic, it doesn't address the issue of trying to transparently move a service implementation from say Tuxedo to WLS. If that's what you are trying to do, you might try exporting the SUM service from WTC to the Tuxedo domain gateway, and then importing the SUM service from that gateway. This would likely cause a network round trip if it works, but it's something to consider.
Another alternative is to use something like the Apache Tuscany/Java project and build your Java applications using SCA. Tuxedo SALT includes a Tuscany/Java binding extension that allows Tuscany/Java applications to transparently call Tuxedo services. The choice of whether to actually call a Tuxedo service or call a Tuscany/Java based SCA service is determine by the binding selection and not changes in your code. Just a thought...
Regards,
Todd Little
Oracle Tuxedo Chief Architect -
Porting from JBoss to WebLogic
There's a migration tool on the WebLogic site (wltool.zip) that purports to convert JBoss 4.x deployment descriptors to WebLogic 9.x format. When I run the tool I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/ejb20/dd/xml/DDUtils
at weblogic.tools.EJBHandler.<init>(EJBHandler.java:25)
at weblogic.tools.WLHandlerFactory.getHandler(WLHandlerFactory.java:11)
at weblogic.tools.jb2wl.convertToWL(jb2wl.java:45)
at weblogic.tools.jb2wl.<init>(jb2wl.java:28)
at weblogic.tools.jb2wl.main(jb2wl.java:62)
I've got every jar in the 9.2 server/lib in the classpath, but from what I can tell the package weblogic.ejb20.dd.xml doesn't exist.
Is there an update for the migration tool, or am I missing something?It appears that tool is based on WLS 8.1 and hasn't been ported to 9.x. It is using internal classes so it won't just work on multiple WLS versions unchanged.
Unfortunately I don't have any better suggestion than downloading 8.1 and running the tool there to generate the weblogic descriptors.
You could than run the weblogic.DDConverter tool in 9.x to convert the 8.1 descriptors to the 9.x/JEE 5 versions if you wanted. 8.1 descriptors will work fine in 9.x unchanged though.
-- Rob
WLS Blog http://dev2dev.bea.com/blog/rwoollen/
Maybe you are looking for
-
I'm confused as to the procedure of transferring a large amount of photos and videos from my iPad Mini (iOS 8) to my iMac (latest Yosemite OS) without using wifi or Bluetooth or uploading to iCloud - I wish to transfer the files using a simple USB co
-
I recently purchased a 2nd hand ipad 4 (wifi + Cellular). Only problem is it didn't come with a sim card and I don't know who the network provider is? Will any carrier micro sim work? If not, how do I find out the correct provider? Thank you for your
-
I am trying to stream music from my iMac using iTunes music files to my Cocktail Audio X10 music streamer. I have allowed my files to be shared the X10 sees the files but when I try to accsess them it gives me the message files not mounted. Please he
-
How to remove closed captions?
The procedure says 1 Press the Menu button on your remote control. 2 Select Settings. 3 Select Accessibility. 4 Select Close Captions. 5 Select either On or Off and press OK. However, under the menu Settings, I don't have the selection Accessibility
-
Inet6_ifa_notify Error in show tech
Dear Team, Our ACE box continously getting hung and not responding to console or any of the management access. Issue is resolved after reboot. From the sh tech output we are seeing following logs. show system internal dmesg` t failed for 0000:0000:00