Okay, I got issue (1) figured out. I did not add every single jar file
in the lib directory of OpenEJB to my client classpath. I had only added
the geronimo j2ee jar, the openejb core jar, and the openejb loader jar.
Once I added the entire contents of the openejb/lib directory, I was
able to run my ejb in an embedded container. 

I still haven't gotten around the other two issues, i.e., (1) The remote
server throws a ClassNotFoundException claiming that it can't find the
class for the home interface of my ejb, and (2) the maven build fails
with a ton of unresolved symbol errors.

Thanks,
Stan
 

-----Original Message-----
From: Stan Guillory [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 04, 2005 12:32 PM
To: [email protected]
Subject: [openejb-user] Newbie issues with OpenEJB

Hello,
    I am interested in using the embedded OpenEJB container for testing
EJBs. I am having three key problems that I hope someone can help me
with:
 
1) When I try to run a client that uses the embedded container, I get
the following exception/stack trace:
 
run-client:
     [java] javax.naming.NamingException: Attempted to load OpenEJB.
null [Root exception is java.lang.ClassCastException]
     [java]     at
org.openejb.client.LocalInitialContextFactory.getInitialContext(LocalIni
tialContextFactory.java:74)
     [java]     at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
     [java]     at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
     [java]     at
javax.naming.InitialContext.init(InitialContext.java:219)
     [java]     at
javax.naming.InitialContext.<init>(InitialContext.java:195)
     [java]     at examples.ch03.HelloClient.main(HelloClient.java:26)
     [java] Caused by: java.lang.ClassCastException
     [java]     at
org.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:78)
     [java]     at
org.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFa
ctory.java:86)
     [java]     at
org.openejb.client.LocalInitialContextFactory.getInitialContext(LocalIni
tialContextFactory.java:72)
     [java]     ... 5 more

 
2) When I try to run the remote server and deploy my beans into it, just
to see if I can get something working, I get a remote exception from the
server dues to a ClassNotFoundException, indicating that it can't find
the Home interface class for my ejb. The server logs indicate that the
ejb jar deployed successfully, which I assumed would put my ejb jar on
the classloader. The ejb jar is in my build tree, not in the tree of the
openejb install. Adding my jar to the CLASSPATH environment variable
before starting openejb did not help, not that I expected it would given
the contents of the openejb shell script.
 
3) When I try to build openejb from the source package I got off the
site (trying to step in diagnose the classcast exception), the maven
builds with the following errors:
 
__  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2
 
Starting the reactor...
Our processing order:
OpenEJB :: Core
OpenEJB :: Loader
Examples :: Movie Fun Application
OpenEJB :: Integration Tests
OpenEJB :: WebAdmin
+----------------------------------------
| Executing (default): OpenEJB :: Core
| Memory: 4M/6M
+----------------------------------------
build:start:
 
default:
modules:default:
modules:reactor:init:
 
build:start:
 
default:
java:prepare-filesystem:
 
java:compile:
    [depend] Deleted 0 out of date files in 0 seconds
    [echo] Compiling to
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/target/c
lasses
    [javac] Compiling 407 source files to
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/target/c
lasses
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/AssemblerTool.java:163: cannot
resolve symbol symbol  : class ConnectionManagerInfo
location: class org.openejb.alt.assembler.classic.AssemblerTool
    public ConnectionManager
assembleConnectionManager(ConnectionManagerInfo cmInfo)
                                                       ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/core/DeploymentInfo.java:72: cannot resolve symbol symbol
: class StatelessBeanManagedTxPolicy
location: package stateless
import org.openejb.core.stateless.StatelessBeanManagedTxPolicy;
                                  ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/AssemblerTool.java:341: cannot
