Home Tutorialhelp Comment hi frnd i try to do a simple session bean to ad

 
 

Comment

Renjith.v.r
hi frnd i try to do a simple session bean to ad,
April 18, 2007 at 2:19 PM

hi frnd
i try to do a simple session bean to add two numbers...my client pgm is a simple java pgm...jboss 3.2.6......i got a exception ......
plse give a solution.......
This is my Exception....
-------------------------------------------------
Exception in getting home interfacejavax.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

at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at myClient.main(myClient.java:17)
-------------------------------------------------
This is my client pgm....
-------------------------------------------------
import java.util.*;
import javax.rmi.*;
import javax.naming.*;



public class AddClient
{
public static void main(String arg[])
{
try
{


Context ctx=new InitialContext();
Object ref=ctx.lookup("Add");
AddHome home=(AddHome)PortableRemoteObject.narrow(ref,AddHome.class);
Add ejb=home.create(10,20);
int result=ejb.add();
System.out.println("Result is:"+result);
ejb.setNumber1(10);
ejb.setNumber2(12);
System.out.println("Result is:"+ejb.add());
} catch(javax.naming.NamingException ne)

{
System.out.println("Exception in getting home interface");
ne.printStackTrace();
}

catch(java.rmi.RemoteException re)
{
System.out.println("Remote Exception");
re.printStackTrace();
}
catch(javax.ejb.CreateException ce)
{
System.out.println("Exception while creating the bean instance");
ce.printStackTrace();
} catch(Exception e)
{
System.out.println("Other Exceptions");
e.printStackTrace();
}
}
}


View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
EJB Questions

Error in simple session bean ..................
Error in simple session bean ..................  Hi friends, i am trying a simple HelloWOrld EJb on Websphere Applicatiopn server 6.1. Can any one plz help me to solve this issue. here is the client code which i have 

General

developing a Session Bean and a Servlet and deploy the web application on JBoss 3.0
I will show you how to develop a Stateless Session Bean and a Servlet... Session bean. Stateless session bean do not preserve the information between... Writing Stateless Session Bean and Calling through Servlet 

General

Stateless Session Bean Example
Stateless Session Bean Example   ... stateless session bean. The purpose of example is to performs the mathematical... bean: The enterprise bean in our example is a stateless session bean called 

General

developing a Session Bean and a Servlet and deploy the web application on JBoss 3.0
a Calculator Stateless Session Bean and call it through JSP file  and deploy... the MyTestSession Session Bean developed in Lesson 3. Infact we will use the same... create our Calculator Session Bean write the deployment descriptor. Writing 

EJB Questions

Rose India Stateless Session Bean Example Question
Rose India Stateless Session Bean Example Question  Hi Team... .xml file it is shown that it can be run by using JBoss and Apache Ant. If I want to use NetBeans and Glass Fish to run this code, what should I do 

EJB Questions

EJB Deployment how to create a simple ejd session bean and how to do project setup
EJB Deployment how to create a simple ejd session bean and how to do project..., jdk 1.6 installed in my system. how to create a simple ejd session bean and how to do project setup...? please help me i am getting difficult 

Java Beginners

stateless session bean with methods error - Java Beginners
stateless session bean with methods error  I have to create stateless session bean with 3 methods and then create a servlet which remotely calls all three methods in that session bean. I have 4 files created-index.jsp under web 

EJB Questions

Session Bean Example
Session Bean Example  I want to know that how to run ejb module by jboss 4.2.1 GA (session bean example by jboss configuration )?   Please visit the following link: http://www.roseindia.net/javabeans 

EJB Tools

Stateful Session Bean Example
Stateful Session Bean Example   ... using stateful session bean. The purpose of account is to performs two... bean: The enterprise bean in our example is a statelful session bean called 

Development process Questions

