[JBoss-user] JBoss/Castor classloading problem

2001-07-26 Thread Ijonas Kisselbach

Hi,

I'm using JBoss  Castor at the Session Bean level. I have got the 
CastorRooms working properly and successfully extended some of the tests 
that come with the example code.

Applying the same setup to my own code now, I run into the following class 
loading error:


org.exolab.castor.mapping.MappingException: Could not find the class 
uk.co.servsoft.servc.dao.Account
org.exolab.castor.mapping.MappingException: Could not find the class 
uk.co.servsoft.servc.dao.Account
at 
org.exolab.castor.mapping.loader.MappingLoader.createDescriptor(MappingLoader.java:300)
at 
org.exolab.castor.jdo.engine.JDOMappingLoader.createDescriptor(JDOMappingLoader.java:147)
at 
org.exolab.castor.mapping.loader.MappingLoader.loadMapping(MappingLoader.java:211)
at 
org.exolab.castor.jdo.engine.JDOMappingLoader.loadMapping(JDOMappingLoader.java:294)
at org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:278)
at 
org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.java:317)
at org.exolab.castor.jdo.JDO.getDatabase(JDO.java:538)
at 
org.jboss.jdo.castor.CastorJDOImpl.getDatabase(CastorJDOImpl.java:168)
at 
uk.co.servsoft.servc.services.AccountServiceBean.createAccount(AccountServiceBean.java:58)
at java.lang.reflect.Method.invoke(Native Method)
at 
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer

at 
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInte

at 
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:263)
at 
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:190)
at 
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
at 
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:271)
at 
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:392)
at java.lang.reflect.Method.invoke(Native Method)
at 
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
at 
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
at java.lang.Thread.run(Thread.java:484)
---

The ...dao.Account object is stored in the same .jar as the session bean and 
I have set the CommonClassPath parameter in the jboss.jcml's Castor section 
to false (Setting it to true has no visible impact on this problem).

Any ideas ?


Thanks,
Ijonas Kisselbach

P.S. Apologies for crossposting to both jboss and castor mailing lists, but 
I don't know in which camp the problem lies.

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] JBuilder4 + JBoss

2001-04-23 Thread Ijonas Kisselbach

You need to recreate the META-INF/jboss.xml files under your project
sourcepath (Project Properties).

Should work.

Ijonas
- Original Message -
From: Burkhard Vogel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 23, 2001 3:16 PM
Subject: Re: [JBoss-user] JBuilder4 + JBoss


 BTW,
 JBuilder4 would offer a possibility to include additional files into the
 META-INF dir (in ejbgrp-Properties) which would be splendid to use to
 include my jboss.xml and jaws.xml (for CMP) _BUT_ it is not working for
 me... Anyone seen it doing something??
 Burkhard
 - Original Message -
 From: James Cook [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, April 23, 2001 3:19 PM
 Subject: Re: [JBoss-user] JBuilder4 + JBoss


  - Original Message -
  From: ZHU Jia [EMAIL PROTECTED]
 
   Some of you are surely using JBuilder as IDE, right?! Can someone give
 some
   tips about deploying EJBs from JBuilder into JBoss? Can I let JBuilder
   generate the deployment descriptor?
   Many thanks in advance!
 
  JBuilder Enterprise has built-in wizards to deploy to WebLogic and their
 own
  BAS. You don't need any of them to deploy to jBoss because jBoss's
 deployment
  scheme in a development environment is vastly superior. Simply have
 JBuilder
  build your archive in the jboss/deploy directory or set up a tool (in
 JBuilder
  Menu) to copy this archive to the deploy directory.
 
  They also have a nice deployment descriptor editor that will build the
 standard
  ejb-jar.xml and a specific ejb-inprise.xml file. To lookup references
 according
  to the EJB spec, you will have to include an jboss.xml descriptor and
this
 is
  not created by any of Borland's tools. You have to do this one yourself.
 It is
  trivial and you can use the JBuilder editor to build it.
 
  jim
 
 
  ___
  JBoss-user mailing list
  [EMAIL PROTECTED]
  http://lists.sourceforge.net/lists/listinfo/jboss-user


 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] JBoss 2.2: Servlet Authentication against JBoss realms. How ?

