Chapa Gurmukhi

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

Recent posts by Chapa Gurmukhi

Mate,
I would like to join you in the preparation. I am also starting to prepare for te exam. I am in the same boat could not devote full time on preparation. I have J2ee development of more than six years now.
Dear Prem,
Thanks a lot for your help. I am copying my classpath to you. Please have a look and tell me. I really want to see my ejb working

.;
C:\Sun\AppServer\jdk\lib\tools.jar;
C:\ProgramFiles\EditPlus;
C:\javaexam\javaprac;C:\asheesh\Titan-JBoss-3.2-12d\workbook\ant;
%PATH%;
C:\eclipse\workspace\IBE\src\server;
C:\eclipse\workspace\IBE\src\shared;
C:\Sun\AppServer\lib\j2ee.jar;
c:\IBE;C:\projects\jboss-tutorial;
C:\Sun\AppServer\lib\j2ee.jar;
C:\jboss-4.0.0\client\log4.jar;
C:\jboss-4.0.0\client\jboss-common-client.jar;
C:\jboss-4.0.0\client\jboss-system-client.jar;
C:\jboss-4.0.0\client\jnp-client.jar;
C:\jboss-4.0.0\client\jboss-client.jar;
C:\jboss-4.0.0\client\jbosssx-client.jar;
C:\projects\jboss-tutorial\HelloWorld.jar;
C:\jboss-4.0.0\server\default\deploy;
C:\jboss-4.0.0\server\default\lib\jboss-j2ee.jar;
C:\jboss-4.0.0\client;
C:\projects\jboss-tutorial;
C:\apache-ant-1.6.2\lib\ant.jar;
C:\asheesh\classes

This is all possible classpath I can think of

My java and class files are in C:\asheesh\classes\com\bizwise\ejb

I am calling my BeanClient class from classes directory using
java com/bizwise/ejb/BeanClient

Pleased help me. I know this is a problem of classpath only. Please help me
I am just writing a simple session bean. I have successfuly deployed the bean
the directory structure is C:\asheesh\classes\com\bizwise\ejb. under This I have kept all my java files including client

my client code is
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.util.Properties;
import com.bizwise.ejb.*;
//import com.bizwise.ejb.Adder;
//import com.bizwise.ejb.AdderHome;

public class BeanClient {

public static void main(String[] args) {
// preparing properties for constructing an InitialContext object
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
properties.put(Context.PROVIDER_URL, "localhost:1099");

try {
// Get an initial context
InitialContext jndiContext = new InitialContext(properties);
System.out.println("Got context");

// Get a reference to the Bean
Object ref = jndiContext.lookup("Adder");
System.out.println("Got reference");

// Get a reference from this to the Bean's Home interface
AdderHome home = (AdderHome)
PortableRemoteObject.narrow (ref, AdderHome.class);

// Create an Adder object from the Home interface
Adder adder = home.create();
System.out.println ("2 + 5 = " + adder.add(2, 5));
}
catch(Exception e) {
System.out.println(e.toString());
}
}
}

Please help me I m getting the below error

C:\asheesh\classes>java com/bizwise/ejb/BeanClient
Exception in thread "main" java.lang.NoClassDefFoundError: com/bizwise/ejb/BeanC
lient (wrong name: BeanClient)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Please help me
Thanks James,
My problem is that formula will put in by user as per their business calculation and they can put space or can put braces
like a = z + (b+c)*d
and a = z + (b+c)d

In mathematics its same i have a problem how can i make codes generic to all the style of writing the formula. I am really confused. I think we have to write some business rules for this formula
What you say??
20 years ago
Jimmy thanks,
but my problem is that formula are not handful. Moreover fomulaw are constructed by user for their business and stored in table against their name
it can a = b+c-a or can a= b-s*r/d etc etc.
I have to fetch the formula from table and do the mathematical calculations

I hope u underdstand my problem
20 years ago
Thanks Maulin,
I have downloaded API and will see if it fits in my requirement.
I tell you the scnario, what I need it
See my application gives the facility to the user to make their own formula of business and then calculate the value. Like I , as a user, enter and make a fomula Profit = Selling Price - Cost price. Now first I have to store the formula against the user in database. I can only store as a string. Now i eneter the value of the Selling Price and Cost Price regulary and my profit is calculated. My question is how can I calculate the formula as I rerieve the formula from table as String and then I have to pass the value of Selling Pricr and cost Price as double and have to make that "+" and "=" sign into arithmetic symbols of adition and equal. I hope u understand my query. please tell me whether your API can help me or not
20 years ago
Hey I have a strange problem
I am storing a formula say a = b + c as a string in a table.
Now I am getting the value of b and c as integer from external say email or from console
now i have to rerieve the formula from table and supply the value of band c and calculate the value of a. my problem is that when i retriev the formula its a string then how can i pass assign the value of b and c and do mathematical calculatuion to obtain value a. Please help me its quite urgent.
20 years ago
Thanks Pardeep its still not working
Ok Can u help me in this scenarion. There is a jsp file which is calling a servlet and this servlet is looking up a bean. Can you tell me where to put the jsp and servlet. I was working on a weblogic earlier. It was simple to put every file in their respective folder. Can you help me to locate which folder should i put the respective servlet and jsp.

Regarding my previous query i have put my client in the C:\projects\jboss-tutorial\com\mastertech\sample. Can it be a problem of not showing result. Please help me out.
20 years ago
Thanks Pradeep,
I have solved the problem. I have a problem with my ejb-jar.xml.
Now I am facing the problem in running the client.

C:\projects\jboss-tutorial>java HelloWorldClient
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldClient (wro
ng name: com/mastertech/sample/HelloWorldClient)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I know there is a problem with the classpath again. I am also copying my classpath. please help me whats the problem
My directory structure is C:\projects\jboss-tutorial\com\mastertech\sample
Under sample all my java files are residing
and my ejb-jar xml is residing under C:\projects\jboss-tutorial\META-INF

Here is my classpath also

.;C:\Sun\AppServer\jdk\lib\tools.jar;C:\Program Files\EditPlus;C:\javaexam\javaprac;C:\asheesh\Titan-JBoss-3.2-12d\workbook\ant;%PATH%;C:\eclipse\workspace\IBE\src\server;C:\eclipse\workspace\IBE\src\shared;C:\Sun\AppServer\lib\j2ee.jar;c:\IBE;

C:\projects\jboss-tutorial;C:\Sun\AppServer\lib\j2ee.jar;C:\jboss-4.0.0\client\log4.jar;C:\jboss-4.0.0\client\jboss-common-client.jar;C:\jboss-4.0.0\client\jboss-system-client.jar;C:\jboss-4.0.0\client\jnp-client.jar;C:\jboss-4.0.0\client\jboss-client.jar;C:\jboss-4.0.0\client\jbosssx-client.jar;C:\projects\jboss-tutorial\HelloWorld.jar;C:\jboss-4.0.0\server\default\deploy;C:\jboss-4.0.0\server\default\lib\jboss-j2ee.jar;C:\jboss-4.0.0\client
20 years ago
Guys, I did exactly the same written to deploy the first session bean in jboss. Please help me out I am having the following problem
when i start the jboss, it says the class loader for the bean class not found. I know its a classpath problem but tried all the permutation and combination. please help me its really urgernt please!!!
20 years ago