Re: Help needed

2001-09-01 Thread Lachezar Dobrev

   Hi.

 I'm trying to get Orion Server to start as a non-root users on Red Hat
 7.1.  I know I need to forward the port from 80 to something above
 1024.  Does any one know how I can do that with iptables.  I've never
 used it before.

  ipchains -I input --protocol tcp \
  --destination-port 80 -j REDIRECT 10240

  If the Orion port is 10240.
  You need to configure your kernel to support redirecting.
  Consult Kernel docs.

 Any help would be appreceated.
 
 
 Bill Wichgers

   Lachezar






Re[2]: Help needed

2001-09-01 Thread Marcello Mannino

 I'm trying to get Orion Server to start as a non-root users on Red Hat
 7.1.  I know I need to forward the port from 80 to something above
 1024.  Does any one know how I can do that with iptables.  I've never
 used it before.

LD   ipchains -I input --protocol tcp \
LD   --destination-port 80 -j REDIRECT 10240

LD   If the Orion port is 10240.
LD   You need to configure your kernel to support redirecting.
LD   Consult Kernel docs.
I have the same problem with Mandrake 8.0
It seems that all newest Linux releases use iptables instead of
ipchains and the syntax is a little different.
Any suggestion ?

TIA
Marcello





Re: Re[2]: Help needed

2001-09-01 Thread Lachezar Dobrev

   Hello.

  I'm trying to get Orion Server to start as a non-root users on Red Hat
  7.1.  I know I need to forward the port from 80 to something above
  1024.  Does any one know how I can do that with iptables.  I've never
  used it before.
 
 LD   ipchains -I input --protocol tcp \
 LD   --destination-port 80 -j REDIRECT 10240
 
 LD   If the Orion port is 10240.
 LD   You need to configure your kernel to support redirecting.
 LD   Consult Kernel docs.
 I have the same problem with Mandrake 8.0
 It seems that all newest Linux releases use iptables instead of
 ipchains and the syntax is a little different.
 Any suggestion ?

   1. You may decide to use IPChains instead of IPTables.
  This is a Kernel-Conf problem.

   2. I don't use IPTables, but... I searched some info on the net,
  and it seems, that it is not too different for IPTables than
  the ipchains one. Maybe you will have to write -I INPUT?!?!?

 TIA
 Marcello

   Lachezar






RE: Help needed

2001-09-01 Thread Johnny Miller

Instead of IP tables, you could use Apache to proxy port 80 requests to the
port your Orion is listening for.

You set up your virtual host in your apache conf file like this (you need to
make sure you have the Apache proxy module installed):

VirtualHost youripaddress:80
ServerName www.yourdomain.com
ProxyRequests On
RewriteEngine On
RewriteRule ^/(.*) http://www.yourdomain.com:4321/$1 [P]
TransferLog /pathtowhereyouwanttologaccess/access
LogFormat %v %h %l %u %t \%r\ %s %b \%{Referer}i\ \%{User-Agent}i\
/VirtualHost

(where 4321 is the port number your Orion is listening on.)

If you do that make sure you add this between your website tags to your
web-site xml file (the one in your orion/config dir):
frontend host=www.yourdomain.com port=80 /

You need to bear in mind that it makes your Orion access log files useless
as all request appear to have come from the same IP. All you do is use the
Apache ones instead.

Check out: http://www.orionsupport.com/articles/apachefrontend.html for some
additional info.

Hope this helps.

Johnny


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Bill Wichgers
Sent: 31 August 2001 16:49
To: Orion-Interest
Subject: Help needed


I'm trying to get Orion Server to start as a non-root users on Red Hat
7.1.  I know I need to forward the port from 80 to something above
1024.  Does any one know how I can do that with iptables.  I've never
used it before.


Any help would be appreceated.


Bill Wichgers







Help needed

2001-08-31 Thread Bill Wichgers

I'm trying to get Orion Server to start as a non-root users on Red Hat
7.1.  I know I need to forward the port from 80 to something above
1024.  Does any one know how I can do that with iptables.  I've never
used it before.


Any help would be appreceated.


Bill Wichgers





Re: Help needed.

2001-08-31 Thread Olekjadr Yaremenko

You can't if you use direct connection to your ejb stuff. Obvious
solution - use servlet as a facade for your server part and use http
with serialization or xml or html or clear text ...

Alex

 Antonio Vazquez wrote:
 
 Hi all,
 I've write a JApplet that comunicates with an EJB. It's work fine but
 I have a problem. I use
 com.evermind.server.ApplicationClientInitialContextFactory and to use
 it from the client I need to put orion.jar in every computer that use
 this applet. Can anybody tell me how I use it without copy orion.jar
 in every computer.
 
 Thanks in advance
 
 Antonio




