RE: Null values in Jsp page

2001-06-21 Thread Harley Rana









This is not a bug but a normal Java function. 

Try and print System.out.println() with a null string and the same will
happen in any program.



-Original
Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On
Behalf Of Marc SCHNEIDER
Sent: Wednesday, June 20, 2001
8:49 AM
To: Orion-Interest
Subject: Null values in Jsp page 



Hi,



There
is something strange with Orion 1.5.2 : when I print a variable which contains
a null value in a Jsp page, Orion prints null instead of an empty
string.

This
doesn't appends with the previous version of Orion I had (1.4.5).



Does
anybody know how to solve this problem ?



Regards,

Marc
SCHNEIDER








RE: Error running java -jar orion.jar -install

2001-06-10 Thread Harley Rana

Have you tried using sun's jdk 1.3?
That's the jdk that has been tested.





How do you integrate JAAS with orion security?

2001-06-08 Thread Harley Rana

I have been looking into the JAAS security for building a more flexible
security framework.
The main problem I have is how to use the jaas api with the security
features in Orion.
For example if you implement a custom LoginModule, how does it add a
principal to the Orion web container, or how does jaas register a user for
method permissions in an EJB?

Is there a way to integrate with the Orion security model with jaas?
Thanks for your help!






RE: configuration of web tier (JNDI)

2001-06-08 Thread Harley Rana

Hi Denis, I'm not sure why you are using tomcat, the example I made was
using orion.
If you want to change the page that process the form on LoginPage.jsp just
change the url in the action setting of the form.
Are you getting any errors? Is so what are the details?







RE: configuration of web tier (JNDI)

2001-05-31 Thread Harley Rana

Hey I've put together an example for you with a EJB that returns a Boolean
to a servlet if the user name and pass are "admin" "pass".
The changes that I made to the config files are;

in server.xml ;
application name="LoginEJB"
path="e:\orion1.4.5\applications\LoginEJB.ear"/
application name="LoginWEB"
path="e:\orion1.4.5\applications\LoginSite.ear"/

in application.xml;
web-module id="LoginWEB" path="../applications/LoginWEB.war" /

in default-web-site.xml;
default-web-app application="default" name="LoginWEB" /

Then just put the 3 files in the application directory, and change the
password in the servlet.
It should work, let me know how it goes.
Harley.





RE: configuration of web tier (JNDI)

2001-05-31 Thread Harley Rana

Forgot the files!!

Hey I've put together an example for you with a EJB that returns a Boolean
to a servlet if the user name and pass are "admin" "pass".
The changes that I made to the config files are;

in server.xml ;
application name="LoginEJB"
path="e:\orion1.4.5\applications\LoginEJB.ear"/
application name="LoginWEB"
path="e:\orion1.4.5\applications\LoginSite.ear"/

in application.xml;
web-module id="LoginWEB" path="../applications/LoginWEB.war" /

in default-web-site.xml;
default-web-app application="default" name="LoginWEB" /

Then just put the 3 files in the application directory, and change the
password in the servlet.
It should work, let me know how it goes.
Harley.


 files.zip


RE: configuration of web tier (JNDI)

2001-05-31 Thread Harley Rana

Hi site.zip has the source and if you just replace the old LoginWeb.war file
with the new one it should work.

Now there's the login page that sends the form to LoginResultPage.jsp, which
calls LoginWebBean that then calls the EJB.
The servlet is still there. All you need to call the servlet is change the
action in the form tag of the LoginPage.jsp.
I generally like using jsp with web beans instead of servlets because you
get a clearer separation of logic and display.

The answer to your question is on line 26 of LoginWebBean and 29 in the
servlet.  It sets the URL for the InitalContext to search, you could change
the URL to any computer that's hosting Orion.
If you look in the server.xml the line; application name="LoginEJB"
path="e:\orion1.4.5\applications\LoginEJB.ear"/
It binds the application to the name LoginEJB, that's why the URL in the
InitalContext is ormi://localhost/LoginEJB.  It's computer address and the
application on it.
I called System.setProperty () to set the properties, but you really should
use Property file instead.

