RE: Orion-based JSP bug -- The Case of the Exhibiting %00

2001-05-01 Thread John Pletka

I can reproduct this bug on Orion 1.4.0 under win2k, Sun JDK 1.3.0

-Original Message-
From: Rex McFarlin [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 10:28 AM
To: Orion-Interest
Subject: Orion-based JSP bug -- The Case of the Exhibiting %00


Can anyone help us solve a perplexing JSP bug? We have been unsuccessful.
 
If a "%00" is attached to the end of a URL (as in,
http://localhost:8008/dcr/index.jsp%00
  ) to a JSP page that is being
served by Orion server, the user receives, not the rendered HTML page that
he or she might be expecting, but a textual output of the raw JSP code for
that page. 
 
We have found this to be true with the following configuration:
Orion 1.4.1
Win2K
JDK1.3
 
Thank you,
 
Rex McFarlin
[EMAIL PROTECTED]  
 





SOAP interface for ejb beans?

2001-03-08 Thread John Pletka

Has anyone out there implemented a generic SOAP servlet that can take
requests in, lookup the requested bean, execute the method and return the
result?  I'm getting ready to write one, but I'd like to see what already
exists before I jump in.

Thanks




How to get RoleManager / setup UserManager

2001-01-28 Thread John Pletka



Ok, after spending half my weekend prowling through old 
archive lists I think I've found how to programmatically log in a user and 
manage user configurations from a stand-alone client (in theory at least).  
Now if it can just get it working ...
 
First of all, what do you have to do to get an instance of 
RoleManager?  I've tried the code below as recommended in a couple emails, 
but I always get a naming exception - NameNotFoundException.  I'm guessing 
that I have to explicitly deploy this thing, but I don't have a clue how to 
since it's buried in the orion.jar file and does not contain a ejb-jar.xml 
file.  (Possibly, do I have to add some reference to the 
application-client.xml file?)   This is basically the same question as 

http://www.mail-archive.com/orion-interest@orionserver.com/msg06969.html  
which never got a good answer.
 
RoleManager roleMgr = 
(RoleManager)  (new InitialContext()).lookup( 
"java:comp/RoleManager" );
 
If I can get the RoleManager working properly, I'll be happy 
for a while.  By the way, I assume that the RoleManager is how the Orion 
web server manages to maintain the principal for the current user ... I'm trying 
to manage user sessions the same way Orion does on the web server side where a 
user request comes in asynchronously with a session ID, and the request gets 
mapped over to the proper Principal before any bean methods are 
called.
 
 
The other question has to do with using the User 
Manager.  When I add the following to my orion-application.xml I get the 
NamingException when it is deployed.  What is the trick to doing 
this?  According to one poster, the atm example demonstrated this, but I 
must have a different version of the atm example.
 
     "
 
 
Finally, a tutorial for usermanager stuff was started over at 
Orionsupport.com, but never finished.  Is there a new version of 
this?  Here is the url I have: http://www.orionsupport.com/tutorials/usermanager/intro.jsp
 
            
Thanks,
            
    JohnI get "Error updating application estore: Error 
initializing userManager'com.evermind.ejb.EJBUserManager': 
NamingException: com.evermind.ejb.EJBUser not found" when Itry 
it.
 


Is it possible to have more than one InitialContext?

2001-01-25 Thread John Pletka

Is it possible to use multiple InitialContext objects within a single
application?  What I would like to be able to do is have a middleware
application that can receive messages (xml files, TIBCO messaging, SOAP
requests) and instansiate and execute beans on behalf of the person sending
the message.  I need to be executing within their security context however,
so my thought was to create an InitialContext for each of the clients using
the credentials they supply, and store that in a Hashtable to be reused the
next time they make a request.  I think I had read somewhere on this list
that you can only have one InitialContext per process, and that seems to be
my experience on the JSP side, but I did not know if a standalone
application had the same restriction.
If that is a restriction, is it Orion specific or is this the way it
is meant to be?




Does Orion support JAAS

2001-01-24 Thread John Pletka

Does Orion support JAAS (Java Authentication and Authorization Service)?  If
so, how do I configure Orion to use it?

Thanks,
John




RE: Accessing EJBs from Stand-alone app....

2001-01-19 Thread John Pletka

It's better if you respond to the list instead of directly -- this is
probably a common question and others may benefit from the discussion.
 
Let's pretend you have a the following bean
Remote Interface:com.foo.Foo
Home interface:   com.foo.FooHome
Enterprise bean:  com.foo.FooEJB
 
Your ejb-jar.xml file would read

   
  
 Foo
 com.foo.FooHome
 com.foo.Foo
 com.foo.FooEJB
 Stateful
 Container
 
   


Now you will have to create an application-client.xml file in a META-INF
directory under the directory you launch your program from
For now, it will be empty, just containing:
 


 
 
// Connect to Orion
public static void main(String args[])
{
Properties p = new Properties();
p.setProperty(Context.PROVIDER_URL, "ormi://hostname/application_name");
p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.ApplicationClientInitialContextFactory");
p.setProperty(Context.SECURITY_PRINCIPAL, "admin"); // This can be the
user you setup when you installed Orion
p.setProperty(Context.SECURITY_CREDENTIALS, "password");
InitialContext ctx = new InitialContext(p);
 
doSomething(ctx);
doSomethingWithJNDI(ctx);
 
}
Here are your two options:
1)  Use the fully qualified RemoteInterface name for the lookup
If you do this, you can leave the application-client.xml file empty and
you don't have to detail all your beans
public void doSomething(InitialContext ctx) throws NamingException
{
FooHome home = (FooHome)
PortableRemoteObject.narrow(ctx.lookup("com.foo.Foo"), FooHome.class);
Foo foo = home.create();
foo.doSomething();
}

