Hi Martin,

I just downloaded http://apache.ziply.com//juddi/3_0_4/juddi-portal-bundle-3.0.4.zip

0. I created a juddiv4 database (not v3 to avoid confusion)

1. I unzipped

2. I changed the juddiv3/WEB-INF/classes/META-INF/persistence.xml from derby dialect to mysql dialect.
<property name="openjpa.jdbc.DBDictionary" value="mysql"/>


3. I changed the juddiv3/META-INF/context.xml, and commented out derby and uncommented mysql,
and pointed it to the juddiv4 mysql database.
<!-- mysql -->
<Resource name="jdbc/JuddiDS" auth="Container"
            type="javax.sql.DataSource" username="root" password=""
            driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost:3306/juddiv4"
            maxActive="8"
            />


4. I fired up juddi with the start.sh

Then I checked the database, and it created all the tables:

Database changed
mysql> show tables;
+-------------------------------+
| Tables_in_juddiv4             |
+-------------------------------+
| OPENJPA_SEQUENCE_TABLE        |
| j3_address                    |
| j3_address_line               |
| j3_auth_token                 |
| j3_binding_category_bag       |
| j3_binding_descr              |
| j3_binding_template           |
| j3_business_category_bag      |
| j3_business_descr             |
| j3_business_entity            |
| j3_business_identifier        |
| j3_business_name              |
| j3_business_service           |
| j3_category_bag               |
| j3_clerk                      |
| j3_client_subscriptioninfo    |
| j3_contact                    |
| j3_contact_descr              |
| j3_discovery_url              |
| j3_email                      |
| j3_instance_details_descr     |
| j3_instance_details_doc_descr |
| j3_keyed_reference            |
| j3_keyed_reference_group      |
| j3_node                       |
| j3_overview_doc               |
| j3_overview_doc_descr         |
| j3_person_name                |
| j3_phone                      |
| j3_publisher                  |
| j3_publisher_assertion        |
| j3_service_category_bag       |
| j3_service_descr              |
| j3_service_name               |
| j3_service_projection         |
| j3_subscription               |
| j3_subscription_chunk_token   |
| j3_subscription_match         |
| j3_tmodel                     |
| j3_tmodel_category_bag        |
| j3_tmodel_descr               |
| j3_tmodel_identifier          |
| j3_tmodel_instance_info       |
| j3_tmodel_instance_info_descr |
| j3_transfer_token             |
| j3_transfer_token_keys        |
| j3_uddi_entity                |
+-------------------------------+
47 rows in set (0.00 sec)

I hope this helps..

--Kurt




On 4/5/11 11:04 AM, Martynas A. (chainer) wrote:
okay, my persistence.xml looks:

    <properties>
    <property name="openjpa.jdbc.SynchronizeMappings"
    value="buildSchema(SchemaAction='add')"/>
    <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>
    <property name="openjpa.jdbc.UpdateManager" value="operation-order"/>
    <property name="openjpa.jdbc.DBDictionary"
    value="org.apache.openjpa.jdbc.sql.MySQLDictionary"/>
<property name="openjpa.RuntimeUnenhancedClasses" value="warn"/>
    </properties>

(<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/> - makes no diff, I guess it takes ConnectionDriverName from context.xml)

context.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <!-- mysql -->
    <Resource name="jdbc/JuddiDS" auth="Container"
                type="javax.sql.DataSource" username="juddi"
    password="juddipw"
                driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://localhost:3306/juddiv3"
                maxActive="8"
                />
    </Context>


I even found you have similar problems some time ago ( http://openjpa.208410.n2.nabble.com/Openjpa-MySQL-Tomcat-datasource-issue-td3680422.html ). However I still cannot manage how to force it to build tables. Now it even does nothing.

localhost***.log tells:

    Apr 5, 2011 5:58:03 PM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    Apr 5, 2011 5:58:09 PM org.apache.catalina.core.ApplicationContext log
    SEVERE: StandardWrapper.Throwable
    <openjpa-1.2.2-r422266:898935 nonfatal general error>
    org.apache.openjpa.persistence.PersistenceException: You have an
    error in your SQL syntax; check the manual that corresponds to
    your MySQL server version for the right syntax to use near 'TYPE =
    innodb' at line 1 {stmnt 15097546 CREATE TABLE j3_address (id
    BIGINT NOT NULL, sort_code VARCHAR(10), tmodel_key VARCHAR(255),
    use_type VARCHAR(255), address_id BIGINT NOT NULL, PRIMARY KEY
    (id)) TYPE = innodb} [code=1064, state=42000]
        at
    org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:553)
        at
    org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:453)
        at
    
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:159)
    ...


