charmy jain

Greenhorn
+ Follow
since Dec 17, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by charmy jain

how i set ejb client which is simple java class is call a ejb method from
jboss server into cronstab script shall ?

thanks
18 years ago
Is possible URL Validation into Struts FrameWork ?



thanks
18 years ago
hi,

which protocol used by ejb ?

thanks
hi rajesh,

thnaks for reply me


i got soluction..
hi
hi,

thanks for reply me..


i do same away as u say..

thnaks

i got soluction
hi,


i got a soluction of my problem , so soluction is :


package com;

import com.sun.rsasign.c;
import javax.naming.InitialContext;

/**
*
* @author Shivam1
*/
public class testbean {

/** Creates a new instance of testbean */
public testbean() {

try{

com.exampleRemote updateAvailableBudgetRemote = lookupexampleBean() ;

System.out.println(updateAvailableBudgetRemote.getInfo());

}catch(Exception ex){
System.out.println(ex);
}
}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
testbean t1 = new testbean();
}

private com.exampleRemote lookupexampleBean() {
try {

InitialContext ctx = new InitialContext();
ctx.addToEnvironment("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
ctx.addToEnvironment("java.naming.factory.url.pkgs", "org.jboss.naming rg.jnp.interfaces");
ctx.addToEnvironment("java.naming.provider.url","localhost");

Object remote = ctx.lookup("test/Tester");
com.exampleRemoteHome rv = (com.exampleRemoteHome) javax.rmi.PortableRemoteObject.narrow(remote, com.exampleRemoteHome.class);
return rv.create();
}
catch(javax.naming.NamingException ne) {
java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
throw new RuntimeException(ne);
}
catch(javax.ejb.CreateException ce) {
java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ce);
throw new RuntimeException(ce);
}
catch(java.rmi.RemoteException re) {
java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,re);
throw new RuntimeException(re);
}
}


}


and plz define , "test/Tester" is jndi name into jboss.xml file at ejb module..


hahaha
u got a result


try to change a name but it is not work and again i will try then it is work now... ok

thnaks for inform me...

and plz, help for solved a prob because it is also not wark
i prepare stateless session bean into netbeans id and compile it and i used a jboss server and now i want to call that it's ejb methods from simple java class meanse void main method so what i do??

plz, reply me
thnaks
hi
i try to change a name but it is not work and again i will try then it is work now... ok

thnaks for inform me...

and plz, help for solved a prob because it is also not wark
i prepare stateless session bean into netbeans id and compile it and i used a jboss server and now i want to call that it's ejb methods from simple java class meanse void main method so what i do??

plz, reply me
thnaks
hi,

i try it and it is not work.
hi,

Bean Code :

i create a stateless session bean and in that include 2 method of String getInfo() and setInfo(String info) and process is same like create a bean int netbeans5.0 beta version.

and we user netbean 5.0 beta and jboss server

and my client code is

package cartclient;

import cart.CartRemote;
import cart.CartRemoteHome;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

public class Main {


public static void main(String[] args) {

try{

Context con = new InitialContext();
Object objRef = con.lookup("ejb/CartBean");
CartRemoteHome home = (CartRemoteHome)PortableRemoteObject.narrow(objRef,CartRemoteHome.class);

CartRemote cartremote = home.create();

cartremote.setInfo("Hello call a ejb method ") ;
System.out.println("The Message From Bean " + cartremote.getInfo());




}catch(Exception ex){
System.out.println("The Error : " + ex);
}

}

}


but i have error is

The Error : javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial


plz, help me to find a error and solve that propb.



thanks

hi,


if one ejb call another ejb method and both ejb save into same pacakage and same jvm and same machine then

is it requere a to use a lookup method when one ejb call a method of another ejb methods ?

when required a look().... ?


please, reply me.

thanks
[ April 01, 2006: Message edited by: Ernest Friedman-Hill ]
hi ,


i used a staterless session bean and in that bean include a 2 methods..
1) is get all records from database
2) update that all records to database
now , i want to call that both method from simple javaclass means that class is include a public static void method() ...

i decided to create a simple java class for execute a bean method because
i want to execute that method daliy eventing time so i put that java class into linux server where cronjob... facilty is available and it is excute that java class and update those records....

my question is :
1) is it possible to put a java class int cronJobs into linux server and also call a ejb methods..
2)how call a stateless session bean methods from simple javaclass....... ? is it possible?
3) whoe is really become a ejb clint.... like servlets, jsp............

pls, reply me...

thanks,
no,

my prob is how it is used into j2ee project for real implementation.
how to decided architecture of the project so we used all the tech. very efficient away ?
18 years ago
how to used struts,ejb(session bean),hibernate into j2ee project ?


pls, give me idea ?

thanks.
18 years ago
hi,

i have 1.6 exp. into j2ee and i had done mca from 2004.
i need good job as j2ee programmer.

pls,send me reply

thanks.
18 years ago