More Clustering woes

2002-02-20 Thread Jesse Schoch


I was trying to setup vrrpd (a free vrrp) implementation to provide
availability for boxes running loadbalancer.jar but it seems there is
multicast address conflict.

Is there a way to set what multicast the loadbalancer.jar uses?

-jesse schoch





can't figure out this one. need help: logging, reloading custom usermanager class

2002-01-11 Thread Jesse Schoch

ok so i tried to write a custom usermanager but it will not work and will
not give me any clue as to why.  I have followed the directions on the
support site, and have turned on -verbosity 10, i think i may have had it
wrong the first time i compiled it but i don't know how to find out what
version of my class i am using.

Is there a way to see the date of the class file that's loaded?  how do you
insure that it is reloaded?  i've done touch application.xml web.xml and
every other xml that i can think of.

here is my code. it compiles fine, and this is from my active login system
so i'm pretty sure the code works.  how do i get the damn logging to work?
System.out.println() does not show up on my logs or STDOUT from running
orion.jar

package jesse;

import java.util.*;
import com.orionsupport.security.SimpleUserManager;
import java.sql.*;
import java.io.*;
import javax.sql.*;
import javax.naming.*;
//
// fuck some shit up with da user manager.
//

public class uM extends SimpleUserManager
{
private Map users  = new HashMap();
protected boolean userExists( String username )
{
boolean result = false;
try
{
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup(jdbc/mysql);
Connection con = ds.getConnection();
Statement st = con.createStatement();
Statement st2 = con.createStatement();
String q = select count(*) from stamps.users where
username='+username+';
ResultSet rs = st.executeQuery(q);
int test = rs.getInt(1);
if (test == 1)
{
result = true;
}
if (result){}
else {System.out.println(user:  +username+ does not 
exist\n);}
con.close();
}
catch (SQLException e)
{System.out.println(SQL error: +e);}
catch (NamingException er)
{System.out.println(jndi naming error+ er);}
return result;

}

  protected boolean checkPassword( String username, String password )
{
boolean result = false;
try
{
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup(jdbc/mysql);
Connection con = ds.getConnection();
Statement st = con.createStatement();
Statement st2 = con.createStatement();
if (userExists(username))
{
String q = select password user_id from stamps.users where
username='+username+';
ResultSet rs = st.executeQuery(q);
while (rs.next())
{
String u = rs.getString(2);
String p = rs.getString(1);
String q2 = select password('+password+');
ResultSet rs2 = st2.executeQuery(q2);
rs2.next();
String enpass = rs2.getString(1);
if (p.equals(enpass))
{
result = true;
users.put(username,u);
}
}
}
if (result){}
else {System.out.println(user:  +username+ failed pass check\n);}
con.close();
}
catch (SQLException e)
{System.out.println(SQL error: +e);}
catch (NamingException er)
{System.out.println(jndi naming error+ er);}
return result;
}
  protected boolean inGroup( String username, String groupname )
{
return true;
}
  protected String getUID(String username)
{
String result = (String)users.get(username);
return result;
}
}





Re: Clustering and Multicasting

2001-03-03 Thread Jesse Schoch

they are connected to a hub
- Original Message - 
From: "Juan Lorandi (Chile)" [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Saturday, March 03, 2001 1:59 PM
Subject: RE: Clustering and Multicasting


 are you connecting everything to the same switch (hub)???
 
 multicasting in a LAN is usually done by the switches, so hooking into a
 different hub may be problematic with some switches
 
 HTH
 
 JP
 
  -Original Message-
  From: Jesse Schoch [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 28, 2001 7:32 PM
  To: Orion-Interest
  Subject: Clustering and Multicasting
  
  
  I have installed a 3 node orion cluster(2 on windows2k and 1 
  on linux) and
  have it working just dandy, the replication seems to work and 
  so does the
  loadbalancer but...
  
  I also have a bsdi box, and recently upgraded to the 4.2 
  version which has a
  JDK and JVM on which orion runs fine, but when I try to put 
  into the cluster
  orion will not start and complains that it can't bind to the multicast
  address.  any ideas why this is happening?
  
  
 
 





Clustering and Multicasting

2001-02-28 Thread Jesse Schoch

I have installed a 3 node orion cluster(2 on windows2k and 1 on linux) and
have it working just dandy, the replication seems to work and so does the
loadbalancer but...

I also have a bsdi box, and recently upgraded to the 4.2 version which has a
JDK and JVM on which orion runs fine, but when I try to put into the cluster
orion will not start and complains that it can't bind to the multicast
address.  any ideas why this is happening?





Re: Connecting to LDAP from Orion

2001-02-28 Thread Jesse Schoch

i've set it up, there are examples at java.sun.com for how to use jndi

make sure you have your dn correct, it will save you lots of time
- Original Message -
From: "Franklin Kingma" [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Wednesday, February 28, 2001 3:38 PM
Subject: Connecting to LDAP from Orion


 Hi all,

 Today I tried to connect to a LDAP server so I tried some things for a
 while, but no luck...
 Has anyone done this before? Do you know of some docs/tuts from which I
can
 learn how to do this?

 thanks!


 franklin








JNI loading from jsp

2001-02-17 Thread Jesse Schoch



i've been having huge problems with the UnsatisfiedLinkError with the jni package from http://bristowhill.com/download/gd/
i had it working last night, after i moved the classes out 
of orion homeWEB-INF/classes to orion homelib/

i also have it in /usr/lib which is my default lib 
dir

but after i had a fatal error, with my program, and 
restared the server i get the same error again.

has anyone else had issues loading .so 
libraries?


RE: MySQL Identity Columns

2000-10-06 Thread Jesse Schoch

I have used it in the past, it works fine for me but you have to be aware
that it is per Db session and if you are using connection pooling you may
get the wrong last statement.  I solved the problem by putting my id into a
bean, and then using that as for the where for my updates.

Statement get_last_insert = con.createStatement();
String q = "select last_insert_id();"
ResultSet rs = con.executeQuery(q);


Jesse Schoch

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Holmes, George
(TWIi London)
Sent: Friday, October 06, 2000 9:52 AM
To: Orion-Interest
Subject: MySQL Identity Columns


Hi,

Does anyone have any code fragments for retrieving a MySQL identity value
using getLastInsertID() [ org.gjt.mm.mysql drivers ] under Orion?  The
documentation says that you have to cast the bespoke
statement/preparedstatement to a java.sql statement/preparedstatement?
Every time I get a ClassCastException?

Any help would be greatly appreciated.

Thanks

George

GEORGE HOLMES

TWI Interactive
Media House
Burlington Lane
LONDON
W4 2TH
ENGLAND

TEL: +44 208 233 5631
FAX: +44 208 233 7701
CELL: +44 7968 918813







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
{