Seems like a very similar exception to yours, but this time it's not juddiv3.xml and context.xml conflict, since they are both the same and nomater if I delete juddiv3.xml that makes no difference.

--Martin



2011/4/5 Kurt T Stam <[email protected] <mailto:[email protected]>>

    Martin,

    jUDDI uses JPA for persistence, and we support 2 implementations:
    OpenJPA and Hibernate. It looks like you are using OpenJPA, but
    with a persistence.xml which tries to use Hibernate.

    You should be using the OpenJPA persistence.xml. Can you try that?

    Thx,

    --Kurt




    On 4/5/11 10:01 AM, Martynas A. (chainer) wrote:
    Okay, I turned some debug options in log4j.properties:

        log4j.category.org.springframework.beans.property
        editors.CustomDateEditor=DEBUG

        log4j.debug=true

        # showing sql
        log4j.category.org.hibernate.hql.ast.QueryTranslatorImpl=DEBUG
        log4j.category.org.hibernate.SQL=DEBUG
        log4j.category.org.hibernate.loader.hql.QueryLoad er=DEBUG


    Launched on fresh juddi bundle deployment and juddiv3
    database.This probably might be
    interesting:/localhost.2011-04-05.log (
    http://codepaste.net/yuq5jq )/**others should be pretty much the
    same ( catalina.2011-04-05.log http://codepaste.net/o99gk3 ) and
    ( juddi.log http://codepaste.net/56hiet ).

    Tom Cunningham <[email protected] <mailto:[email protected]>>

        instead.        I have MySQL 5 installed locally, so if
        you're still having problems after that, I'll run through the
        instructions on my box with the juddi-portal-bundle and
        double check them for you.


    Maybe u have checked that?

    --Martin

    2011/4/5 Kurt T Stam <[email protected]
    <mailto:[email protected]>>

        Hi Martin,

        The logs you referenced do not show any logging of it
        creating tables.

        --K


        On 4/5/11 6:09 AM, Martynas A. (chainer) wrote:
        Morning,

        on fresh clean juddiv3 database, with mentioned
        presistence.xml ( http://codepaste.net/donutg ) and
        context.xml ( http://codepaste.net/hckpnf )

        juddi.log: ( http://codepaste.net/b317wh )
        cmd.exe: ( http://codepaste.net/xv6zmi )

        --Martin

        2011/4/5 Kurt T Stam <[email protected]
        <mailto:[email protected]>>

            Can you check the juddi.log for errors? If it doesn't
            create all the tables, there must be some error that may
            give you a clue as to what's going on. --K


            On 4/4/11 12:43 PM, Martynas A. (chainer) wrote:
            okay I did it from the start with using MySQL5Dialect.
            Deleted juddiv3.xml, edited persistence.xml looks now (
            http://codepaste.net/donutg ), and context.xml looks
            now ( http://codepaste.net/hckpnf ). Still creates only
            34 tables.

            --Martin

            2011/4/4 Tom Cunningham <[email protected]
            <mailto:[email protected]>>





                On 04/04/2011 12:12 PM, Martynas A. (chainer) wrote:
                I'm using portable 'juddi-portal-bundle-3.0.4',
                MySQL5.5 [mysql  Ver 14.14 Distrib 5.5.9, for
                Win32 (x86)], and now tried with PostgreSQL
                (postgres (PostgreSQL) 9.0.3).


                okay I feel a bit green now, how to use
                MySQL5Dialect then? If it's about of downloading
                'hibernate-core-3.3.2.GA.jar' and adding it to
                '~\lib', I did it but nothing changes. I don't
                know how exactly this object-relational mapping works.



                The first instruction in the User Guide on how to
                switch to MySQL talks about editing the
                persistence.xml file and adding :


                <property name="hibernate.dialect" 
value="org.hibernate.dialect.MySQLDialect"/>


                What Kurt is suggesting is adding :

                <property name="hibernate.dialect" 
value="org.hibernate.dialect.MySQL5Dialect"/>


                instead.        I have MySQL 5 installed locally,
                so if you're still having problems after that, I'll
                run through the instructions on my box with the
                juddi-portal-bundle and double check them for you.









Reply via email to