Web-security-constraints URGENT help needed!

2001-06-12 Thread Lachezar Dobrev



 Preface: I have a password protected 
site. Servlets, JSPs and pages.

 Requirement: I want to disable 
security checking for CERTAIN items.

 Question: Simple: Can I and How Do 
I?

 Looking forward to hearing from 
you.

 Lachezar.


Somehow complicated question... URGENT help needed.

2001-05-08 Thread Lachezar Dobrev



 Hello.
 Preface: We are developing an 
application, consisting of number of services, a web interface, and a couple of 
servlets.

 Q1: We wish to use a number of 
Orion servers. However we need to cluster them, to empower the processor boost. 
As far as I know clustering is madefor the web apps only. That does not 
count. We may use non-clusterable Web App. However we need to cluster the EJBs. 
Some of them are deployable on multiple machines, others are server-type ejbs, 
that HAVE to run in one place only. I was unable to start RMI clustering either 
way. Exceptions, hang-ups... Tough problem. THE QUESTION: How do I cluster RMI 
interfaces of a number of Orion servers. Is that enough to receive different ejb 
home interface, when I look-up an EJB? If not, how do I do that? I mean: Lets 
say we have 10 Orion servers:
 1. Web App server. For the 
servlets, jsps and so on. HTTP documents are put on an Apache web server. That's 
one.
2..9. EJB servers. They 
have some 10 EJBs, to perform different tasks. they do not have tobe on 
all machines.
 10. sEJB server. These are 
some EJBs that perform server-type services. Access to different 
data-sources(not a java Data Source, but rather application specific non 
database data). They are deployed on one place only.

 I wish to be able to contact 
any ejb from any other on the cluster.
 How Do I Do That?

 Q2: TECHNICAL Is there 
a way to reset the InitialContextFactory?
 Problem: Some time ago I was 
lit a light about the RMIInitialContextFactory. It worked fine, until I came 
upon a situation, where I had to connect to services (EJBs) on a different 
machine, with a different provider URL, username, password. Well. In 3 words: It 
doesn't work! It still continues to use the prime connection. The same URL, user 
and password. And that's NOT good at all... I need to switch! the app continues 
on and on.
 Also: I have an EJB deployed 
