EJB / EE :: Pass By Reference Not Working Between Remote Calls
Mar 11, 2014
i'm having issues with pass by reference between remote EJB method calls. Below is what i'm trying to do. The EJB method calls are made using remote (EJBObject) interface.
insertEmployeeRecord(Employee employee) {
employeeEJB.insertEmployee(employee);
empDetailsEJB.insertEmpDetails(employee);
}
insertEmployee(Employee employee)
[Code] ....
All the EJBs have below configuration in the weblogic-ejb-jar.xml file.
<enable-call-by-reference>true</enable-call-by-reference>
I'm using Weblogic server 10.3.0.4 and JDK160_21.
View Replies
ADVERTISEMENT
Oct 23, 2013
I have an stand alone client to use a remote ejb with some methods. All works fine, but when I pass an entity class as parameter from the stand alone client to the remote ejb, the entity class is received as null.
View Replies
View Related
Aug 25, 2014
I'm fairly new to Java, I'm very experienced with C++ and C# in which you can pass by reference - extremely useful. Take for example this bit of code in C#:
class MyClass
{
public MyClass(int i)
{
m_i = i;
}
public int m_i;
[Code] ...
Just at the end of this program x.m_i will be equal to 8. As far as I can see this is not possible in Java: you can't pass a double by reference, using a Double will kick in the autoboxing so that won't work either. The only "solution" in Java would be to pass in a double[] (of length 1) or to make a wrapper class, both nasty solutions because a user may want to just hold a double as a member of their class just as I have, for reasons such as not allocating more memory for a class and generally not being bloated.
View Replies
View Related
Aug 27, 2014
if there is a possibility to use the pass by reference technique in java like in C++.URL....
View Replies
View Related
May 5, 2015
***** start code ***
public class AddArray {
public static void main(String[] args) {
int sum = 0;
sum = addArray(myarray);
System.out.println(" hello");
System.out.println("This program will create an array then pass the array to an method to be totaled");
int myarray[] = new int [6];
[Code] ....
View Replies
View Related
Dec 27, 2014
I want to write a java program which would do remote file transfer without using Byte array..how I can get sample code program??
View Replies
View Related
Sep 22, 2014
I have a servlet. Users from other machines access that servlet and I want to capture the remote user's UserName and do validation over that.It's just a simple servlet and no login/password is present. I tried request.getRemoteUser(), but its of no luck.
View Replies
View Related
Dec 7, 2014
I have an android device which i want to be able to switch off remotely from a console hosted on the amazon cloud.The console is a simple html button that on click sends a command to a listening server on an android device that i know its ip address.
My question,is this even possible given the huge security bleach this would present to rogue apps to be able to order actions on remote devices not started by the device owner?.
The way i know the ip is via once internet is connected on an android deice,i shall then make it announce its ip that it has been assigned by the service provider,then starting a server to accept external connections.
My theory could be wrong if what i want is not permitted.
View Replies
View Related
Jun 5, 2014
How the recursion works. I tried to figure out writing down low, mid, high at each recursive call. But I seem to be making a mistake somehow. I don't understand where the values are returned to in
if(leftmax>rightmax){
return leftmax;}
else
return rightmax;
Here's the code:
public class Maximum{
public static int max(int[] a,int low,int high){
int mid,leftmax,rightmax;
if(low==high)
return a[low];
[Code] ....
firstly leftmax=max(a,0,4)
Then what is the next line executed?Is it rightmax=max(a,5,8).
After this is it leftmax=max(a,5,6)
rightmax=max(a,7,8)
I tried to understand what these recursion calls by writing them down.But I somehow make a mistake.
View Replies
View Related
Apr 1, 2015
Consider the two simple Java classes below:
class Computer {
Computer() {
System.out.println("Constructor of Computer class.");
}
void On() {
System.out.println("PC turning on...");
[Code]...
After the program run, how do I trace (1) which object call which method (2) and how many times?
View Replies
View Related
Jun 25, 2014
If i have 2 classes, Top and ClassB which extends Top
public class Top {
String variable;
public Top(){
setVariable();
}
void setVariable(){
variable = "variable is initialized in Main Class";
[code]....
So what is happening when ClassB inherits from Top?I know that the B constructor is calling super, so does that mean its calling setVariable (in Top?) but as its overridden in ClassB, then that is whats being called and setting the String variable?
View Replies
View Related
Mar 31, 2015
Consider the two simple Java classes below:
class Computer {
Computer() {
System.out.println("Constructor of Computer class.");
}
[Code]...
After the program run, how do I trace (1) which object call which method (2) and how many times?
View Replies
View Related
May 21, 2014
I am developing a web application in java(JSF 2.0 - Prime Faces). I need to do below operation. My appllication is running on WLS server. WLS is deployed on a server(say Machine-X). In my application i have a requirement , where i have to copy file from Machine-X to another Machine-Y. The Machine-Y is access restricted.
When i tried to copy the file from my app, getting no access exception. I have full control over Machine-Y. We cannot use SFTP as SFTP cannot be installed on target machine(Machine-Y). Robocopy is failing for some use cases. Is there any other way we can copy/write file from one server to other by providing userid/password in java
View Replies
View Related
Jan 15, 2015
I'm working on an application I made a few years ago. At that time I connected to a local database so my address was 'jdbc:mysql://localhost:3306/'. That database is long gone so I recreated it on one of my hosted servers but I'm a little unsure of how to connect to it. At the moment I'm trying "jdbc:mysql://www.mydomain.com:3306/" but it is giving me an access denied error.
java.sql.SQLException: Access denied for user 'myusername'@'c-[my-ip].hsd1.pa.comcast.net' (using password: YES)Every result on Google seems to use localhost so I'm having a little difficulty figuring out the correct format.
View Replies
View Related
Aug 5, 2014
jboss 7.1.1
EJB 2.1
Though it may seem strange but in one of the application i work on still uses EJB 2.1 entity beans.While looking at the deployment log, seems like each Entity bean is registered using both remote-home and remote interfaces.
java:app/EJBApp/Entity!com.abc.remote.Remote
java:app/EJBApp/Entity!com.abc.remote.RemoteHome
Using the remote-home's JNDI lookup i was able to get the EJBObject proxy and subsequently create and use the entity.But what about the remote interface JNDI lookup ? Reason i am asking is that one needs to create an entity before use it. That said, how to use the object that i get from remote interface JNDI lookup ? Note that the class of the returned object says its "com.sun.proxy.$Proxy13" type.The JNDI location i am using "java:app/EJBApp/Entity!com.abc.remote.Remote"
View Replies
View Related
Dec 14, 2014
a direct solution for connecting a remote Unix server through telnet connection from java application.
View Replies
View Related
Dec 16, 2013
How to store the images captured from a system using web cam(from where the web application accessed) to a folder of system(where the web application is deployed) connected through lan......?
I have used applets to connect to web cam.
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Graphics;
[Code] ....
Through this applet I am capturing the image and saving in the application deployed directory and accessing this image through a servlet. Every thing works fine in my system but when i try to capture from other systems connected through lan the image not saving in my system.
View Replies
View Related
Oct 4, 2014
I use jboss eap 6.2 under eclipse.I perform a tutorial on EJB and I want to show the difference between a stateless session bean and a statefull session bean. I want demonstrate that the first one keep its state (if it has one) but that 2 successive don't send back necessarily the same SLSB : it send back the SLSB that is ready in the pool. But I don't suceed in obtaining 2 different SLSB by 2 successive call. The system always send me back the same SLSB.
View Replies
View Related
Jul 3, 2014
I am trying to calculate a fine in a PoliceOfficer object with method calls to a ParkedCar and ParkingMeter object. The word problem is:
The fine is $25 for the first hour or part of it and $20 for every additional hour of part of it.
My code is:
public class PoliceOfficer
public static final int PARKING_FINE1 = 25;
public static final int PARKING_FINE2 = 20;
public static final int NUMBER_OF_MINUTES_OVER_PARKED = 60;
public double calculateFine(){
double calculateFine = 0;
[Code] ....
obviously the fine is not calculated correctly but I'm not sure how to proceed from here...
View Replies
View Related
Apr 21, 2015
Im trying to HTML/JavaScript ecode the getmessage calls in the code listed below. The code below is a snippit from a program which is used to handle a failed authentication attempt.
if(logger.isDebugEnabled())
logger.debug("Authentication Failure: " + exception.getMessage());
response.sendError(HttpServletResponse.SC_FORBIDDEN, "Authentication Failed: " + exception.getMessage());
View Replies
View Related
Jun 10, 2014
I would like to ask how i can create a bidirectional folder copy system with SFTP JSch is there any example. Like i see the code can only transfer file, I need to transfer a folder with many files from my pc to a server and the opposite.
View Replies
View Related
May 21, 2014
I am trying to make connection with oracle database but when i run java file it's raise an error
"classnotfoundexception oracle.jdbc.driver.oracledriver"
DriverManager.getConnection(
"jdbc:oracle:thin:@erp:1521:ORCL", "apps",
"apps");
View Replies
View Related
Mar 3, 2015
From java running on Windows, I need to access a file on a remote Ubuntu machine. I use the following:
URL U = new URL ( "http://" + SERVER_IP + ":" + SERVER_PORT + "/" + ClsName + ".class" );
where:
SERVER_IP is the Ubuntu IP address obtained from any site that shows the IP address of the machine you are using.SERVER_PORT is the Ubuntu port where the server is listening.
Now:
Do I need to modify this code any further?Do I need to configure the Windows and/or Ubuntu machine(s) for this to work?
View Replies
View Related
Mar 24, 2014
I don't remember where but I faintly recall one of the oracle docs examples (dealing with GUI basics I think) having something similar to
button.add(lbl).addIcon().addActionListener(al);
but only in the aspect of using .method.method.method
The reason I'm asking is because I want to shorten this
int j = 0;
for(int i = 0; i <= 6; i+=3){
pnl[j+2].add(lbl[i+5]);
pnl[j+2].add(lbl[i+6]);
pnl[j+2].add(drop[j]);
pnl[j+2].add(lbl[i+7]);
pnl[j+2].add(btn[j]);
j++;
}
Into something like this
int j = 0;
for(int i = 0; i <= 6; i+=3){
pnl[j+2].add(lbl[i+5])
.add(lbl[i+6])
.add(drop[j])
.add(lbl[i+7])
.add(btn[j]);
j++;
}
I might be way off though... but I'm just wondering under what circumstances would this be possible
When I try it in Eclipse a little notification appears that says...
"The method add(PopupMenu) in the type Component is not applicable for the arguments (JLabel)"
When I google 'Component' I see it appears to have something to do with Serialization (which I'll need to look into)
View Replies
View Related
Feb 4, 2014
I am working with a program where I am required to use a JFrame in a child class. The only way that I know how to access a JFrame is to do, example (public class Example extends JFrame), but since it is already extending the parent class, I am kind of stuck. I do not think that you can extend two separate classes, so..... I am stuck.
View Replies
View Related
Jun 25, 2014
I think its a standard concept but just not getting it. I have 3 classes:
1) Base class
2) Derived class, which extends base
3) TestClass
public class Base {
public void display() {
System.out.println("Display method in Base");
}
}
class Derived extends Base {
public void display() {
System.out.println("display method in Derived");
[Code] .....
So if i run this, my results are:
Display method in Base
display method in Derived
display method in Derived
Thats cool, no problems there, but if i change my Display method in Base and Derived to static methods then the results become:
Display method in Base
display method in Derived
Display method in Base
So why oh why does obj3.display() now print "Display method in Base"?
(and yes I know the calls should be static calls, but for sake of arguments -- or is that the whole problem, that technically obj3.display() is an incorrect call as it can only be Base.display() or Derived.display() when display() is a static method ).
View Replies
View Related