2001-04-19 Thread Ijonas Kisselbach



Hi,

I'm trying to authenticate servlets against a a 
JBoss realm. I've got the servlets and JSP authenticating against the 
org.apache.tomcat.request.SimpleRealm and tomcat-users.xml file. This works 
fine. But I know want to go to the next step and authenticate against a Jboss 
realm. Hence I've commented out the Tomcat security realm request interceptor 
from server.xml:

!--
 
RequestInterceptor 
 
className="org.apache.tomcat.request.SimpleRealm" 
 debug="0" 
/-- !-- 
JBoss, Map the current web user to the SecurityAssociation principal. 
-- RequestInterceptor 
className="org.jboss.tomcat.security.JbossRealm" 
/ 
I have changed my jboss.properties to point to 
tomcat/auth.conf :

java.security.auth.login.config==file:../conf/tomcat/auth.conf 


My auth.conf looks as 
follows:

simple { 
org.jboss.security.plugins.samples.SimpleServerLoginModule 
required;};

other { 
org.jboss.security.plugins.samples.JaasServerLoginModule required;
};

The security secions in my jboss.jcml file 
look as follows:

 !-- Security --

 !-- Uncomment to enable the 
sample SRPVerifierStore service mbean 
code="org.jboss.security.plugins.SRPVerifierStoreService" 
name="Security:name=SRPVerifierStoreService" 
attribute 
name="JndiName"SRPDefaultVerifierSource/attribute 
attribute 
name="StoreFile"SRPVerifierStore.ser/attribute 
/mbean-- !-- Uncomment to enable the SRP login 
service mbean code="org.jboss.security.plugins.SRPService" 
name="service:name=SRPService" attribute 
name="JndiName"SRPServerInterface/attribute 
attribute 
name="VerifierSourceJndiName"SRPDefaultVerifierSource/attribute 
attribute 
name="AuthenticationCacheJndiName"SRPAuthenticationCache/attribute 
attribute name="ServerPort"10099/attribute 
/mbean--

 !-- JAAS security manager and 
realm mapping -- mbean 
code="org.jboss.security.plugins.JaasSecurityManagerService" 
name="Security:name=JaasSecurityManager" attribute 
name="SecurityManagerClassName"org.jboss.security.plugins.JaasSecurityManager/attribute 
/mbean

 !-- 
Uncomment to enable the XML implementation of the JAAS policy 
mbean code="org.jboss.security.plugins.SecurityPolicyService" 
name="Security:name=SecurityPolicyService" 
attribute 
name="JndiName"DefaultSecurityPolicy/attribute 
attribute name="PolicyFile"sample_policy.xml/attribute 
/mbean--
As you can see fairly 
standard stuff a la the JAAS Howto.