on one Orion. I tried to connect to a different EJB on a different machine. OK. 
Then again not :(. I deployed the second EJB on the first Orion. Later when I 
try to connect to the other machine I connection to the local deployment. Why is 
that?

 Sorry, if these seem too dumb, 
or somehow unneeded, but I need to do this :(

 Please help. I like Orion 
much. I really wish to be able to run everything smoothly. Until now ISA worked 
fine, but it's slower, has some problems with the EJB-2-EJB connection and is 
EXPENSIVE! I really would like to run on Orion.

 Looking forward to hearing 
from you all.

 Lachezar Dobrev.
 May the shade of the tree 
strengthen you.


Help needed to access orion-primer example bean from standalone app

2001-01-30 Thread Mark Palaima


Below is a test to access orion-primer example bean from
a standalone client.

I can not get this to work and have looked through the
mail archive and web to find any working examples of
this type of access.  The lookup portion fails and I have
tried a number of variations.

Since the orion-primer example is used in the Orion
documentation and does work when I access the bean from
a servlet it seems that this bean is a good candidate
for being accessed from a standalone app (ie, any of the
mechanical issues regarding the bean creation and deployment
are moot).

I do have the application-client.xml empty for the
fully package qualified name reference attempt and have
the refs set correctly when using the JDNI name lookup.

I have verified that the host, application, username/password
etc... are correct and do work.  I have tried on 1.3.8 and
1.4.5, I am using JDK 1.2.2.

Please augment and/or modify or give hints to get this code to
access the HelloBean. I have spent a good amount of time trying
to make this work and really need some help.  Thanks ahead.

PS. let me know what version of Orion you use to get it to
work.  Also if you have a simple JNDI name dump utility so
I can "see" what Orion has done during its deployment would
be a great help.

MrP

Mark Palaima - [EMAIL PROTECTED]

/*
S T A N D A L O N EB E A NT E S T
*/
package test.beans ;

import hello.ejb.* ;
import java.util.Properties ;
import javax.naming.Context ;
import javax.naming.InitialContext;
import javax.naming.NamingException ;
import javax.rmi.PortableRemoteObject;

public class PrimerClient {

   public static void main(String[] args) {
   try {
HelloHome home ;

// GETS EXCEPTION:
// java:comp/env namespace is only available from within a J2EE
component
// Any variation of java:comp/env will get this exception.
home = (HelloHome)getNarrowedName(
"java:comp/env/ejb/hello/ejb/HelloHome",
HelloHome.class) ;

// GETS EXCEPTION:
// java:comp/env namespace is only available from within a J2EE
component
home = (HelloHome)getNarrowedName(
"java:comp/env/ejb/HelloHome",
HelloHome.class) ;

// GETS EXCEPTION:
// hello/ejb/HelloHome not found
home = (HelloHome)getNarrowedName(
"hello/ejb/HelloHome",
HelloHome.class) ;

// GETS EXCEPTION
// hello.ejb.HelloHome not found
home = (HelloHome)getNarrowedName(
"hello.ejb.HelloHome",
HelloHome.class) ;

Hello bizObj = home.create();

System.out.println("response: " + bizObj.sayHello()) ;

bizObj.remove();

   } catch(Exception ex) {
System.err.println("errmsg: " + ex.getMessage()) ;
   }
   }

// There are 2 ways to lookup the ejb homes:
//
// 1. The name is FQN like home.ejb.ErrorHome.  This does not
//require any support from the application-client.xml
//
// 2. The JDNI name like:
//hello/ejb/HelloHome  or
//java:com/env/ejb/hello/ejb/HelloHome
//requires an ejb-ref entry in the application-client.xml file
//
private static java.lang.Object getNarrowedName(String name, Class cls)
{
try {
InitialContext ctx = new InitialContext(getProperties());
Object ref = ctx.lookup(name) ;
Object narrowedObj = PortableRemoteObject.narrow(ref, cls);
return narrowedObj ;
}
catch(Exception e) {
System.out.println("Failed to find  narrow.\n" +
e.getMessage()) ;
System.out.println("") ;
}

return null ;
   }

   // Required since we are accessing the Orion JNDI tree from the outside
   // of the appserver.
   private static Properties getProperties() {
Properties p = new Properties();

p.setProperty(Context.PROVIDER_URL,
"ormi://localhost/orion-primer");
p.setProperty(
Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.ApplicationClientInitialContextFactory");

// orion\config\principals.xml, set deactivated="false" for admin
user
p.setProperty(Context.SECURITY_PRINCIPAL,   "admin");
p.setProperty(Context.SECURITY_CREDENTIALS, "123");

return p ;
   }
}





Help needed to access orion-primer example bean from standalone app

2001-01-30 Thread Mark Palaima


Below is a test to access orion-primer example bean from
a standalone client.

I can not get this to work and have looked through the
mail archive and web to find any working examples of
this type of access.  The lookup portion fails and I have
tried a number of variations.

Since the orion-primer example is used in the Orion
documentation and does work when I access the bean from
a servlet it seems that this bean is a good candidate
for being accessed from a standalone app (ie, any of the
mechanical issues regarding the bean creation and deployment
are moot) since it works.

I do have the application-client.xml empty for the
fully package qualified name reference attempt:

application-client
/application-client

and here is the application-client.xml used for the
JNDI lookup attempts:

application-client
ejb-ref
ejb-ref-nameejb/HelloHome/ejb-ref-name
ejb-ref-typeSession/ejb-ref-type
homehello.ejb.HelloHome/home
remotehello.ejb.Hello/remote
/ejb-ref
/application-client

I also make sure the application-client.xml is in a
META-INF directory under the directory where I am running
the standalone client program from.

I have verified that the host, application, username/password
etc... are correct and do work.  I have tried on 1.3.8 and
1.4.5, I am using JDK 1.2.2.

Please augment and/or modify or give hints to get this code to
access the HelloBean. I have spent a good amount of time trying
to make this work and really need some help.  Thanks ahead.

PS. let me know what version of Orion you use to get it to
work and where/what the application-client.xml was.  Also if
anyone a simple JNDI name dump utility so I can "see" what
Orion has done during its deployment would be a great help.

MrP

Mark Palaima - [EMAIL PROTECTED]

/***
S T A N D A L O N EB E A NT E S T
***/
package test.beans ;

import hello.ejb.* ;
import java.util.Properties ;
import javax.naming.Context ;
import javax.naming.InitialContext;
import javax.naming.NamingException ;
import javax.rmi.PortableRemoteObject;

public class PrimerClient {

   public static void main(String[] args) {
   try {
HelloHome home ;

// Returns null because:
// java:comp/env namespace is only available from within a J2EE
component
home = getHelloHome("java:comp/env/ejb/hello/ejb/HelloHome") ;

// Returns null because:
// java:comp/env namespace is only available from within a J2EE
component
if (home == null)
home = getHelloHome("java:comp/env/ejb/HelloHome") ;

// Returns null because:
// hello/ejb/HelloHome not found
if (home == null)
home = getHelloHome("hello/ejb/HelloHome") ;

// Returns null because:
// ejb/HelloHome not found
if (home == null)
home = getHelloHome("ejb/HelloHome") ;

// Returns null because:
// HelloHome not found
if (home == null)
home = getHelloHome("HelloHome") ;

// Returns null because:
// hello.ejb.HelloHome not found
if (home == null)
home = getHelloHome("hello.ejb.HelloHome") ;

// Unfortunately home is null from all above attempts (sigh...)
if (home == null) {
System.out.println("All HelloHome lookup attempts failed.")
;
}
else {
Hello bizObj = home.create();
System.out.println("response: " + bizObj.sayHello()) ;
bizObj.remove();
}

   } catch(Exception ex) {
System.err.println("errmsg: " + ex.getMessage()) ;
   }
   }

// There are 2 ways to lookup the ejb homes:
//
// 1. The name is FQN like home.ejb.ErrorHome.  This does not
//require any support from the application-client.xml
//
// 2. The JDNI name like:
//hello/ejb/HelloHome  or
//java:com/env/ejb/hello/ejb/HelloHome
//requires an ejb-ref entry in the application-client.xml file
private static HelloHome getHelloHome(String name)
{
try {
InitialContext ctx = new InitialContext(getProperties());
Object ref = ctx.lookup(name) ;
HelloHome narrowedObj =
(HelloHome)PortableRemoteObject.narrow(ref,
HelloHome.class);
return narrowedObj ;
}
catch(Exception e) {
System.out.println("Failed to find  narrow.\n" +
e.getMessage()) ;
System.out.println("") ;
}

return null ;
   }

   // Required since we are accessing the Orion JNDI tree from the outside
   // of the appserver.
 

debugging help needed

2000-09-08 Thread Jesse Schoch

I wrote a little method to parse out set() metadata out of a mysql database,
it works fine inside of a .jsp but when i call my class it gives me the
following error, how might i get more meaningfull debuging data.  i am a
java newbie and come from a perl background so please be verbose if this is
a stupid question:

java.lang.NullPointerException
at /pscms/options.jsp._jspService(/pscms/options.jsp.java:38) (JSP page line
20)
at com.evermind.server.http.EvermindHttpJspPage.service(Compiled Code)
at com.evermind.server.http.HttpApplication.t8(Compiled Code)
at com.evermind.server.http.JSPServlet.service(Compiled Code)
at com.evermind.server.http.di.pz(Compiled Code)
at com.evermind.server.http.di.forward(Compiled Code)
at com.evermind.server.http.dr.p4(Compiled Code)
at com.evermind.server.http.dr.p3(Compiled Code)
at com.evermind.util.f.run(Compiled Code)

///Below is the .jsp

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"

html
head
titleUntitled/title
/head

body
%@
 page
import="java.util.*,java.sql.*,javax.sql.*,javax.naming.*,pscms.HtmlOptionLi
st"
%
HI

%

HtmlOptionList hol = new HtmlOptionList("pscms.pscms_users");
Vector foo =  new Vector();
foo = hol.getHtmlOptionList("pscms.pscms_users");
out.println(foo.size());
out.println("pick your Group Id" + foo.get(1)+"brpick your
Region"+foo.get(1));

%
/body/html

and here is the HtmlOptionList.java

//generate option list from db
package pscms;
import java.sql.*;
import javax.sql.*;
import java.util.*;
import javax.naming.*;

public class HtmlOptionList
{

private String table;
private String htmlPrintString = "";
private String htmlPrintS;
private Vector v;
public HtmlOptionList(String table)
{
this.table = table;
}
public Vector getHtmlOptionList(String table)
{
try
{


Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/mysql");
Connection con = ds.getConnection();


DatabaseMetaData meta = con.getMetaData();
String productName = meta.getDatabaseProductName();
//HtmlOptionList hol = new HtmlOptionList();
//hol.getHtmlOptionList(con,"pscms_users");
//out.println(htmlPrintString);
String htmlPrintS = "";
String htmlPrints = "";


Vector v = new Vector();
Statement show_columns_st = con.createStatement();
String show_columns_q = "show columns from " + table;
ResultSet show_columns_rs = 
show_columns_st.executeQuery(show_columns_q);
ResultSetMetaData show_columns_rsmd = 
show_columns_rs.getMetaData();
int i = 1;
while (show_columns_rs.next())
{
// print the values for the current row.
String htmlPrintString = new String();
String string = "";
String bla = show_columns_rs.getString(2);
i++;
int c = 0;
int d =0;
StringTokenizer st = new StringTokenizer(bla,"','");
for (c = 0;st.hasMoreTokens();c++){String token = 
st.nextToken();}
StringTokenizer st1 = new StringTokenizer(bla,"','");
for (int b = 0;st1.hasMoreTokens();b++)
{
String token = st1.nextToken();
if(b == 0 )
{
if(token.equals("set("))
{
d = 1;
}
}
if(d ==1)
{
if(b == 1)
{
htmlPrintString=new 
String("SELECT id='north_east' name='gid'
title='Group ID'OPTION selected value='"+token+"'"+token);
}
if(b==0|| b == (c-1)||b==c||b==c-2)
{
}
else
{
  

Help needed in setting up EJB demo

2000-08-08 Thread Yong Chee Keong

Hi,

I downloaded the Orion server (v 1.03b)  and wanted to try out
the EJB examples. Prior to this , I have already downloaded
Hypersonic SQL

I managed to get some sample servlets to talk and access
the Hypersonic SQL database server. Then I decided to try
out the EJB samples.


Along with this, I also modifed the datasource.xml as given in the
online documentation.
==
 data-sources
  data-source
  name="Default data-source"
  class="com.evermind.sql.ConnectionDataSource"
  location="jdbc/DefaultDS"
  pooled-location="jdbc/DefaultPooledDS"
  xa-location="jdbc/xa/DefaultXADS"
  ejb-location="jdbc/DefaultEJBDS"
  url="jdbc:HypersonicSQL:test"
  connection-driver="hSql.hDriver"
  username="sa"
  password=""
  schema="database-schemas/hypersonic.xml"
  /
 /data-sources
==

When I followed the instrucutions included and modified the server.xml
file, I noticed that there were some errors.

==
C:\install\orionjava -jar orion.jar
Orion/1.0.3 initialized
Auto-deploying ejbsamples...
Auto-deploying usermanager... Error compiling
file:/C:/install/orion/demo/ejb/us
ermanager/: No default cmt-datasource and no source specified
Auto-deploying product... Error compiling
file:/C:/install/orion/demo/ejb/produc
t/: No default cmt-datasource and no source specified
Auto-deploying cart... done.
Auto-deploying product... Error instantiating application 'ejbsamples'
at file:/
C:/install/orion/demo/ejb/: Error auto-deploying application-client at
product:
No location specified and no suitable instance of the type 'Product'
found for the ejb-ref MyProduct
==

So I modifed the server.xml to back to the original contents (without
EJB demo)
and I thought that my data source was not configured correctly
and modified it to be this

==
data-sources
data-source
name="Default data-source"
class="com.evermind.sql.ConnectionDataSource"
location="jdbc/DefaultDS"
pooled-location="jdbc/DefaultPooledDS"
xa-location="jdbc/xa/DefaultXADS"
ejb-location="jdbc/DefaultEJBDS"
url="jdbc:HypersonicSQL:hsql://localhost"
connection-driver="org.hsql.jdbcDriver"
username="sa"
password=""
schema="database-schemas/hypersonic.xml"
/
/data-sources

==

However, the error still appears when I modifed back the server.xml
to include the EJB demo.

==
C:\install\orionjava -jar orion.jar
Orion/1.0.3 initialized
Auto-deploying usermanager... Error compiling
file:/C:/install/orion/demo/ejb/us
ermanager/: No default cmt-datasource and no source specified
Auto-deploying product... Error compiling
file:/C:/install/orion/demo/ejb/produc
t/: No default cmt-datasource and no source specified
Auto-deploying product... Error instantiating application 'ejbsamples'
at file:/
C:/install/orion/demo/ejb/: Error auto-deploying application-client at
product:
No location specified and no suitable instance of the type 'Product'
found for the ejb-ref MyProduct
==


Any help on this is very much appreciated. Or if you could point me to
a step by step tutorial / guide on developing EJB ( session and entity
bean) would be very much appreciated.

I have already downloaded the Orion server EJB Step By Step guide which
only covers on session bean in Orion server. However, I have not tried
it
yet.


Thank you.

Regards,
Yong Chee Keong