I hope that clears the problem!  Let me know.
Harley.


 Site.zip
 LoginWeb.war


RE: configuration of web tier (JNDI)

2001-05-29 Thread Harley Rana

Hey Denis, its not to hard.
You would package both the seperate tiers files into seperate .ear files,
then in a servlet you would access a ejb by creating a properties file with
your JNDI settings and setting the url to the machine hosting the ejb tier
( for now would be localhost, but could be anything ), create the
InitalContext with the properties, and you can then access the bean on the
ejb tier from the web tier.
Its all about setting the IntialContex with the url of the right machine.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Denis Kranjcec
Sent: Monday, May 28, 2001 7:14 AM
To: Orion-Interest
Subject: configuration of web tier (JNDI)


Hi everyone!

I'm new user of Orion and I have one problem.

I want to separate web tier and ejb tier. Both tiers will be running in the
same server for now, but later they will be on different Orion servers.
How can I specify that my web tier make jndi lookup to ejb tier, where is
JNDI server...?
We have two applications and  both have Login bean so I must be able to
specify application where my web tier should make lookup.

Configuration should be same as that tiers are on different servers.

I have read Orion documentation, but there isn't examples, and I'm not able
to figure it out how to configure it.

Thanks in advance,
Denis Kranjcec







Binding OracleConectionPoolDataSource to JNDI name?

2001-05-06 Thread Harley Rana
Title: 