Finally my web.xml that configures my servlets has 
the following section which worked under the SimpleRealm authentication provided 
by Tomcat:

 
security-constraint 
web-resource-collection 
web-resource-nameServ-C/web-resource-name 
url-pattern/*/url-pattern 
/web-resource-collection 
auth-constraint 
role-nameUser/role-name 
/auth-constraint /security-constraint

 
login-config 
auth-methodBASIC/auth-method 
realm-nameother/realm-name 
/login-config security-role 
role-nameUser/role-name 
/security-role security-role 
role-nameSuperuser/role-name 
/security-role

I would expect , upon accessing the default page, a 
dialogue box to appeat asking for username and password, which would then be 
authenticated against the roles.properties and user.properties 
files.

Where am I going wrong ?

Cheers,
Ijonas.


Re: [JBoss-user] JBoss 2.2: Servlet Authentication against JBoss realms. How ?

2001-04-19 Thread Ijonas Kisselbach

So let me get this right.

First I authenticate within Tomcat, using the usual means This then sets
ups credentials which will be passed onto JBoss for further handling.

But always authenticate in Tomcat first... ??

This makes sense if this is the case. Can you confirm ?

Cheers,
Ijonas.


- Original Message -
From: "Scott M Stark" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 6:53 PM
Subject: Re: [JBoss-user] JBoss 2.2: Servlet Authentication against JBoss
realms. How ?



 You have to have a Tomcat realm ahead of the JbossRealm as the JbossRealm
 just mpas the credentials obtained by the Tomcat Realm onto the JBoss
notion
 of the thread user.

 - Original Message -----
 From: Ijonas Kisselbach
 To: jbUser
 Sent: Thursday, April 19, 2001 10:01 AM
 Subject: [JBoss-user] JBoss 2.2: Servlet Authentication against JBoss
realms. How ?


 Hi,

 I'm trying to authenticate servlets against a a JBoss realm. I've got the
servlets and JSP authenticating against the
 org.apache.tomcat.request.SimpleRealm and tomcat-users.xml file. This
works fine. But I know want to go to the next step and
 authenticate against a Jboss realm. Hence I've commented out the Tomcat
security realm request interceptor from server.xml:

 !--
 RequestInterceptor
 className="org.apache.tomcat.request.SimpleRealm"
 debug="0" /
  --




 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] different datasources for differnet entity beans

2001-04-19 Thread Ijonas Kisselbach

Yeah no problem what so ever. The following works for BMP as well as CMP
beans.

Basically, all you need to do is specify different datasource resource
references in your ejb-jar.xml and jboss.xml files, e.g.:

ejb-jar.xml -

entity
  ejb-nameBean1/ejb-name
  homeBean1Home/home
  remoteBean1/remote
  ejb-classBean1Bean/ejb-class
  persistence-typeBean/persistence-type
  prim-key-classjava.lang.String/prim-key-class
  reentrantFalse/reentrant
  resource-ref
 res-ref-namejdbc/DB1/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
  /resource-ref
/entity
entity
  ejb-nameBean2/ejb-name
  homeBean2Home/home
  remoteBean2/remote
  ejb-classBean2Bean/ejb-class
  persistence-typeBean/persistence-type
  prim-key-classjava.lang.String/prim-key-class
  reentrantFalse/reentrant
  resource-ref
 res-ref-namejdbc/DB2/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
  /resource-ref
/entity

jboss.xml --

resource-managers
 resource-manager
res-class="org.jboss.ejb.deployment.JDBCResource"
 res-namejdbc/DB1/res-name
 res-jndi-namejava:/OracleDBPoolName/res-jndi-name
 /resource-manager
 resource-manager
res-class="org.jboss.ejb.deployment.JDBCResource"
 res-namejdbc/DB2/res-name
 res-jndi-namejava:/SybaseDBPoolName/res-jndi-name
 /resource-manager
 /resource-managers

 entity
   ejb-nameBean1/ejb-name
   jndi-nameapp/Bean1/jndi-name
   configuration-name/configuration-name
   resource-ref
   res-ref-namejdbc/DB1/res-ref-name
   resource-namejdbc/access1/resource-name
   /resource-ref
  /entity
 entity
   ejb-nameBean2/ejb-name
   jndi-nameapp/Bean2/jndi-name
   configuration-name/configuration-name
   resource-ref
   res-ref-namejdbc/DB2/res-ref-name
   resource-namejdbc/access2/resource-name
   /resource-ref
  /entity


- Original Message -
From: "Carles Pi-Sunyer" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 7:25 PM
Subject: [JBoss-user] different datasources for differnet entity beans


 Is it possible to configure the datasource that an
 entity bean uses on a per-bean basis?

 I have entity beans (container managed) that represent
 tables in different databases. I would like to avoid
 packaging them in different jar files. Is there any
 way to do this?

 Thanks,
 Carles

 __
 Do You Yahoo!?
 Yahoo! Auctions - buy the things you want at great prices
 http://auctions.yahoo.com/

 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 http://lists.sourceforge.net/lists/listinfo/jboss-user


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] DataSource, JDBC, and stuffs

2001-04-19 Thread Ijonas Kisselbach



Hi,

Step 1. You should have a getConnection() method 
that returns a java.sql.Connection object, which is retrieved through 
Context.lookup(). We use a base class with the following method:

 protected Connection getConnection() 
throws SQLException { Connection conn = 
null; Object o;

 String url = 
"java:comp/env/jdbc/MyDB"; if (ds == null) 
{ try 
{ o = 
ctx.lookup(url); ds = 
(javax.sql.DataSource) o; } catch 
(NamingException e) { throw new 
SQLException("Cannot find 
"+url+"\n"+e.getMessage()); 
} } return 
ds.getConnection(); }

Your ejb-jar.xml should look like 
this:

 
entity 
ejb-nameMyBean/ejb-name 
homeMyBeanHome/home 
remoteMyBean/remote 
ejb-classMyBean/ejb-class 
persistence-typeBean/persistence-type 
prim-key-classjava.lang.String/prim-key-class 
reentrantFalse/reentrant 
resource-ref  res-ref-namejdbc/MyDB/res-ref-name 
 
res-typejavax.sql.DataSource/res-type 
 
res-authContainer/res-auth 
/resource-ref /entity

The url used in getConnection() refes to the 
res-ref-name entry in your ejb-jar.xml

The res-ref-name is then further used in your 
jboss.xml

 
resource-managers  
resource-manager 
res-class="org.jboss.ejb.deployment.JDBCResource" 
res-namejdbc/access/res-name 
 res-jndi-namejava:/MyDB/res-jndi-name/resource-manager 
/resource-managers

 
enterprise-beans
entity 
ejb-nameMyBean/ejb-name 
jndi-namemy/MyBeanHome/jndi-name 
configuration-name/configuration-name 
resource-ref 
res-ref-namejdbc/MyDB/res-ref-name 
resource-namejdbc/access/resource-name 
/resource-ref 
/entity
 /enterprise-beans

Eventually, we end up with the res-jndi-name in 
jboss.xmlreferring to the connection pool name specified in 
jboss.jcml

 mbean 
code="org.jboss.jdbc.XADataSourceLoader" 
name="DefaultDomain:service=XADataSource,name=MyDB" attribute 
name="PoolName"MyDB/attribute attribute 
name="DataSourceClass"org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl/attribute 
 attribute 
name="Properties"URL=jdbc:oracle:thin:servsoft/servsoft@pluto:1521:servsoft/attribute 
attribute 
name="URL"jdbc:oracle:thin:@pluto:1521:servsoft/attribute 
attribute name="JDBCUser"user/attribute 
attribute name="Password"pwd/attribute 
/mbean

Hope this helps. Let me know if you need 
more.

Regs,
Ijonas.

- Original Message - 
From: "Cokorda Raka Angga Jananuraga" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 19, 2001 3:38 PM
Subject: Re: [JBoss-user] DataSource, JDBC, and 
stuffs
 Hi,  I have exactly the same problem (please see 
email with subject: JNDI and Connection Pool, etc. From 
Pellegrini, John. Posted on Sun, 01 Apr 2001 06:49:56 -0700). 
 Please, does anybody know the answer to this problem.  
thanks a lot, Raka  --- Cokorda Raka Angga 
Jananuraga [EMAIL PROTECTED] wrote:  Hi,   I'm a newbie to 
EJB and JBoss.  Now, I'm entering creating BMP entity bean 
chapter  in  my EJB book.   I 
have trouble in deploying the bean, especially  mapping a jndi name 
to a connection pool (?).   Which files to configure, 
and how ? I can't find  enough clues in JBoss documentation. 
  I've searched the maillist archive, but found little 
 reference.   Any hints would be very 
appriciated.   Thanks a lot,  Raka 
  __ 
 Do You Yahoo!?  Yahoo! Auctions - buy the things you want at 
great  prices  http://auctions.yahoo.com/ 
  ___  
JBoss-user mailing list  [EMAIL PROTECTED]  http://lists.sourceforge.net/lists/listinfo/jboss-user   
__ Do You 
Yahoo!? Yahoo! Auctions - buy the things you want at great 
prices http://auctions.yahoo.com/ 
 ___ JBoss-user 
mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user