2)  Use the JNDI Name
If you use this option, you will have to modify your
application-client.xml file to read:


ejb/FooHome
Session
com.foo.FooHome
com.foo.Foo


 
public void doSomethingWithJNDI(InitialContext ctx) throws
NamingException
{
FooHome home = (FooHome)
PortableRemoteObject.narrow(ctx.lookup("java:comp/env/ejb/FooHome"),
FooHome.class); 
Foo foo = home.create();
foo.doSomething();
}  
 

-Original Message-
From: Mohan Krishna [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 19, 2001 4:07 AM
To: John Pletka
Subject: Accessing EJBs from Stand-alone app


Hi, 
I am MohanKrishna, i heard your name in Orion Forums when u r in 
discussion with "how to access EJBs from stand-alone application". 
Actually what i want to do is i have to write one simple java program 
in that i have to access EJBs from my console...which r running Orion 
Server 
I am borrowing your help in this issue... 
1.let me know what is the code i have to add in my application 
2.what r the xml files i have to change(under Orion if necessary). 
3.have I to change my class path to run this... 
if u know plz give the detailed steps, if possible plz send the code 
i have to embed in my application.because i am new to this...so i am 
expecting detailed steps from u... 
Any help will be apprecited...and i am expecting a soon and detailed 
reply from u...because i have to rush it off very soon... 
plz take this one as a friend's problem and try to give the detailed 
reply... 
waiting for your mail... 
i hope u give detailed mail very soon... 
Regards 
MohanKrishna

  _  

Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
<http://www.hotmail.com> .








RE: Stand-alone-client

2001-01-17 Thread John Pletka

I don't know if this is a bug in Orion or not, but here is what I found

1)  You can look up the fully qualified remote interface name
("com.foo.EJBRemoteInterface") -- Note that you lookup the remote interface,
but it returns the Home interface
2)  You can add the  tag to the application-client.xml file under a
META-INF directory where you start the client application



ejb/FooHome
Session
com.foo.FooHome
com.foo.Foo



-Original Message-
From: Claes Theander [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 8:20 AM
To: Orion-Interest
Subject: Stand-alone-client


Hello!

I'm trying to connect to my EJB's from a stand alone client like this:

Properties prop = new Properties();

prop.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMII
nitialContextFactory");


prop.setProperty("java.naming.provider.url","ormi://localhost/myApp");
prop.setProperty("java.naming.security.principal","admin");
prop.setProperty("java.naming.security.credentials","123");
Context con = new InitialContext(prop);
boundObject = con.lookup("java:comp/env/ejb/XXXHome");
xxxHome =
(XXXHome)PortableRemoteObject.narrow(boundObject,XXXHome.class);

Im getting this error message:
"javax.naming.NameNotFoundException: java:comp/env/ejb/XXHome not
found."
I know that the EJB's are working cause I'm able to access them from a
jsp-page.
I have refs to the EJB in application-client.xml.

Any suggestions ?
/C.








RE: How to provide own security mechinism

2001-01-10 Thread John Pletka

I have not found a way to override those in the docs.  Assuming that they
can be overridden, that would solve problem #1.  I still don't know a way to
solve problem #2 through.  
Theoretically, should this work?

<>
InitialContext ctx = new InitialContext();
ctx.addToEnvironment(ctx.SECURITY_PRINCIPAL, "NEW_USER_ID");

<>
String userFromEnv =
sessionContext.getEnvironment().getProperty(InitialContext.SECURITY_PRINCIPA
L);

It makes sense that this should work, but the properties object
returned by getEnvironment() is always empty.

-Original Message-
From: Christian Sell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 3:15 AM
To: Orion-Interest
Subject: Re: How to provide own security mechinism


Therese the UserManager and RoleManager classes that you can use resp.
provide your own replacement for. They are described in the docs that come
with orion.

- Original Message -
From: "John Pletka" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 10:12 PM
Subject: How to provide own security mechinism


> Is it possible to override Orion's security classes with my own?  The main
> things I'm looking for are 1) the ability to authenticate against a 3rd
> party LDAP server, and 2) From the client process, dynamically change the
> Principal reported in an EJBContext object.
>





