EJB / EE :: How To Use Remote Interface JNDI Lookup Object

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


ADVERTISEMENT

Enterprise JavaBeans :: Weblogic JNDI Lookup Fails Via Spring

Feb 24, 2014

There is a weblogic server running at remote place and i need to access the API's in that remote method using JNDI lookup. My application is configured in Spring Tool Suite IDE with java 6 and tomcat 7 and I have used Spring to perform the jndi lookup of weblogic server. In spring i have used simpleremotestatelesssessionproxyfactorybean class to lookup a weblogic server using jndi and get the remote object. But somehow on doing it i'm getting the following error.
 
org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 203 completed: Maybe
       at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
       at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
       at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.sendWithoutLock(Unknown Source)
       at com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendFragment(Unknown Source)

[Code] ....

The exception is been thrown at com.sun.corba.se.impl.encoding.CDROutputObject method when calling writeTo(). Why I'm getting this error and can I do anything to remediate it. Irrespective of java this error occurs, i tried with java 5, 6 and 7 but still getting the same error.

View Replies View Related

Interface As Object?

Aug 6, 2014

I'm having trouble understanding the concept of the interface Connection, and PreparedStatement.

1) The simplest way to put it is how is it possible that this code is creating Connection and PreparedStatement objects? I was always under the impression that interfaces cannot be instantiated, but rather implemented. For example I don't see "public class Prepared implements Connection", or "public class Prepared implements PreparedStatement", But I see "Connection con = null;" and "PreparedStatement pst = null;". So it seems as if the interfaces are being used to create objects called con and pst.

2) If in fact these interfaces are being implemented, where are the method blocks in this code that should have been added in order to fulfill the contract?

package zetcode;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

[code]....

View Replies View Related

Cannot Return Object Of Iterator As Its An Interface

Mar 3, 2014

What does the iterator() method return???it can't return an object of Iterator as it's an interface...

View Replies View Related

Test To See If Object Is Instance Of Interface Class

Mar 7, 2015

I am currently trying to use Junit to test a whole bunch of stuff. I almost have full line coverage but I am getting hung up on testing an if statement that consists of whether or not an object is an instance of another class. This class happens to be an interface, and even the object is an interface. Weird I know but I just want to know how to get into that if statement. I realize testing interfaces might be a waste of time but I still really want to know how. Here is an example of what I am trying to test:

Java Code:

if(x instance of y){ //where x and y are both interface objects
doSomething();
} mh_sh_highlight_all('java');

View Replies View Related

Why Interface Inherit All Non Final Methods From Object Class

Jan 8, 2014

why interfaces inherit prototype of all the non final methods of the object class in itself? Object class is parent class of all the class and Interface is not the class.

View Replies View Related

NotSerializableException With Basic DataSource In JNDI

May 29, 2014

I am setting up a standalone JNDI and loading a Datasource to the JNDI. DataSource I use is:

org.apache.commons.dbcp.BasicDataSource

The JNDI is set up as follows
 
String detectorHost = InetAddress.getLocalHost().getHostName(); 
System.out.println("detectorHost: " + detectorHost); 
System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); 
final NamingBeanImpl namingInfo = new NamingBeanImpl();  namingInfo.start(); 

[Code] ....

I get the following exception

javax.naming.CommunicationException [Root exception is java.io.NotSerializableException: org.apache.commons.dbcp.BasicDataSource]  at org.jnp.interfaces.NamingContext.bind(NamingContext.java:677)  at org.jnp.interfaces.NamingContext.bind(NamingContext.java:611)  at javax.naming.InitialContext.bind(Unknown Source)  at com.lombardrisk.reform.integration.ReformIntegration.createJNDIServer(ReformIntegration.java:93) 

[Code] ....

I don't quite follow why I am getting a NotSerializableException exception, this is a local JNDI in the same JVM and not a remote JNDI. Not sure why this occurs.

View Replies View Related

EJB / EE :: Cannot Access Simple Bean Using JBOSS-JNDI

Nov 26, 2014

I'm not able to access my bean class (not an EJB) using a given JNDI name in JBoss 5.0.1, where the same is working in Tommcat 7.0.

META-INF/context.xml
<Context>
<Resource name="test/TestDAO" auth="Container"
type="ws.jndi.MyBeanDAO"
factory="org.apache.naming.factory.BeanFactory"/>

[code]....

View Replies View Related

RMI :: Control RMI Lookup Timeout

Jul 24, 2014

I'd like to ask is there way to control the RMI lookup timeout through programming or network configurations.
 
In a testing environment, I have purposely disconnect or plug out the cable between two testing servers to check the reliability.

It took very long time for the RMI API to throw out java.rmi.ConnectException which used Naming.lookup(givenURL).

I have tried to set system properties like sun.rmi.transport.tcp.handshakeTimeout, but it didn't take effect at all.

View Replies View Related

EJB / EE :: Inject DataSource Based On Runtime JNDI Name Variable

