Easybeans freezes Tomcat

View: New views
5 Messages — Rating Filter:   Alert me  

Easybeans freezes Tomcat

by okanovicsm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I create this easybeans.xml file and place it in WEB-INF/classes folder of
easybeans app in Tomcat webapps.

<?xml version="1.0" encoding="UTF-8"?>
        <easybeans xmlns="http://org.ow2.easybeans.server">
            <!-- Define components that will be started at runtime -->
            <components>
                <!-- RMI/JRMP will be used as protocol layer -->
                <rmi>
                    <protocol name="jrmp" port="1099" hostname="localhost" />
                </rmi>
                <!-- Start a transaction service -->
                <tm />
                <!-- Start a JMS provider -->
                <jms port="16030" hostname="localhost" />
                <!-- Creates an embedded HSQLDB database -->
                <hsqldb port="9001" dbName="jdbc_1">
                        <user name="easybeans" password="easybeans" />
                </hsqldb>
                <!-- Creates a JDBC pool with scmDS JNDI name -->
                <jdbcpool jndiName="scmDS" username="root"
                        password="root" url="jdbc:mysql://localhost:3306/scm"
                        driver="com.mysql.jdbc.Driver" />
                <!-- Start smartclient server with a link to the rmi
component-->
                <!--<smart-server port="2503" rmi="#rmi" />-->
            </components>
        </easybeans>

Everything from config file starts OK, but then it writes:

Embedded.start : Startup of EasyBeans '1.0.0' was done in '4.109' ms.
Embedded.start : Waiting requests...

... and stops. I can't start Tomcat manager application or any other app
deployed.
Without this config file Tomcat starts fine (easybeans app starts OK, too).
I've tried it on RC5 and RC6.

Re: Easybeans freezes Tomcat

by Florent BENOIT-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    Hi,

You need to add the <config> element in the <easybeans> element.

You can find the default configuration file for Tomcat here:
http://fisheye.easybeans.org/browse/EasyBeans/branches/easybeans/easybeans/modules/ee/web-app/src/main/resources/org/ow2/easybeans/server/war/easybeans-default.xml?r=2580

Without this element, by default there is an infinite loop then
EasyBeans is waiting...



 <!-- No infinite loop (daemon managed by WebContainer): wait="false"
   Enable MBeans: mbeans="true"
   No EasyBeans naming, use WebContainer naming: naming="false"
   Use EasyBeans JACC provider: jacc="true"
   Use EasyBeans file monitoring to detect archives: scanning="true"
   Use EasyBeans JMX Connector: connector="true"
   Enable Deployer and J2EEServer MBeans: deployer="true" &
j2eeserver="true"
-->

<config wait="false"
             mbeans="true"
             naming="false"
             jacc="true"
             scanning="true"
             connector="true"
             deployer="true"
             j2eeserver="true" />

Regards,

Florent


okanovicsm@... wrote:

> I create this easybeans.xml file and place it in WEB-INF/classes folder of
> easybeans app in Tomcat webapps.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <easybeans xmlns="http://org.ow2.easybeans.server">
>    <!-- Define components that will be started at runtime -->
>    <components>
> <!-- RMI/JRMP will be used as protocol layer -->
> <rmi>
>    <protocol name="jrmp" port="1099" hostname="localhost" />
> </rmi>
> <!-- Start a transaction service -->
> <tm />
> <!-- Start a JMS provider -->
> <jms port="16030" hostname="localhost" />
> <!-- Creates an embedded HSQLDB database -->
> <hsqldb port="9001" dbName="jdbc_1">
> <user name="easybeans" password="easybeans" />
> </hsqldb>
> <!-- Creates a JDBC pool with scmDS JNDI name -->
> <jdbcpool jndiName="scmDS" username="root"
> password="root" url="jdbc:mysql://localhost:3306/scm"
> driver="com.mysql.jdbc.Driver" />
> <!-- Start smartclient server with a link to the rmi
> component-->
> <!--<smart-server port="2503" rmi="#rmi" />-->
>    </components>
> </easybeans>
>
> Everything from config file starts OK, but then it writes:
>
> Embedded.start : Startup of EasyBeans '1.0.0' was done in '4.109' ms.
> Embedded.start : Waiting requests...
>
> ... and stops. I can't start Tomcat manager application or any other app
> deployed.
> Without this config file Tomcat starts fine (easybeans app starts OK, too).
> I've tried it on RC5 and RC6.
>
>
>  


Re: Re: Easybeans freezes Tomcat

by okanovicsm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Now, easybeans deploys fine, but I can't obtain entity manager with
@PersistenceContext EntityManager em; . It is always null.

easybeans.xml :
<?xml version="1.0" encoding="UTF-8"?>
        <easybeans xmlns="http://org.ow2.easybeans.server">
                <config wait="false"
                        mbeans="true"
                        naming="false"
                        jacc="true"
                        scanning="true"
                        connector="true"
                        deployer="true"
                        j2eeserver="true" />
            <!-- Define components that will be started at runtime -->
            <components>
                        <!-- RMI/JRMP will be used as protocol layer -->
                        <rmi>
                            <protocol name="jrmp" port="1099"
hostname="localhost" />
                        </rmi>
                        <!-- Start a transaction service -->
                        <tm />
                        <!-- Start a JMS provider -->
                        <jms port="16030" hostname="localhost" />
                        <!-- Creates an embedded HSQLDB database -->
                        <hsqldb port="9001" dbName="jdbc_1">
                                <user name="easybeans" password="easybeans" />
                        </hsqldb>
                        <!-- Creates a JDBC pool with scmDS JNDI name -->
                        <jdbcpool jndiName="scmDS" username="root"
                                password="q"
url="jdbc:mysql://localhost:3306/scm"
                                driver="com.mysql.jdbc.Driver" />
                        <!-- Start smartclient server with a link to the rmi
component-->
                        <smart-server port="2503" rmi="#rmi" />
            </components>
        </easybeans>

persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
  <persistence-unit name="scm" transaction-type="JTA">
     <provider></provider>
     <jta-data-source>scmDS</jta-data-source>
     <properties>
       <property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLDialect" />
       <property name="hibernate.hbm2ddl.auto" value="update" />
    </properties>
  </persistence-unit>
</persistence>

I have deployed ow2-easybeans-hibernate-1.0.1 with easybeans.xml and my own war
file with my application that uses this persistence.xml. Am I doing something
wrong?

No EntityManager

by okanovicsm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Now there's no EntityManager, i.e. it is null after injection.

Help? Anyone?

Re: No EntityManager

by Florent BENOIT-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    Hi,

Could you describe the content of your EAR or EJB-JAR please ?

Persistence.xml is currently analyzed in the META-INF/ directory of the
ejb-jars file and then it becomes available to the EJBs and servlets
components
Do you have some EJBs ?

Regards,

Florent


okanovicsm@... wrote:
> Now there's no EntityManager, i.e. it is null after injection.
>
> Help? Anyone?
>
>
>  

LightInTheBox - Buy quality products at wholesale price!