How to provide own security mechinism

2001-01-09 Thread John Pletka

Is it possible to override Orion's security classes with my own?  The main
things I'm looking for are 1) the ability to authenticate against a 3rd
party LDAP server, and 2) From the client process, dynamically change the
Principal reported in an EJBContext object.




Changing or adding information to EJBContext

2001-01-08 Thread John Pletka

I've created a message based middleware application that receives XML based
messages in and makes calls into my Enterprise beans based on the message.
I need a way of setting the Principal that Orion reports within the bean, or
at the very least a way to dynamically add properties to the Environment
that I can use from within the bean.  The messaging middleware is providing
my authenication, so logging into Orion for every call is not a good option
(besides being very slow).
Does anyone know a way to dynamically set the principal without
having to log in again?  Is it possible to change the environment without a
jndi lookup?

Thanks in advance,
John




Where to put bean property files

2000-12-28 Thread John Pletka

I have a bean that I'm trying to use in a jsp page that requires a
.properties file to initialize itself.  It looks for the properties file in
the current directory (new FileInputStream("fileName.properties")).  I've
tried putting the file in the lib directory, the WEB-INF directory, the
META-INF directory, in the same directory as the .jsp file and even in the
jar file of the bean, but I always get "FileNotFound" exceptions.  Where is
the proper place to put configuration files?




Running beans on separate box from webserver

2000-12-05 Thread John Pletka

I'm trying to set Orion up to run my jsp pages on one box and my beans on
another box. Where does the jndi.properties file go so that my default
InitialContext correctly points to the other box?  I'm deploying to a
directory instead of a .war file.  I've tried putting under my web-root
directory, but that did not seem to work.  Is there some special place to
put it change the default InitialContext?

Another question: The url in the jndi.properties files under the orion/demo
directory all have "ormi://localhost/ejbsamples"  Is ejbsamples the
application name as defined in the server.xml file?

Thanks,
John




Passing security information via Message

2000-11-30 Thread John Pletka

I working on an architecture design that has a messaging layer
between my servlets and enterprise beans.  Basically my servlet will publish
a xml message to a MOM product which will call the appropriate enterprise
beans.  My question is how do I package the user identification up into a
string when I create the message so the ejb can verify the user is logged in
and within the appropriate roles?  Once I get the information into the
message, how do I tell Orion who I am before calling the beans?  My users
will be logging in through the jsp page and getting a valid Principal.  

Thanks,
John




Debugging CMP sql

2000-11-28 Thread John Pletka

Is there any way to force orion to log all the SQL it generates?  I made a
change to one of my CMP beans to add some new columns, and now Oracle is
reporting an "Invalid column" error when I do a findAll.  This one should be
a no-brainer, but I've checked the orion-ejb-jar.xml file 5 times now and
everything is spelled correct.  The comment above the findAll method has not
changed since I added the columns, but I assume that has nothing to do with
this.






deployment="true" -- what does this do?

2000-11-09 Thread John Pletka

In the orion development docs, it recommends setting deployment="true" but
does not say why.  What does this buy you?

Also, is it possible to have a web application that references ejb's but is
not part of a war?  I've deployed my .ear file and everything worked fine.
My web designers are having to rebuild and re-deploy that ear file every
time they make a change.  I've tried setting the name attribute in the
default-web-site.xml file to point to a directory (which had the web.xml
file in the  WEB-INF directory), but it could not find my ejb class files.
I tried putting the ejb class files in the lib directory, but no luck there.
How do you set orion to look at a directory for it's web files instead of a
war?




findByPrimaryKey problem, Oracle char(10) space padding

2000-11-08 Thread John Pletka

I'm having a problem with Orion's findByPrimaryKey() method when the column
type is CHAR(10).  The problem is Oracle pads out the column to fill in the
extra spaces.  For example, if you store "KEY" in a CHAR(10) field, Oracle
saves it at "KEY   ".  This does not affect any queries run directly
through JDBC or SQL-Plus (you can write "WHERE key = 'KEY' " without
worrying about the spaces).  Orion seems to have problems with it though.
What I've found is Orion will only locate a record if I manually pad out the
string when I'm creating my PK class. 
What exactly does Orion do for these finder methods?  If it ran the
query against the database, it should (theoretically) be handled by Oracle.
Is there any way to see the SQL Orion sends to the database?  I don't think
it loads the table into memory beforehand, but is there some manipulation I
can do to the EJB.java file (maybe in the ejbPostCreate()) to trim the
values.  I guess I don't totally understand how Orion compares the
PrimaryKey class to the records in the database.

Thanks in advance
John