jboss with local entity bean - Development process
jboss with local entity bean  We are using eclipse version 3.4.0 for EJB 2.0 application development ( which has ready plug-in for jboss server 4.2.1GA) and jboss server 4.2.1GA for the deployment. and Jboss is configured 

Flex Questions

Problem in Blazeds with Jboss Clustering ( Mod_JK with SSL )
in the server, I need to use the JBoss cluster for session replication. I heard that flex.... I checked with simple application without any session data also then too I...Problem in Blazeds with Jboss Clustering ( Mod_JK with SSL )  Hi 

General

An Entity Bean Example
, such as relational database an entity bean persists across multiple session and can... Implement the Annotated Session Bean: BookCatalogBean... the database. We use EJB3 session bean POJOs to implement the business logic 

Development process Questions

hi
hi   i want to develop a online bit by bit examination process as part of my project in this i am stuck at how to store multiple choice questions options and correct option for the question.this is the first project i am doing 

JSP Servlet Questions

hi..
hi..   I want upload the image using jsp. When i browse the file then pass that file to another jsp it was going on perfect. But when i read...); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..   I want upload the image using jsp. When i browse the file then pass that file to another jsp it was going on perfect. But when i read...); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..   I want upload the image using jsp. When i browse the file then pass that file to another jsp it was going on perfect. But when i read...); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..   I want upload the image using jsp. When i browse the file then pass that file to another jsp it was going on perfect. But when i read...); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..   I want upload the image using jsp. When i browse the file then pass that file to another jsp it was going on perfect. But when i read...); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..   I want upload the image using jsp. When i browse the file then pass that file to another jsp it was going on perfect. But when i read...); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..   I want upload the image using jsp. When i browse the file then pass that file to another jsp it was going on perfect. But when i read...); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional...=browsefile.split("/"); System.out.println("ARR is="+arr); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional...=browsefile.split("/"); System.out.println("ARR is="+arr); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional...=browsefile.split("/"); System.out.println("ARR is="+arr); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional...=browsefile.split("/"); System.out.println("ARR is="+arr); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional...=browsefile.split("/"); System.out.println("ARR is="+arr); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JSP Servlet Questions