I have used the OracleConnectionPoolDataSource form a normal class, with out 
binding it to JNDI and it works fine. When i try and bind it i get an 
exception that saying :Error binding to server: 
java.io.NotSerializableException: oracle.jdbc.driver.OracleDriverAnyone got 
this working?this is the code in the constructor of a normal class. im using 
Oracle8i 1.1.7
Thanks alot for any help you can give!
Harley Rana. 
try{ 
System.setProperty("java.naming.factory.initial","com.evermind.server.ApplicationClientInitialContextFactory"); 
System.setProperty("java.naming.provider.url", "ormi://localhost/Togotech"); 
System.setProperty("java.naming.security.principal","admin"); 
System.setProperty("java.naming.security.credentials","rana21b"); 
InitialContext jndiContext = new 
InitialContext(); 
OracleConnectionPoolDataSourcepool = new 
oracle.jdbc.pool.OracleConnectionPoolDataSource(); 
pool.setURL("jdbc:oracle:thin:@localhost:1521:net"); 
pool.setUser("scott"); 
pool.setPassword("tiger"); 
pool.setDataSourceName("Togotech_Data"); 
System.out.println("Binding to 
JNDI..."); 
jndiContext.rebind("OracleDatasource",pool); 
}catch(SQLException 
s){ 
System.out.println("SQL exception - 
"+s); 
} catch(NamingException 
n){ 
System.out.println("Naming exception 
- "+n); } 



I solved my problem accessing EJB's.

2001-05-03 Thread Harley Rana

Hey i have figured out how to access a EJB from a client, not packaged in a
.ear.
If i tryed to access the bean by calling
context.lookup(java:comp/env/ejb/SomeBean);
, you get a exception stating the client must be a J2EE component.

The way around was to look at the file
E:\orion\application-deployments\AppName\hello-world-ejb.jar\orion-ejb-jar.x
ml, a get the value of location within session-deployment.
That give the JNDI location of the bean, so now you can call it from a
client with
context.lookup(whatever_location_is);

It was so simple, but took me ages to get working!
You still need to have a application-client.xml file in the META-INF, but
you don't need to package and deploy the client to access EJB's.
Also you call System.setProperty() for each of the propertys in the
JNDI.properties file, if you don't want to use a seperate file.






How to access EJB's from client (not packaged in .ear) ?

2001-05-01 Thread Harley Rana

Hi i have just started out with orion, i can't figure out how to access bean
from a client. i've followed the Hello-Planet primer and made some changes
to the bean, repackaged the .ear and redeployed.  Now every thing works fine
when access the bean from a servlet that is packaged in the .ear file.
My question is how do you access a bean, from a client not packaged in the
.ear file?

Im getting an NamingException usally saying :
java:comp/env namespace is only available from within a J2EE component
sometimes saying :
javax.naming.NamingException: Error reading application-client descriptor:
No location specified and no suitable instance of the type 'hello.ejb.Hello'
found for the ejb-ref HelloPlanet

I do have the application-client.xml file, and if i change details in it i
see change in message from the second exception type.  so it must be reading
the .xml file to see the change.

What do i need to do?
Could you include code examples please.
I appreciate any help you can give!
Thanks, Harley Rana.

 HelloClient.java
 hello-planet.ear


How to deploy simple HelloWorld type EJB?

2001-04-25 Thread Harley Rana

Hi i am having trouble accessing a simple session bean from a stand alone
client.
The bean looks like its been deploy correctly.
Here's the steps that i have done on windows 2000.
1. Create class files, this is the director structure.
 e:\beans\test\
 e:\beans\test\TestRemote
 e:\beans\test\TestEJB
 e:\beans\test\TestHome
2. Create ejb-jar.xml.  Not sure i am coding it right??
 e:\beans\Meta-Inf\
 e:\beans\Meta-Inf\ejb-jar.xml
3. Create these files into testEJB.jar
4. Create ear file.
 e:\apps\
 e:\apps\testEJB.jar
 e:\apps\Meta-Inf\
 e:\apps\Meta-Inf\application.xml
5. put the ear file into the orion\application
6. add application entry into the server.xml file.
7. start orion and it does unpack the ear file with no errors.

now i want to get the client access the bean.
8. create the Client.java file in the same directory as the EJB source
files.
e:\beans\test\Client
9. add application-client.xml
e:\beans\test\Meta-inf\application-client.xml

Now when i try and run this client a dialog pops up to enter the user,pass
word,and server.
The 2 messages printed out are;
Got context.
java.lang.SecurityException: No such domain/application: test/TESTApp

So i think i'm pretty close to getting it to work. The problems lies in the
xml files and correctly setting the JNDI mappings.

Not sure if or how to make the orion xml file like orion-ejb-jar.xml, and
orion-application.xml.
I would love some help getting the xml conig working!
Thanks for any help you can give, Harley Rana.

This is the client.

package test;

import javax.naming.*;
import java.util.Hashtable;
import javax.rmi.PortableRemoteObject;

class Client {

  public static void main(String[] args) {

System.setProperty(java.naming.factory.initial,com.evermind.server.Applic
ationClientInitialContextFactory);
System.setProperty(java.naming.provider.url,
  ormi://localhost/test/TESTApp);

try {
  InitialContext jndiContext = new InitialContext();
  System.out.println(Got context);
  Object ref  = jndiContext.lookup(test/TestApp);
  System.out.println(Got reference);
  TestHome home = (TestHome)
   PortableRemoteObject.narrow (ref, TestHome.class);
  TestRemote test = home.create();
  System.out.println(Calling EJB);
  System.out.println(test.getTest()); // should return a simple String.
} catch(Exception e) {
  System.out.println(e.toString());
}
  }
}





Simple steps to deploy a stateless session Bean.

2000-09-21 Thread Harley Rana

Hi i am having alot of trouble just deploying anything.
I would really appreciate if someone could give the step by step way to deploy 
a sime stateless session bean.
note i have got the server started and runnign jsp.

Thanks alot for your help!
Harley Rana

-
Powered by http://www.telstra.com





Help with deploying EJBs

2000-09-20 Thread Harley Rana

Hi i am new to orion server and need to deploy a simple ejb.  I have added a 
user and pass word to the pricipals.xml, assembled the bean with the 
ejb-jar.xml, put that in a .ear file, but when i try and run admin.jar -deploy 
i get this error:

Error: javax.naming.NamingException: Lookup error: 
java.io.StreamCorruptedExcept
ion: Caught EOFException while reading the stream header; nested exception is:
java.io.StreamCorruptedException: Caught EOFException while reading 
the
stream header

the exact command that i run is after starting the server :

java -jar admin.jar ormi://203.87.61.77:82 harley rana -deploy -file 
-deploymentName hey d:\ejb\hey.ear

Please help!!
Thanks Harley Rana

-
Powered by http://www.telstra.com