Sep 10, 2014

I need to inject a DataSource, but the catch is the JNDI isn't known until Runtime. I was hoping the EJB could get a System Property of the JNDI name and use that to Inject the DataSource.

For example:

@Resource(name=myRuntimeJNDIName)
DataSource myDataSource;

And I could either @Inject or on postContstruct() set the myRuntimeJNDI variable to the JNDI name that is configured on the App Server via System Properties or some other mechanism. But the JNDI may be different depending on what environment the application is deployed to.

Is this possible? I would like to have the same EAR deployed in all our environments and not have to create a different version of the application for each environment.

View Replies View Related

Declaring Object Using Interface Implemented By Its Class Vs Declaring Object Using Class

Apr 8, 2014

Suppose you have a generic Dog class of the pet type that implements a DogInterface of the pet type. What is the difference between;

DogInterface<pet> Rex = new Dog<pet>();

and

Dog<pet> Tye = new Dog<pet>();

In what situations might you want to use Rex instead of Tye?

View Replies View Related

JavaFX 2.0 :: Color-lookup Not Resolved In SceneBuilder

Jun 17, 2014

I use SceneBuilder2.0 with JavaFX8 on OSX 10.9.4
 
When i use a stylesheet in SceneBuilder2.0 which uses a color-lookup the lookup fails with:

WARNING: Could not resolve 'abc' while resolving lookups for '-fx-background-color' from rule '*.button' in stylesheet supersimple.css
 
The color-definition is in the root-rule, so it should be found.
 
The lookup does work fine at Runtime.
 
There is a more complete description of the problem on stackoverflow:

javafx - SceneBuilder2.0 does apply rules with color-lookup - Stack Overflow

View Replies View Related

JavaFX 2.0 :: How To Correctly Lookup RadioMenuItem Node

Mar 2, 2015

When I lookup a RadioMenuItem, I can not cast it to a RadioMenuItem. With other nodes like normal RadioButtons etc. this works.
 
This works:

Node x = (Node) B2_GridMenuButtonFX.lookup("#id);
 
This does not work:

Node x = (Node) B2_GridMenuButtonFX.lookup("#id);

Instead I see the warning: "incompatible types: Node cannot be converted to RadioMenuItem".

View Replies View Related

JSF :: Calling Google Reverse Geocoding Address Lookup

Sep 25, 2014

I'm trying to integrate google reverse geocoding address into my jsf application. I would like to be able to enter a postcode and hit a 'Find Address' button to bring me back all the addresses within that location. I have attempted the script below just to get something working in html then build a jsf2 page up. The results that I keep getting back are for a specific building rather than a list of houses within the same street. I think this is because I'm using the lat/long.

<!DOCTYPE html>
<html>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<body>
<div id="latlng" value="53.561922,-2.120010"></div>

[Code] ......

View Replies View Related

Ball Object Which Implements Runnable Interface And Traces Various Positions Of A Ball

Feb 11, 2014

a) I have a Ball Object which implements the Runnable interface and traces the various positions of a ball.

b) I then have a Ball_Bounce JPanel inside a JFrame which creates two instances of the Ball object and then paints them to the JPanel.

As per my understanding, when the main() program in Ball_Bounce.java is started, there a total of three threads running in this program, one for each ball and one for the main(). What I cannot understand is whenever the balls collide, I end up getting the "Collision" message twice even though the collision is checked only in the main() thread.

[#]public class Ball implements Runnable
{
private boolean xUp, yUp, xUp1, yUp1;
private int x, y, xDx, yDy;
private final int MAX_X = 500, MAX_Y = 500;
private boolean flag = true;
private static Thread ball;
 
[code]...

View Replies View Related

Interface Class And Object Class Is Compiling Symbol Errors

Nov 16, 2014

I am a beginner here at JAVA and I am trying to program a Gratuity Calculator using both interface class and object class but it keeps on compiling with errors saying "cannot find symbol".I tried everything to fix it but it just keeps on stating symbol.

[CODE]
public class GratuityCalculator extends JFrame
{
/* declarations */
 
// color objects
Color black = new Color(0, 0, 0);
Color white = new Color(255, 255, 255);
Color light_gray = new Color(192, 192, 192);
 
[code]....

View Replies View Related

Remote File Transfer

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

Servlets :: Get Remote Username In Java

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

Communicating With Remote Computers Using Socket

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

JSF :: Copying File From Server To Remote Machine

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

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 View Related

How To Connect To A Remote SQL Server Using JDBC Driver

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

How To Access / Connect Remote Unix Server

Dec 14, 2014

a direct solution for connecting a remote Unix server through telnet connection from java application.

View Replies View Related

JRE :: Storing Images To Remote System Connected Through LAN

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

Copy Folder From Local To Remote With JSch And Opposite

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

Error While Making Connection With Remote Oracle Database

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







Copyrights 2005-15 www.BigResource.com, All rights reserved