hi..
hi..  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional...=browsefile.split("/"); System.out.println("ARR is="+arr); for(int i=0;i<arr.length-1;i++) { newstr=newstr 

JDBC Questions

HI!!!!!!!!!!!!!!!!!!!!!
;Hi Friend, Try this: import java.awt.*; import java.sql.*; import javax.swing....HI!!!!!!!!!!!!!!!!!!!!!  import java.awt.*; import java.sql....(); String t8=text8.getText(); try{ Class.forName 

Java Beginners

hi.......
hi.......  import java.awt.; import java.sql.*; import javax.swing....) { try{ Class.forName("com.mysql.jdbc.Driver"); Connection con... from bank where branch='kannur'"); Statement st=con.createStatement(); int i 

EJB Questions

Steps to create simple EJb 2.1 (Session Bean) and deploy on websphere application server 6.0,
Steps to create simple EJb 2.1 (Session Bean) and deploy on websphere application server 6.0,  Hi friends, I am trying to create simple hello world session bean having Java client. but i am unable to run it on Websphere 

EJB Questions

Issue in Stateless session bean example
Issue in Stateless session bean example  Hi Team, I tried your Stateless session bean example in the path http://www.roseindia.net/ejb/examples-of-StatelessBean.shtml. I got the below exception can you plese guide to rectify 

Software Services

Ad Copy,Ad Copy Services,Effective Copy for Ads,Ad Copy Outsourcing India
Ad Copy Writing effective copy for ads, web pages, sales letters and other... years of trial and error I developed a checklist of 7 "rules" I follow to create... begin writing. Do you want to generate inquiries (leads)? Do you want to get 

General

Writing Calculator Stateless Session Bean
Writing Calculator Stateless Session Bean... javax.ejb.EJBObject. Remote interface is the client view of session bean. Methods defined... for our Calculator Session Bean:   /* *  

EJB Questions

Stateless Session Bean Example Error
Stateless Session Bean Example Error  Dear sir, I'm getting following error while running StatelessSessionBean example on Jboss. Please help me...)   Please visit the following link: Stateless Session Bean Example 

Programming Tutorials

Session Bean
is a Session bean   A session bean is the enterprise bean that directly.... A session bean represents a single client accessing the enterprise application.... A session bean makes an interactive session only for a single client and shields 

Hibernate Questions

hi i m new to hibernate..plzzzzzzzzzzzzzz help me.... - Hibernate
hi i m new to hibernate..plzzzzzzzzzzzzzz help me....  hi friends i m new to hibernate..& i m stuck in one positon in my pgm.. its a simple select... SelectExample { public void getdata() { Session session = null; try 

General

A Message-Driven Bean Example
. A message-driven bean has only a bean class i.e. unlike a session bean... of a simple message-driven bean application. In this example, we are going to implement... in the JNDI namespace from within the bean class so that we do not need 

Java Beginners

Use if, if else,for,while,do wile ad switch in same Java Class
Use if, if else,for,while,do wile ad switch in same Java Class  hi how to use if, if else,for,while,do wile ad switch in same class? very urgent... "); System.out.println("5. Exit"); boolean quit = false; do{ System.out.print("Please 

JSP Servlet Questions

JBoss and Sevlet - JSP-Servlet
JBoss and Sevlet  I am trying to get familar with JBoss. I package up... IsItWorking /gg/servlets I have JBoss installed and put my gg.war into G... do or change to get this servlet to run on JBoss 4.2.3. Thank you!   

Struts Questions

Struts - Jboss - I-Report - Struts
Struts - Jboss - I-Report  Hi i am a beginner in Java programming and in my application i wanted to generate a report (based on database) using Struts, Jboss , I Report 

JBoss Server

JBoss Tutorials: Learn JBoss Step by Step
Writing Session Bean and Deploying on the Jboss 3.0 Server Writing Calculator Session Bean Jboss 3.2 Tutorial... with simple examples. Our JBoss tutorials for beginners have been designed 

Application Servers

Jboss 3.2 EJB Examples
be required by different customers Part 1 Stateless session bean jboss 3.2.... a) Stateless Session Bean: For the sake of clarity and continuity, I am using the same... that it will be useful , if I could create very simple and clear examples for all the various 

General

Writing Deployment Descriptor of Stateless Session Bean
Writing Deployment Descriptor of Stateless Session Bean... for the session bean. We need the deployment descriptor for application... session bean is TestSessionBean, we will call this bean from servlet 

Struts Questions

Hi
Hi  Hi All, I am new to roseindia. I want to learn struts. I do not know anything in struts. What exactly is struts and where do we use it. Please help me. Thanks in advance. Regards, Deepak 

Java Interview Questions

Bean
Bean  i have this problem when i registry after that check the valid value whit useBean classes org.apache.jasper.JasperException: /proces1.jsp... visit the following links: http://www.roseindia.net/jsp/simple-jsp-example 

JSP Servlet Questions

hi
hi   on clicking on button on 1st jsp page i want to display following options like friends,family,doctor etc.on next jsp page and also i want link... databases like the above i.e friends,family,etc pls can any one tell how can i do 

JSP Servlet Questions

hi
hi   on clicking on button on 1st jsp page i want to display following options like friends,family,doctor etc.on next jsp page and also i want link... databases like the above i.e friends,family,etc pls can any one tell how can i do 

Java Beginners

hi
* * * * * * * * * *print("code sample");   Hi Friend, Try... num=4; int p = num; int q = 0; for (int i = 0; i <= num; i++) { for (int j = p; j>= 1; j-- ) System.out.print(" "); p-=1; for (int k = 1; k <= i; k 

Java Beginners

hi!
hi!  how can i write aprogram in java by using scanner when asking... to to enter, like(int,double,float,String,....) thanx for answering....   Hi, Try this: import java.util.*; class ScannerExample { public static void 

Java Beginners

Nested try
Nested try  Hi, In eclipse without providing input i am getting... versa.pl explain me class Demo { static void nestedTry(String args[]) { try... static void main(String args[]) { try { nestedTry(args); } catch 

Java Beginners

hi.......
hi.......  i've a project on railway reservation... i need to connect netbeans and mysql with the help of jdbc driver... then i need to design... for such a programme... plz help me...   Hi Friend, Try this: import java.awt. 

Development process Questions

hi
storing data in xml file using jsp  hi i am storing data in xml file using jsp.in this when i enter data into xml file i am getting xml declaration...; try { System.out.println(name); DocumentBuilderFactory 

Programming Tutorials

Chapter 2. Client View of a Session Bean
or examples about the client view of a session bean's local and remote home interfaces, including the code used by a client to locate a session bean's... for the Cart session bean can be located using the following code segment 

General

Welcome to the Jboss 3.0 Tutorial
Session Bean and Deploying on the Jboss 3.0 Server In this lesson I will show you how to create a Session Bean and called... In this lesson I will show you how to write Calculator Session Bean and called 

EJB Questions

Simple EJB3.0 - EJB
Simple EJB3.0  Hi friends... I am new user...;>> my question is how to make session bean and how to access this session bean on servlet/jsp. thanQ  Hi Friend, Please visit 

JSP Servlet Questions

continue of doubts in place ad - JSP-Servlet
on save everyting selected on place ad page should get saved in database .and when clicked on submit everything should get displayed on next page. and i want... Title Image and on right side other fields then how to do this . Please do 

Java Beginners

Session Timeout
Session Timeout  Hi, we are using JBoss 4.0.2 I have edited the jboss-4.0.2/server/default/deploy/jbossweb-tomcat55.sar/conf/web.xml I.... But, the session timeout is not happening for 120 mins 

Hibernate Questions

I need hibernate session factory example.
I need hibernate session factory example.  Hi, I want a simple hibernate session factory example..   hello, Here is a simple Hibernate SessionFactory Example Also go through the Hibernate 4 Thanks 

Java Beginners

JBoss - error during deploy - Java Beginners
JBoss - error during deploy  Hello! I've followed your fantastic tutorial about JBoss but I got stucked in exercise 2. I use JBoss AS 5 (don't really know what AS means but I hope I downloaded the right thing). I try to deploy 

J2EE

Building a Simple EJB Application Tutorial
create a new Session Bean from the Project Explorer (EJB Projects -> Simple EJB...)  Introduction In this tutorial we will create a simple session... a Session Bean Open the J2EE perspective in eclipse (Windows -> Open Perspective 

Enterprise Java

A Message-Driven Bean Example
. A message-driven bean has only a bean class i.e. unlike a session bean... of a simple message-driven bean application. In this example, we are going... namespace from within the bean class so that we do not need to configure deployment 

Java Beginners

hi - Java Beginners
/components/table.html Best Regards.  Hi Friend, Try the following...) with column names,if i am using this table type table(rowno,colno) how i am set... to * initialize the form. * WARNING: Do NOT modify this code. The content 

General

Deploying and testing Stateless Session Bean
Deploying and testing Stateless Session Bean... Session Bean developed in the last section. We will use ant build tool to build... learnt how to deploy Session Bean and test on Web Logic Server 

JSP Servlet Questions

session maintaining
session maintaining  Hi. I have created a login page. Consider... page of the website. i want to maintain session here. if user gives refresh after logged in it should retain in the same page. wat to do 

JSP Servlet Questions

session maintaining
session maintaining  Hi. I have created a login page. Consider... page of the website. i want to maintain session here. if user gives refresh after logged in it should retain in the same page. wat to do 

JSP Servlet Questions

session maintaining
session maintaining  Hi. I have created a login page. Consider... page of the website. i want to maintain session here. if user gives refresh after logged in it should retain in the same page. wat to do 

JSP Servlet Questions

session tracking - JSP-Servlet
session tracking  hi, i m working on a real estate web site....which i have to submit as final year project. im having problem regarding session... site how do i track his session activities....how to my pages will display his 

Java Interview Questions

JBoss Unix and Line Separator
JBoss Unix and Line Separator  Hi, I am trying to solve an critical problem. I have an application which write a batch file using the method println... the run.conf script from jboss I added the parameter -Dline.separator=separator I 

Java Beginners

Session ID - Java Beginners
Session ID  Do we get new session id for a new domain after clicking a page link.  Hi friend, package javacode; import java.io...., IOException { HttpSession session = req.getSession(true 

Hibernate Questions

How do we create session factory in hibernate?
How do we create session factory in hibernate?  Hi, How do we create session factory in hibernate? thanks 

General

Simple java program
Simple java program Hi this is the thing we got to do and i am totally.... For the part 1 i got it but the second part how do you start writing that program. plz do help me out here. Part I Write a program 

Java Beginners

A Simple program
A Simple program  Hi I have written the following code: class...); }//main }//class I want to add the area both rectangles and display them, but not getting how to do that. Please help me.   Hi Friend, Here is your 

Java Beginners

How to get the output of JSP program using Bean
program for the above one by using Bean and i opened the Tomcat webserver...How to get the output of JSP program using Bean  Hi Kindly go through a simple program below and give the solution for the said below one 

Java Beginners

Java Bean - Java Beginners
Java Bean  Sir, How can i add a java bean into a target GUI.... Thanking you Pabitra Kr Debanth.   Hi friend, Java Bean classes must.... Simple code import java.awt.*; import java.io.*; import 

JDBC Questions

get UnsatisfiedLinkError when I try to use my JDBC driver.
get UnsatisfiedLinkError when I try to use my JDBC driver.  Why do I get UnsatisfiedLinkError when I try to use my JDBC driver 

Programming Tutorials

Chapter 4. Session Bean Life Cycle
Chapter 4. Session Bean Life CyclePrev Part I. ... the life cycle of a stateful or stateless session bean instance. Stateful Session Bean A session bean 

Spring Framework Questions

Hi Rose India
Hi Rose India  Hi all, sorry if this is not the pright place to post this... im facing a trouble with constructor arguments, because i need to set 2 diferent constructor-arg in 1 bean: my applicationContext-dao.xml looks like 

Spring Framework Questions

bean creation exception
bean creation exception  hi i am getting exception while running simple spring ioc program Exception in thread "main... for resources is src/main/resources, so I suggest you put this file 

JSP Servlet Questions

how to get session object in simple java class??
how to get session object in simple java class??  i am fallowing a simple mvc architecture. actually my problem is.... i am using 4 classes in my............................ is.................... now i need to get that session object (GroupPojo 

General

Building Web Application With Ant and Deploying on Jboss 3.0
Building Web Application With Ant and Deploying on Jboss 3.0       In this lesson I will show you how to build you web application and install on the Jboss 3.0 

Struts and Hibernate Integration Tutorial

Send Mail Bean
Send Mail Bean     In our application we have developed mailer bean that sends welcome email when a new user is registered to the system. Mail Bean also used when user 

EJB Questions

Cmp Bean - EJB
Cmp Bean   I want to create connection pool in admin console in sun... for : com.ddtek.jdbcx.sqlserver.SQLServerDataSource what I have to do or where i have to set the class path?  Hi I am sending code, it will help you 

SQL Question

how do i use sql like query in my jsp page
how do i use sql like query in my jsp page  how do i use sql like query in my jsp page   Hi Friend, Try the following code: <%@ page import="java.sql.*"%> <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver 

JSP Servlet Questions

how can i make a session invalidate in java when browser is closed
how can i make a session invalidate in java when browser is closed   how can i make a session invalidate in java when browser is closed   ... that shows the user account page fetching from session(same browser). So I wanted 

Java Beginners

jboss sever
jboss sever  Hi how to configure data source in jboss server and connection pooling Thanks Kalins naik   JBoss Tutorials 

JavaScript Questions

i have a problem to do this question...pls help me..
i have a problem to do this question...pls help me..  Write a program....   Hi Friend, Try this: import java.util.*; public class ReverseNumber... reversedNumber = 0; for (int i = 0; i <= num; i 

Java Beginners

I developed a simple java web project in Struts now If I have to import the project in Eclipse Indigo how can I do it
I developed a simple java web project in Struts now If I have to import the project in Eclipse Indigo how can I do it   I developed a simple java... can I do it . Can some one please let me know . Thanks   Basically 

Security Questions

session timeout - Security
session timeout  How to change session timeout using java programming i do not want to change timeout in web.xml.  Hi friend, Code...; Session session = null; session = new Session (theuser 

Java Beginners

jsp and bean problem
jsp and bean problem  Hi i have the following jsp code... Can you plz help me in separating the code to bean? I'm new to bean and need it for my...;/title> </head> <body> <% try { String connectionURL = "jdbc:mysql 

JDBC Questions

Bean
Bean  what is bean? how to use bean   HTML Code: Contents MOBILE STORE HOME PRODUCTS IMAGES COMPANY...;% Connection con; ResultSet rs; try { String strName 

Java Beginners

Hi... - Java Beginners
Hi...  I want to write code for change password from data base please... is occur  Hi Friend, Try the following code: 1)change.jsp... java bean file for setting and getting and other is .jsp file this file 

Java Beginners

Hi..
Hi..   what are the keywords available in simple HelloWorld program 

Java Beginners

plz try to clear my doubt for shuffling multi-dimensional array
plz try to clear my doubt for shuffling multi-dimensional array  hi... want to shuffle the ful entire multi-simensional array means wat v want to do??? plz help me... thanks in advance   Hi Friend, Try the following code 

Java Beginners

hi again - Java Beginners
hi again  i did the changes on the code but still the time is not decreasing i wanna reach increasing running time target sorry for asking too...; // testing every character for (int n=0 ;n  Hi friend, Do changes 

Java Beginners

hi
hi  servlet program to retrieve data from database using session object 

WebSevices Questions

I had this error while deploying a web services in jboss
I had this error while deploying a web services in jboss  Error...;/ServerService</url-pattern> </servlet-mapping> <session-config> <session-timeout> 30 </session 

JavaScript Questions

how do i apply the javascript validation functions to the iframe content?
how do i apply the javascript validation functions to the iframe content?  Hi friends am Yogesh Nandane..Developing a small accessibility evaluation... in the frame then how do i call this startframe function into the frame so 

JavaScript Questions

how do i apply the javascript validation functions to the iframe content?
how do i apply the javascript validation functions to the iframe content?  Hi friends am Yogesh Nandane..Developing a small accessibility evaluation... in the frame then how do i call this startframe function into the frame so 

JSP Servlet Questions

session management - JSP-Servlet
session management  hi friends... hope u all dng fine. i am dng... said session timeout 1min. even it is also not working.wht to do :-( i will give... able to go to the previous page and i am able to do the shopping options.... i 

EJB Questions

session
session  Which methods can be invoked by the container on a stateless session bean 

Java Beginners

Compilation Error in Java Bean - Java Beginners
my problem... When I deploy the Jsp Application on weblogic application...; } } myfirstjavabean.jsp:-> Home.html:-> A simple JSP application Name web.xml:-> myfirstjavabean.jsp *.do 

Advertisements Advertisements
 

 

 

DMCA.com