473,804 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Serializing EJB Parameters in Weblogic

I have been using Weblogic 5.1 for a couple of years. I currently
pass an object as a parameter to my ejbCreate method. The data in the
object could be modified by my bean and the caller needs to see these
changes. This worked fine in 5.1, but it does not work since I have
upgraded to Weblogic 7.0. The changes to the object passed as a
parameter does not make it back to the caller on the remote interface.
I assume the object is not being serialized back to the client. Does
anyone know why this behavior has changed and is there a way I can
indicate to the ejb container that I want these parameters serialized
back?
Jul 17 '05 #1
1 3844
Ma************@ insightbb.com (Martin Zeigler) wrote:
I have been using Weblogic 5.1 for a couple of years. I currently
pass an object as a parameter to my ejbCreate method. The data in the
object could be modified by my bean and the caller needs to see these
changes. This worked fine in 5.1, but it does not work since I have
upgraded to Weblogic 7.0. The changes to the object passed as a
parameter does not make it back to the caller on the remote interface.
I assume the object is not being serialized back to the client. Does
anyone know why this behavior has changed and is there a way I can
indicate to the ejb container that I want these parameters serialized
back?


There is no "serialized back" in EJB. I haven't tried what you're
doing, but it definitely should NOT work. I would speculate that what
you are seeing is a bug in WebLogic 5.1, associated with their
optimization of "local calls to Remote Interfaces". They probably gave
your bean the reference to the actual object, which is expressly
forbidden by section 18.2.3 of the EJB 1.1 Specification:
"Specifical ly, the EJB Container is not allowed to pass
non-remote objects by reference on inter-EJB invocations
when the calling and called enterprise beans are collocated
in the same JVM. Doing so could result in the multiple beans
sharing the state of a Java object, which would break the
enterprise bean's semantics."
(In the EJB 2.0 Specification, this requirement is in section 24.2.7).

Fortunately for you, there is an easy solution: change your bean to
use a Local Interface instead of a Remote Interface (and of course,
LocalHome instead of Home Interface). This will allow the arguments to
be passed by reference*:
"An enterprise bean's local home and local interfaces are
local Java interfaces. The caller and callee enterprise
beans that make use of these local interfaces are typically
collocated in the same JVM. The EJB Container must ensure
the semantics for passing arguments across these interfaces
conforms to the standard argument passing semantics of the
Java programming language." -- EJB 2.0 Spec, Section 24.2.7

Editorial: A much better solution would be not to modify parameters,
as that is quite unexpected behavior for EJBs. An even better solution
would be not to use stateful beans at all, and rely entirely on
stateless session beans and message-driven beans.

As an aside, you probably would have gotten a better response on
comp.lang.java. beans. This newsgroup (comp.lang.java ) is not an
"official" newsgroup, and thus does not reach many sites outside of
Google Groups. The worldwide Java newsgroups are:

comp.lang.java. 3d 3D Graphics API's for the Java language
comp.lang.java. advocacy Support for and criticism of the Java System
comp.lang.java. announce Announcements re the Java System (Moderated)
comp.lang.java. beans Java software components (JavaBeans)
comp.lang.java. corba Topics relating to Java and CORBA
comp.lang.java. databases Databases, java.sql, JDBC, ODBC
comp.lang.java. gui GUI toolkits and windowing: AWT, IFC etc
comp.lang.java. help Set-up problems, catch-all first aid
comp.lang.java. machine JVM, native methods, hardware
comp.lang.java. programmer Programming in the Java language
comp.lang.java. security Security issues raised by Java
comp.lang.java. softwaretools IDEs, browsers, compilers, other tools

* for the "Java doesn't pass by reference" crowd: I know that. But you
will note that the EJB Specification uses the term "pass by
reference", and doing so makes it more obvious what is being
discussed. The distinction between "passing objects by reference" and
"passing references by value" just isn't important to this particular
discussion, mm-kay?
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2138
by: Benny | last post by:
Hi i am using fop to generate dynamical pdf documents from a servlet, in weblogic 5.1. Fop works very fine but i need to generate barcodes in my documents so i am integrating it with krysalis barcode libraries. The integration works fine if i test it from a standalone application (pdf with barcode is printed), but there are problems using it from the weblogic servlet; the document is generated but the barcode is not and after many...
0
1696
by: Per-Christian Engdal | last post by:
Hi, I have built a cocoon.war file, and deployed it on my BEA Weblogic 8.1 Sp2 (Windows 2000) installation. The deployment works without exceptions, but when I try to access cocoon through http://localhost:80/cocoon I get the following error message (stack trace): java.lang.NoClassDefFoundError: org/apache/log/Logger at org.apache.avalon.framework.logger.LogKitLogger.isWarnEnabled(LogKitLogger.java:122)
4
2937
by: Accolo1 | last post by:
Help we are looking for this person, do you know them? William wjohnson@accolo.com Title: BEA WebLogic Portal Guru Job #: 03-04468 Check the pulse of your career! Evolve our eCommerce web portal centra nervous system with your advanced knowledge of BEA WebLogic portal an application servers, and J2EE. Using advanced open architectur
1
3427
by: WebServiceSecurity | last post by:
The issue involves the following technologies: - 1. .NET 2.0 Framework 2. WSE2.0 (WS-Security) 3. X.509 certificates 4. BEA Weblogic 8.1.5
0
3708
by: manauwaralam | last post by:
javax.naming.NameNotFoundException: While trying to lookup 'weblogic.jdbc.jts.vdmsPool' didn't find subcontext 'jdbc' Resolved weblogic; remaining name 'jdbc/jts/vdmsPool' at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:897) at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:225) at...
2
1465
by: QTR | last post by:
Hello, I discovered a strange XSLT behaviour on Weblo 8.1. Let me explain it (see at the end my example XSLT): I call a template (1) with one parameter (A) which calls another template (2) with two parameters. The first parameter is param A (obtained from template 1) and the second param comes from another template (3) which just returns the given param (C). The second template receives 2 params (A and C) and prints them out. Thus, in...
5
4435
by: swebster | last post by:
Can someone explain the differences between setting cookies on TomCat or a Weblogic webserver? I discovered today during a deployment to Weblogic that a cookie can be set and retrieved in a single session. But, once the browser session is restarted the "onload="getCookie()" returns an error. In Tomcat however, it works perfectly. When the cookie is manually distoyed prior to form load, no errors are returned. But, when attempting to...
1
1419
by: dynamic4mayank | last post by:
Hi, I have the setup as follows: weblogic server 7 service pack 2, sybase 12.5 database, and java 1.4.3 Can anyone tell me which other jar can be used instead of weblogic.jar to connect to weblogic server 7 service pack 2 which can also provide me some features of message handling. I would like to have similar functionalities like we get through SybMessageHandler interface in jconn2.jar and it can also communicate with weblogic server...
0
9714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9174
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.