resolve symbol symbol  : class MethodTransactionInfo
location: class org.openejb.alt.assembler.classic.AssemblerTool
    public void applyTransactionAttributes(DeploymentInfo
deploymentInfo, MethodTransactionInfo[] mtis) {
 
^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/ContainerSystemInfo.java:59: cannot
resolve symbol symbol  : class MethodTransactionInfo
location: class org.openejb.alt.assembler.classic.ContainerSystemInfo
    public MethodTransactionInfo[] methodTransactions;
           ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/FacilitiesInfo.java:91: cannot
resolve symbol symbol  : class ConnectionManagerInfo
location: class org.openejb.alt.assembler.classic.FacilitiesInfo
    public ConnectionManagerInfo [] connectionManagers;
           ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/JndiEncInfo.java:91: cannot resolve
symbol symbol  : class EjbLocalReferenceInfo
location: class org.openejb.alt.assembler.classic.JndiEncInfo
    public EjbLocalReferenceInfo[] ejbLocalReferences;
           ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/JndiEncInfo.java:92: cannot resolve
symbol symbol  : class ResourceReferenceInfo
location: class org.openejb.alt.assembler.classic.JndiEncInfo
    public ResourceReferenceInfo [] resourceRefs;
           ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/JndiEncBuilder.java:72: cannot
resolve symbol symbol  : class EjbLocalReferenceInfo
location: class org.openejb.alt.assembler.classic.JndiEncBuilder
    private final EjbLocalReferenceInfo[] ejbLocalReferences;
                  ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/JndiEncBuilder.java:74: cannot
resolve symbol symbol  : class ResourceReferenceInfo
location: class org.openejb.alt.assembler.classic.JndiEncBuilder
    private final ResourceReferenceInfo[] resourceRefs;
                  ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/resource/jdbc/JdbcManagedConnection.java:64: cannot resolve
symbol symbol  : class JdbcManagedConnectionMetaData
location: class org.openejb.resource.jdbc.JdbcManagedConnection
    private final JdbcManagedConnectionMetaData metaData;
                  ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/AssemblerTool.java:347: cannot
resolve symbol symbol  : class MethodTransactionInfo
location: class org.openejb.alt.assembler.classic.AssemblerTool
            MethodTransactionInfo transInfo = mtis[i];
            ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/Assembler.java:280: cannot resolve
symbol symbol  : class ConnectionManagerInfo
location: class org.openejb.alt.assembler.classic.Assembler
                ConnectionManagerInfo cmInfo =
configInfo.facilities.connectionManagers[i];
                ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/core/DeploymentInfo.java:258: cannot resolve symbol symbol
: class StatelessBeanManagedTxPolicy
location: class org.openejb.core.DeploymentInfo
                    policy = new
StatelessBeanManagedTxPolicy((TransactionContainer) container );
                                 ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/ContainerBuilder.java:107: cannot
resolve symbol symbol  : class EnterpriseBeanBuilder
location: class org.openejb.alt.assembler.classic.ContainerBuilder
                EnterpriseBeanBuilder deploymentBuilder = new
EnterpriseBeanBuilder(classLoader, ejbInfo);
                ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/ContainerBuilder.java:107: cannot
resolve symbol symbol  : class EnterpriseBeanBuilder
location: class org.openejb.alt.assembler.classic.ContainerBuilder
                EnterpriseBeanBuilder deploymentBuilder = new
EnterpriseBeanBuilder(classLoader, ejbInfo);
                                                              ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/JndiEncBuilder.java:97: cannot
resolve symbol symbol  : class EjbLocalReferenceInfo
location: class org.openejb.alt.assembler.classic.JndiEncBuilder
        ejbLocalReferences = (jndiEnc != null &&
jndiEnc.ejbLocalReferences != null) ? jndiEnc.ejbLocalReferences : new
EjbLocalReferenceInfo[]{};
 
^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/JndiEncBuilder.java:99: cannot
resolve symbol symbol  : class ResourceReferenceInfo
location: class org.openejb.alt.assembler.classic.JndiEncBuilder
        resourceRefs = (jndiEnc != null && jndiEnc.resourceRefs != null)
? jndiEnc.resourceRefs : new ResourceReferenceInfo[]{};
 
^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/JndiEncBuilder.java:127: cannot
resolve symbol symbol  : class EjbLocalReferenceInfo
location: class org.openejb.alt.assembler.classic.JndiEncBuilder
            EjbLocalReferenceInfo referenceInfo = ejbLocalReferences[i];
            ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/JndiEncBuilder.java:171: cannot
resolve symbol symbol  : class ResourceReferenceInfo
location: class org.openejb.alt.assembler.classic.JndiEncBuilder
            ResourceReferenceInfo referenceInfo = resourceRefs[i];
            ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/xml/ContainerSystem.java:147: cannot
resolve symbol symbol  : class MethodTransaction
location: class org.openejb.alt.assembler.classic.xml.ContainerSystem
        dos = DomTools.collectChildElementsByType(node,
MethodTransaction.class, METHOD_TRANSACTION);
                                                        ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/xml/ContainerSystem.java:148: cannot
resolve symbol symbol  : class MethodTransaction
location: class org.openejb.alt.assembler.classic.xml.ContainerSystem
        methodTransactions = new MethodTransaction[dos.length];
                                 ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/xml/ContainerSystem.java:149: cannot
resolve symbol symbol  : class MethodTransaction
location: class org.openejb.alt.assembler.classic.xml.ContainerSystem
        for (int i=0; i < dos.length; i++) methodTransactions[i] =
(MethodTransaction)dos[i];
                                                                    ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/xml/Facilities.java:148: cannot
resolve symbol symbol  : class ConnectionManager
location: class org.openejb.alt.assembler.classic.xml.Facilities
        DomObject[] dos =
DomTools.collectChildElementsByType(connectorsElement,
ConnectionManager.class, CONNECTION_MANAGER);
 
^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/xml/Facilities.java:149: cannot
resolve symbol symbol  : class ConnectionManager
location: class org.openejb.alt.assembler.classic.xml.Facilities
        connectionManagers = new ConnectionManager[dos.length];
                                 ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/xml/Facilities.java:150: cannot
resolve symbol symbol  : class ConnectionManager
location: class org.openejb.alt.assembler.classic.xml.Facilities
        for (int i=0; i < dos.length; i++) connectionManagers[i] =
(ConnectionManager)dos[i];
                                                                    ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/xml/JndiEnc.java:93: cannot resolve
symbol symbol  : class ResourceReference
location: class org.openejb.alt.assembler.classic.xml.JndiEnc
        dos = DomTools.collectChildElementsByType(node,
ResourceReference.class, RESOURCE_REF);
                                                        ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/xml/JndiEnc.java:94: cannot resolve
symbol symbol  : class ResourceReference
location: class org.openejb.alt.assembler.classic.xml.JndiEnc
        resourceRefs = new ResourceReference[dos.length];
                           ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/assembler/classic/xml/JndiEnc.java:95: cannot resolve
symbol symbol  : class ResourceReference
location: class org.openejb.alt.assembler.classic.xml.JndiEnc
        for (int i=0; i < dos.length; i++) resourceRefs[i] =
(ResourceReference)dos[i];
                                                              ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:250: cannot resolve
symbol symbol  : class MethodTransactionInfo
location: class org.openejb.alt.config.ConfigurationFactory
        sys.containerSystem.methodTransactions = new
MethodTransactionInfo[mthdTranInfos.size()];
                                                     ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:433: cannot resolve
symbol symbol  : class ConnectionManagerInfo
location: class org.openejb.alt.config.ConfigurationFactory
        ConnectionManagerInfo manager = new ConnectionManagerInfo();
        ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:433: cannot resolve
symbol symbol  : class ConnectionManagerInfo
location: class org.openejb.alt.config.ConfigurationFactory
        ConnectionManagerInfo manager = new ConnectionManagerInfo();
                                            ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:455: cannot resolve
symbol symbol  : class ConnectionManagerInfo
location: class org.openejb.alt.config.ConfigurationFactory
        facilities.connectionManagers = new
ConnectionManagerInfo[]{manager};
                                            ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:765: cannot resolve
symbol symbol  : class EjbLocalReferenceInfo
location: class org.openejb.alt.config.ConfigurationFactory
                EjbLocalReferenceInfo info = new
EjbLocalReferenceInfo();
                ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:765: cannot resolve
symbol symbol  : class EjbLocalReferenceInfo
location: class org.openejb.alt.config.ConfigurationFactory
                EjbLocalReferenceInfo info = new
EjbLocalReferenceInfo();
                                                 ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:795: cannot resolve
symbol symbol  : class ResourceReferenceInfo
location: class org.openejb.alt.config.ConfigurationFactory
                ResourceReferenceInfo info = new
ResourceReferenceInfo();
                ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:795: cannot resolve
symbol symbol  : class ResourceReferenceInfo
location: class org.openejb.alt.config.ConfigurationFactory
                ResourceReferenceInfo info = new
ResourceReferenceInfo();
                                                 ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:811: cannot resolve
symbol symbol  : class EjbLocalReferenceInfo
location: class org.openejb.alt.config.ConfigurationFactory
            jndi.ejbLocalReferences = new
EjbLocalReferenceInfo[ejbLocalRef.size()];
                                          ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:812: cannot resolve
symbol symbol  : class ResourceReferenceInfo
location: class org.openejb.alt.config.ConfigurationFactory
            jndi.resourceRefs = new
ResourceReferenceInfo[resRef.size()];
                                    ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:832: cannot resolve
symbol symbol  : class MethodTransactionInfo
location: class org.openejb.alt.config.ConfigurationFactory
        MethodTransactionInfo[] mTxs = new
MethodTransactionInfo[cTx.length];
        ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:832: cannot resolve
symbol symbol  : class MethodTransactionInfo
location: class org.openejb.alt.config.ConfigurationFactory
        MethodTransactionInfo[] mTxs = new
MethodTransactionInfo[cTx.length];
                                           ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/config/ConfigurationFactory.java:835: cannot resolve
symbol symbol  : class MethodTransactionInfo
location: class org.openejb.alt.config.ConfigurationFactory
            mTxs[i] = new MethodTransactionInfo();
                          ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/containers/castor_cmp11/CastorCMP11_EntityContainer.jav
a:343: cannot resolve symbol
symbol  : class JndiTxReference
location: class
org.openejb.alt.containers.castor_cmp11.CastorCMP11_EntityContainer
        JndiTxReference txReference = new JndiTxReference();
        ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/alt/containers/castor_cmp11/CastorCMP11_EntityContainer.jav
a:343: cannot resolve symbol
symbol  : class JndiTxReference
location: class
org.openejb.alt.containers.castor_cmp11.CastorCMP11_EntityContainer
        JndiTxReference txReference = new JndiTxReference();
                                          ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/resource/jdbc/JdbcManagedConnection.java:83: cannot resolve
symbol symbol  : class JdbcManagedConnectionMetaData
location: class org.openejb.resource.jdbc.JdbcManagedConnection
            metaData = new
JdbcManagedConnectionMetaData(sqlConn.getMetaData());
                           ^
/opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/modules/core/src/java
/org/openejb/resource/jdbc/JdbcManagedConnectionFactory.java:73: cannot
resolve symbol symbol  : class BasicManagedConnectionFactory
location: class org.openejb.resource.jdbc.JdbcManagedConnectionFactory
        factory = new BasicManagedConnectionFactory(this, driver, url,
defaultUserName, defaultPassword);
                      ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -deprecation for details.
45 errors
 
BUILD FAILED
File...... /opt/dev/sguillor/JavaThirdParty/openejb/1.0-beta1/maven.xml
Element... maven:reactor
Line...... 134
Column.... 27
Unable to obtain goal [default] --
/export/home/e71655/.maven/cache/maven-java-plugin-1.5/plugin.jelly:63:4
8: <ant:javac> Compile failed; see the compiler error output for
details.
Total time: 18 seconds
Finished at: Tue Oct 04 12:18:35 CDT 2005

I'll keep chugging along but would appreciate any pointers on either of
these three issues, particularly the ClassCastException I am getting in
the Local Container or the build issues. If it matters, I am on Solaris
8, Sun's 1.4.2_04 JDK, ant 1.6.2.
 
 
Thanks,
Stanford S. Guillory
Senior Engineer
Southwest Airlines Co.
[EMAIL PROTECTED]
 

Reply via email to