Returning cloned objects from EJB Local Interfaces
We'd like to let our WAS 5/J2EE container manage our transactions/unit of work. However, we don't want to have our objects serialized, so we intend to use LocalInterfaces. Additionally, we want to return value objects that support Toplink indirection such that we are not returning the actual cache object but instead a clone.Our question is, how do we return a cloned object that supports indirection from Toplink that we can later do a deepMergeClone on in an explicit update method?
Additional Information on the first post:
The pattern we've been testing is as follows:
1. We set up LocalInterfaces on our EJB's
2. The EJB Getters are using acquireNonSynchronizedUnitOfWork() to get a NON-JTS transaction to perform a readQuery. This results in a Cloned Bis object being generated. We then release the UOW and return the object.
3. The Returned Biz object Getters are using Indirection (probably using the released non-synchronized UOW).
4. The pattern for UPDATE is that we allow the Web Container code (servlet) to change the Cloned Biz Object, they then submit the CLONED and changed object to an EJB update() method where we use getClientSession().getActiveUnitOfWork() to link to the JTS transaction and perform a uow.deepMergeClone(bizObjectClone);
We are trying to use the pattern for the following reasons:
1. Isolation of the Cache to upper layers
2. Transaction Boundry is the EJB Container
3. We understand that there is a performance overhead with CLoned Biz Objects but this more mirrors the ValueObject Pattern then anything else we've tried.
BIG Question:
1. Is this a supported TopLink Pattern?
2. If its not supported, can it be?
3. Do you have any other suggested patterns?
Similar Messages
-
Creating a simple java client for a session EJB local interface
Hi all
Is it possible to create a simple java client for a session ejb local interface with JDeveloper.
The problem is that it creates a test client for a remote interface only...
i.e.
MySessionEJB sessionEJB = context.lookup("MySessionEJB")
and once i try to adjust it manually for the local interface...
MySessionEJBLocal sessionEJB = (MySessionEJBLocal) context.lookup("MySessionEJBLocal") (MySessionEJBLocal - is the name of my local interface)
it generates the exception:
javax.naming.NotFoundException: SessionEJBLocal not found
at...........................(RMIClientContext.java:52)
There is still no problem with accessing the local interface object from the jsf project where i've added <ejb-local-ref> tag into the web.xml file.
but i need the possibility of testing the simple java client for the local interface to test business methods wich should return objects without indirect properties
Thanks in advance.
Alex.Pedja thanks for reply.
I still dont understand what is wrong with my example.
The first peace of the code i wrote (getting the reference to the remote interface object) works pretty well, and even more it is produced automatically by JDeveloper, so why we cant get a reference to the local interface object the same way?
Certanly we should use the local interface for getting access to the resource functioning under the same local jvm and i think it doesnt metter wich app server we really use wls or oas or others
Thanks. Alex. -
Return proxy instances from EJB
Is weblogic able to return proxy instances from EJBs?
<BR>
I am using the session-facade pattern with DTO/Value-Object being passed between
facade and client(s). To handle different "levels of loading", I want to have
one DTO for an entity, but then restrict the available properties by wrapping
in an interface using java.lang.reflect.Proxy.
<BR>
Should this work? It doesn't. For example (from my session bean):<P><PRE>
return new MyDTO();
</PRE>works fine; however, the stubs generated by weblogic.ejbc have trouble unmarshalling
the return if I do:<P><PRE>
return Proxy.newProxyInstance(
MyInterface.class.getClassLoader(),
new Class[] { MyClass.class },
new MyPassThruHandler( new MyDTO() )
</PRE> returning various errors.
<BR>
Is this valid to do from weblogic? If not, I am mystified as to how not.
<BR>
Thanks,<P>
Steve
<BR>
P.S., I am using WL61sp3.Hi all,
Finally, I solve the problem. That is my misstake, i had a interface declared as private variable in the my concreteClass (inhert from AbstractClass)... now i declare as transient, let the interface variable don't to be serialize.
Now everything fine...:-) thanks for help anyway.
But just wonder why it don't throw any exception ???
Gordon -
How to return a object from a method in a java program to a C++ call (JNI )
Sir,
I am new to java and i have been assigned a task to be done using JNI.
My question is,
How can i return an object from a method in a java program to a call for the same method in a C++program using JNI.
Any help or suggesstions in this regard would be very useful.
Thanking you,
Anjan KumarHello
I would like to suggest that JNI should be your last choice and not your first choice. JNI is hard to get right. Since the JNI code is executing in the same address space as the JVM, any problems (on either side) will take down the entire process. It dilutes the Write Once Run Anywhere (WORA) value proposition because you need to provide the JNI component for all hardware/OS platforms. If you can keep your legacy code(or whatever you feel you need to do in JNI) in a separate address space and communicate via some inter-process channel, you end up with a system that is more flexible, portable, and scalable.
Having said all that, head over to the Java Native Interface: Programmer's Guide and Specification web page:
http://java.sun.com/docs/books/jni/
Scroll down to the Download the example code in this book in ZIP or tar.gz formats. links and download the example source. Study and run the example sources. The jniexamples/chap5/MyNewString demo creates a java.lang.String object in native code and returns it to the Java Language program. -
Does OAS9i(oc4j) support EJB Local interface?
Hi, I'm trying to use the petstore 1.3 framework on oc4j. I read the documentation, and know that it supports EJB 2. But I find the ejb local interface isn't supported.
Am I right?Hi Patrick,
As far as I know, OC4J only partially implements EJB 2.0 -- it
doesn't implement local interfaces. However, there are several,
different versions available. Which version are you using?
If you haven't already found it, there is a version of the pet
store application available for download from:
http://technet.oracle.com/sample_code/tech/java/oc4j/content.html
but it's an implementation of the 1.1.2 version.
Hope this helps,
Avi. -
Questions about EJB local interfaces - 9iAS 9.03
Intro: I am new in developing EJB, and I am trying to build an example to verify that a stateless session bean with local interfaces is quite efficient.
Q1: I have read that an application trying to access local interfaces of an EJB must run into the same JVM. Does it means that it should be deployed into the same OC4J instance as the servlet?
Q2: I am using JDev 10g to build the EJB, with local and remote interfaces. Using the internal OC4J container, I can use the remote interfaces but not the internal one: an object of class "_Proxy1" is returned after the lookup (with the same name as given for the remote interface related call). Is it possible to access the local interface?
Q3: My application architecture is already defined to split the business logic in two EJBs: one stateless session bean for volatile data and one entity bean for a global user list cache. Where can I find a working example (with source code, please) to be deployed on 9iAS that can validate my design?
Q4: In many places, I read that CMP entity bean are easier to develop than BMP one. Is there any special consideration I should be aware of before implementing a CMP for my global user list cache?
Thanks a lot, Dom.I have just read:
I think the problem is that local interfaces can only by
accessed through the same container, and JSP/Servlet's
one is different from EJB's one, regardless of you many
application server's instances do you have... Hope this
is the answer...Is there anyone who know if it applies too to 9iAS?
A+, Dom -
Access to ResultList objects from Labview user interface
Hi!
I would like to have access to TS Locals.ResultList[] objects from user interface (LV) after test report is generated.
According to TS Help in this point I can get sequence context for the process model sequence file which posts UIMsg_ModelState_PostProcessingComplete message.
But objects of my interest are located in context of client sequence file.
Can I get access to Locals.ResultList objects with use provided model file context?
Are there another ways to get wanted data?
I have references to sequence file and execution in this point and tried to use Execution.RunTimeVariables property.
But could not get wanted data with any supposed lookup string from this object.
Thanks in advance for any ideas.
Solved!
Go to Solution.The general idea is the following:
You have to keep in mind that Locals.ResultList on the model level (callstack) is simply the return value of a sequence call step (MainSequence). Therefore, you will only have this single entry [0].
To get access to the results of the steps inside you MainSequence (and any other sublevel in the callstack), you have to dig into this callstack using this "root-property":
Locals.ResultList[0].TS.SequenceCall.ResultList
hope this helps,
Norbert
[EDIT]: Since i have not stated it: The screenshot displays the UIMessageEvent callback function in a simple oi where the manager control is the Application Manager.
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it. -
EJB Local Interfaces / javax.naming.NamingException
Hi!
I have tried to deploy a very simple (Hello World like)EJB-Application. It contains a simple stateless SessionBean (with local interfaces) and a JSP which is using the EJB.
Opening the JSP i get the following error message:
javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance found for the ejb-local-ref 'ejb/TesterEJB', an EJB matching it's ejb-link 'ejb-jar-ic.jar#TesterEJB' was found, but it contained an Entity, not a Session
Here's my ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<display-name>oc4jJAR</display-name>
<enterprise-beans>
<session>
<display-name>TesterEJB</display-name>
<ejb-name>TesterEJB</ejb-name>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-class>oc4jtest.TesterBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<security-identity>
<description/>
<use-caller-identity/>
</security-identity>
</session>
</enterprise-beans>
<assembly-descriptor>
<method-permission>
<unchecked/>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getPrimaryKey</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getEJBLocalHome</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>remove</method-name>
<method-params>
<method-param>java.lang.Object</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>remove</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>isIdentical</method-name>
<method-params>
<method-param>javax.ejb.EJBLocalObject</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>create</method-name>
<method-params/>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
And here's my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>
<display-name>oc4jWAR</display-name>
<filter>
<filter-name>TestFilter</filter-name>
<display-name>TestFilter</display-name>
<description/>
<filter-class>oc4jtest.TestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>TestFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>test</servlet-name>
<display-name>test</display-name>
<jsp-file>/test.jsp</jsp-file>
</servlet>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/test.jsp</welcome-file>
</welcome-file-list>
<ejb-local-ref>
<ejb-ref-name>ejb/TesterEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-link>ejb-jar-ic.jar#TesterEJB</ejb-link>
</ejb-local-ref>
</web-app>
What's wrong?
Comments would be appreciated!
Thanks!
Peter
PS: The application runs fine on Sun's Reference Implementation!Hi!
I have tried to deploy a very simple (Hello World like)EJB-Application. It contains a simple stateless SessionBean (with local interfaces) and a JSP which is using the EJB.
Opening the JSP i get the following error message:
javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance found for the ejb-local-ref 'ejb/TesterEJB', an EJB matching it's ejb-link 'ejb-jar-ic.jar#TesterEJB' was found, but it contained an Entity, not a Session
Here's my ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<display-name>oc4jJAR</display-name>
<enterprise-beans>
<session>
<display-name>TesterEJB</display-name>
<ejb-name>TesterEJB</ejb-name>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-class>oc4jtest.TesterBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<security-identity>
<description/>
<use-caller-identity/>
</security-identity>
</session>
</enterprise-beans>
<assembly-descriptor>
<method-permission>
<unchecked/>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getPrimaryKey</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getEJBLocalHome</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>remove</method-name>
<method-params>
<method-param>java.lang.Object</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>remove</method-name>
<method-params/>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>isIdentical</method-name>
<method-params>
<method-param>javax.ejb.EJBLocalObject</method-param>
</method-params>
</method>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>create</method-name>
<method-params/>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>TesterEJB</ejb-name>
<method-intf>Local</method-intf>
<method-name>getMessage</method-name>
<method-params/>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
And here's my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>
<display-name>oc4jWAR</display-name>
<filter>
<filter-name>TestFilter</filter-name>
<display-name>TestFilter</display-name>
<description/>
<filter-class>oc4jtest.TestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>TestFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>test</servlet-name>
<display-name>test</display-name>
<jsp-file>/test.jsp</jsp-file>
</servlet>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/test.jsp</welcome-file>
</welcome-file-list>
<ejb-local-ref>
<ejb-ref-name>ejb/TesterEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>oc4jtest.TesterHome</local-home>
<local>oc4jtest.Tester</local>
<ejb-link>ejb-jar-ic.jar#TesterEJB</ejb-link>
</ejb-local-ref>
</web-app>
What's wrong?
Comments would be appreciated!
Thanks!
Peter
PS: The application runs fine on Sun's Reference Implementation! -
Is there support for ejb local interface?
Hi,
Is there support for ejb local intefaces in JDev? By default it creates remote interfaces
& I have to manually edit the interfaces as well as the ejb-jar.xml files.
I am using JDev 9.0.2.
Thanks in advance...
Regards..
DipankarRight. The aforementioned -migrate flag on the jdev or jdevw command line will migrate the IDE settings from your previous build.
Other upgrade issues are handled automatically the first time you open a project and save it with the new version. -
Using EJB Local Interface problem
Hi to all
I have got a problem in using Local EJB Interface in Weblogic , please attention to my description
I use JDeveloper as IDE
At first I create an Application in JDeveloper that has two projects that their names are Model and ViewContorller that first one contains my EJB and another contains my JSP page respectively
The EJB code is :
@Stateless(name="AliEJB001Bean")
@Remote
@Local
public class AliEJB001Bean implements AliEJB001, AliEJB001Local {
public AliEJB001Bean() {
public String Hi(){
return "Hi000";
And its Local Interface code is :
@Local
public interface AliEJB001Local {
String Hi();
I deploy Model project to an EJB Jar file that its name is AliEE1ejb1.jar
and I deploy the ViewContorller project to a WAR file that its name is AliEE1WebApp.war
Now I add this tags to web.xml
<ejb-local-ref>
<ejb-ref-name>ali/testejb</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>model.AliEJB001Local</local>
</ejb-local-ref>
Then I deploy the Application to an EAR file by name AliEE1
After those I run my JSP page witch calls the EJB in JDeveloper (through Local EJB Interface) , JDeveloper deploy my Application to the ItegratedWeblogicServer
Ultimately the JSP can calls the EJB through Local Interface and use the Hi method and shows me the result but JDeveloper while compiles the application give me these Warnings :
Warning: <May 15, 2011 9:02:52 AM PDT> <Error> <J2EE> <BEA-160187> <weblogic.appc failed to compile your application. Recompile with the -verbose option for more details. Please see the error message(s) below.>
Warning: There are 1 nested errors:
Warning: weblogic.servlet.internal.dd.compliance.ComplianceException: Element "<ejb-local-ref>" with ejb-ref-name "ali/testejb" must either specify a valid ejb-link element or have a corresponding ejb-reference-descriptor element in weblogic.xml with a valid jndi-name.
Warning: at weblogic.servlet.internal.dd.compliance.BaseComplianceChecker.addDescriptorError(BaseComplianceChecker.java:74)
Warning: at weblogic.servlet.internal.dd.compliance.BaseComplianceChecker.addDescriptorError(BaseComplianceChecker.java:80)
Warning: at weblogic.servlet.internal.dd.compliance.EJBRefsComplianceChecker.validate(EJBRefsComplianceChecker.java:97)
Warning: at weblogic.servlet.internal.dd.compliance.EJBRefsComplianceChecker.checkEJBLocalRef(EJBRefsComplianceChecker.java:47)
Warning: at weblogic.servlet.internal.dd.compliance.EJBRefsComplianceChecker.check(EJBRefsComplianceChecker.java:39)
Warning: at weblogic.servlet.internal.dd.compliance.ComplianceUtils.checkCompliance(ComplianceUtils.java:48)
Warning: at weblogic.servlet.jsp.JspcInvoker.checkCompliance(JspcInvoker.java:145)
Warning: at weblogic.servlet.jsp.JspcInvoker.compile(JspcInvoker.java:198)
Warning: at weblogic.application.compiler.AppcUtils.compileWAR(AppcUtils.java:376)
Warning: at weblogic.application.compiler.WARModule.compile(WARModule.java:245)
Warning: at weblogic.application.compiler.flow.SingleModuleCompileFlow.proecessModule(SingleModuleCompileFlow.java:18)
Warning: at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:36)
Warning: at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
Warning: at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
Warning: at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
Warning: at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)
Warning: at weblogic.application.compiler.WARCompiler.compile(WARCompiler.java:29)
Warning: at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:112)
Warning: at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:37)
Warning: at weblogic.application.compiler.Appc.runBody(Appc.java:198)
Warning: at weblogic.utils.compiler.Tool.run(Tool.java:158)
Warning: at weblogic.utils.compiler.Tool.run(Tool.java:115)
Warning: at weblogic.application.compiler.Appc.main(Appc.java:257)
Warning: at weblogic.appc.main(appc.java:14)
According to the warning messages I wanna add <ejb-link> tag to the web.xml for resolving warnings I add the <ejb-link> like this:
<ejb-local-ref>
<ejb-ref-name>ali/testejb</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>model.AliEJB001Local</local>
<ejb-link>AliEE1ejb1.jar#AliEJB001Bean </ejb-link>
</ejb-local-ref>
But when JDeveloper want deploy my application again it shows me this Error
[09:29:59 AM] Redeploying Application...
<May 15, 2011 9:29:59 AM PDT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1305476999381' for task '7'. Error is: 'weblogic.application.ModuleException: Could not setup environment'
weblogic.application.ModuleException: Could not setup environment
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
Truncated. see log file for complete stacktrace
Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'AliEE1ejb1.jar#AliEJB001Bean' declared in the ejb-ref or ejb-local-ref 'ali/testejb' in the application module 'ViewControllerWebApp.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:464)
at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:485)
at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
Truncated. see log file for complete stacktrace
>
<May 15, 2011 9:29:59 AM PDT> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 9 task for the application 'AliEE1'.>
<May 15, 2011 9:29:59 AM PDT> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'AliEE1'.>
<May 15, 2011 9:29:59 AM PDT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: Could not setup environment
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
Truncated. see log file for complete stacktrace
Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'AliEE1ejb1.jar#AliEJB001Bean' declared in the ejb-ref or ejb-local-ref 'ali/testejb' in the application module 'ViewControllerWebApp.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:464)
at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:485)
at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
Truncated. see log file for complete stacktrace
>
[09:30:00 AM] #### Deployment incomplete. ####
[09:30:00 AM] Remote deployment failed
Do you know how I can solve this issue ?
thanksThank you so much
I find out the solution
I have to define my EJB in ejb-jar.xml like this
<enterprise-beans>
<session>
<ejb-name>ReplicableSFSB2</ejb-name>
<business-local>model2.AliEJB001Local</business-local>
<business-remote>model2.AliEJB001</business-remote>
<ejb-class>model2.AliEJB001Bean</ejb-class>
<session-type>Stateless</session-type>
</session>
</enterprise-beans>
And then I use the EJB name witch I defined in <ejb-name> tag in <ejb-link> tag of web.xml
like this
<ejb-local-ref>
<ejb-ref-name>ali/testejb2</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>model2.AliEJB001Local</local>
<ejb-link>Model2EJB.jar#ReplicableSFSB2</ejb-link>
</ejb-local-ref> -
How will be the weblogic-ejb-jar and ejb-jar xml for EJB Local Interface?
Hi,
I have one ear application which is using Stateless Session Beans. I don't have any Bean to Bean communication . At present, the client is invoking remote methods thro Home/Remote interfaces. My doubt is , shall I implement EJBLocal home/ local interface to obtain this same functionality cos, in this app, both client and EJb bean have been deployed in same JVM. Can Local interfaces only be applicable to Bean - Bean relation ship?If LocalHome/Local interfaces can be implemented in my scenario, then may I know how will be the ejb-jar.xml and weblogic-ejb-jar.xml?
thanks and regards,
Venkat.Local interfaces are for communication between ejbs and their clients when both are in the same JVM. The clients can be normal clients, jsps, servlets, and other ejbs. If the client is not in the same JVM you cannot use local interfaces even though your client is another ejb.
Advantage of using local interface is it reduces the network overhead.
For more information you can download Mastering Enterprise Java Beans Third Edition by Ed Roman. You can go through 45
You can download pdf version from.
http://www.theserverside.com/books/wiley/masteringEJB/index.tss.
Let me know the URL of the ejb doc that you referred.
Thanks.. -
Newbie question on how to return java objects from java stored procedures
Hi,
As you may guess, i'm new to this.
I have a stored procedure that does some calculations and creates a list of java objects as the result of the query.
How would I return the list from the database to the client application?
Would I have to create an Oracle type that maps to the java object?
Please help.
JagHi Jag,
Your question is very vague (to me). Perhaps you could post what you have done so far? Have you tried looking through the Sample Code page of the Technet Web site, or tried searching the Ask tom Web site, or MetaLink?
Good Luck,
Avi. -
My understanding is that the concept of local interfaces (i.e.
direct invocation in lieu of an IPC) exist in EJB 2.0. Does
OC4J support this today? If not, will there be support for it
in 9i AS 2.0?
Thanks.oc4j/orion supports ejb 2.0 as it stood in the second draft.
There have been many changes since then, including dropping DO's
and using Local Interfaces instead.
OC4J/Orion will have a new version by the end of this year or
early next year which will implement ejb 2.0.
Until then, if you want the speed you would get with local
interfaces in oc4j/orion, you can modify your orion-ejb-jar.xml
to use copy-by-value="false". This will give you the same
performance gain as using local interfaces. Its a hack, but what
the heck, it works.
Regards,
the elephantwalker
www.elephantwalker.com -
Return NamingEnumeration object from the webservice method.
I am developing a webservice for creating a connection with LDAP and get user first name from LDAP. For this I developed the following webservice in netbeans 6.0 by using Glass Fish V2 server.
package san.exam;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.naming.*;
import javax.naming.directory.*;
import java.util.*;
@WebService()
public class LDAP {
@WebMethod
public NamingEnumeration getUser(@WebParam(name = "firstName") String firstName) throws Exception {
// TODO implement operation
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://chdsez89674d:389/");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,"cn=root"); // specify the username
env.put(Context.SECURITY_CREDENTIALS,"vicky123");
// Create the initial context
DirContext ctx = new InitialDirContext(env);
Attributes matchAttrs = new BasicAttributes(true); // ignore attribute name case
matchAttrs.put(new BasicAttribute("uid", firstName));
NamingEnumeration answer = ctx.search("ou=white pages,dc=ibm",matchAttrs);
ctx.close();
return answer;
We are not able deploy this webservice. I don�t know what the problem is. But we are able to make web service where we returned int or string or float and able to use this webservice by making webservice client.
I think in this case we are trying to return NamingEnumeration object so the problem has come. Has anyone solve this problem or tell me how to return the NamingEnumeration object in the webservice?
Any pointer regarding this problem is helpful for me.If you want to transfer an object through RMI it should be Serializable. Add 'implements Serializable' to your class. That's it
import java.io.Serializable;
class TransferObject implements Serializable {
} -
Does JDev 9.0.3 support EJB Local Interfaces?
Hi everyone, we are very interested in using local interfaces for our EJB's to set up and use a standard set of server beans that will run in each server. I did not see any reference to local interfaces in any of the release notes on version 9.0.3.
Does anyone know? And if not, does anyone know when they might be supported?
TIA for any responses.Yes. Local interfaces for EJBs are supported.
Maybe you are looking for
-
Mapping between Sales Order-Schedule-Line and Delivery-item
Hi together, I want to extend the Datasource 2LIS_12_VCITM (Delivery-number, -item, Order-number,-item is available) by Sales Order Schedule Line. Could not find any ERP table (VBEP and LIPS allow a mapping only on item level) for the mapping between
-
Can't play any CD's or burn any either
I have looked for a similar question to mine but nothing fits exactly so here goes. I have had a problem burning cd's for some time and have turned the burn speed to the slowest. It starts to do the job, stops, spits my cd out which is then unusable
-
Windows 8.1 Blue Screen of Death "Critical process died" after Windows update
Hey there, my Envy laptop has the "Critical Process Died" blue screen of death error after doing 3 things today: 1. A BIOS update through HP Support Assistant. 2. An x64 windows process update (optional) through the Control Panel. 3. An NVIDIA update
-
Error using WSPUBLISH in PI 7.1 - No Publication possible from Integration
Hi When we use WSPUBLISH in 7.1 we get the the error "No Publication possible from Integration Server(IS)." Message no. MSG_CL_ER041 We found the code tests to see in the ENGINE_TYPE is not HUB - this setting is set in SXMB_ADM -> Integration Engine
-
I have a requirement to retrieve either a PDF or a Word document from the database, and eventually display it in my JavaFX 2.2 application. I had been looking out for ideas and falling short. Any hints on how this could be implemented would be highly