One more clue:  I just checked my repository in ~/.m2/repository and since I
tried running the mvn install:install-file cmd using both "db2java" and
"db2jcc" as the jdbc.artifactId I have the zip file for the driver in the
repository under both db2java and db2jcc (in com/ibm).  For some reason it's
not becoming available to the app though; if anyone can see what I'm doing
wrong I'd love to hear from you.

--jack

PS: I tried to do the mvn install:install-file using -Dpackaging=zip, since
the driver is actually in a zip file rather than a jar but I got a different
error, it seems pretty clear that the problem is that I'm not correctly
getting the dependency set up with maven (tho I could be wrong...).  Here's
the trace from that:

[EMAIL PROTECTED]:~/java/ccas/proto/af2.02/src/ccas/web$ mvn 
install:install-file
-Dfile=/home/jack/dnlds/java/db2/jdbc.driver/db2java.zip -DgroupId=com.ibm
-DartifactId=db2jcc -Dversion=3.50.152 -Dpackaging=zip -DgeneratePom=true
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO]
------------------------------------------------------------------------
[INFO] Building AppFuse Modular Application - Web (Struts 2)
[INFO]    task-segment: [install:install-file] (aggregator-style)
[INFO]
------------------------------------------------------------------------
[INFO] [install:install-file]
[INFO] Installing /home/jack/dnlds/java/db2/jdbc.driver/db2java.zip to
/home/jack/.m2/repository/com/ibm/db2jcc/3.50.152/db2jcc-3.50.152.zip
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Oct 20 17:08:11 GMT-05:00 2008
[INFO] Final Memory: 10M/94M
[INFO]
------------------------------------------------------------------------




[EMAIL PROTECTED]:~/java/ccas/proto/af2.02/src/ccas/web$ mvn jetty:run-war
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'jetty'.
[INFO]
------------------------------------------------------------------------
[INFO] Building AppFuse Modular Application - Web (Struts 2)
[INFO]    task-segment: [jetty:run-war]
[INFO]
------------------------------------------------------------------------
[INFO] Preparing jetty:run-war
Downloading:
http://repo1.maven.org/maven2/com/ibm/db2java/3.50.152/db2java-3.50.152.jar
Downloading:
http://static.appfuse.org/repository/com/ibm/db2java/3.50.152/db2java-3.50.152.jar
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) com.ibm:db2java:jar:3.50.152

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=com.ibm -DartifactId=db2java
-Dversion=3.50.152 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file
there: 
      mvn deploy:deploy-file -DgroupId=com.ibm -DartifactId=db2java
-Dversion=3.50.152 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
-DrepositoryId=[id]

  Path to dependency: 
        1) com.hbc.ccas:ccas-webapp:war:1.0-SNAPSHOT
        2) com.ibm:db2java:jar:3.50.152

----------
1 required artifact is missing.

for artifact: 
  com.hbc.ccas:ccas-webapp:war:1.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  appfuse (http://static.appfuse.org/repository)


[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Mon Oct 20 17:08:52 GMT-05:00 2008
[INFO] Final Memory: 16M/118M
[INFO]
------------------------------------------------------------------------





jackalista wrote:
> 
> I tried running mvn jetty:run-war after adding the profile below to my top
> level pom.xml and also changing the settings at the bottom of the pom.xml
> in the section titled "<!-- Database settings -->".  I got an
> UnsatisfiedLinkError that makes it look like even though the mvn
> install:install-file command succeeded the zip file for the driver doesn't
> appear to be available to the app.  If anyone knows what's wrong with this
> picture I'd appreciate hearing from you.  Here's the error I got running
> mvn jetty:run-war:
> 
> [EMAIL PROTECTED]:~/java/fooapp/web$ mvn jetty:run-war
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'jetty'.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building AppFuse Modular Application - Web (Struts 2)
> [INFO]    task-segment: [jetty:run-war]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Preparing jetty:run-war
> [INFO] [warpath:add-classes {execution: default}]
> [INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}]
> [INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}]
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] Compiling 1 source file to
> /home/jack/java/fooapp/web/target/classes
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:testCompile]
> [INFO] Compiling 1 source file to
> /home/jack/java/fooapp/web/target/test-classes
> [INFO] [dbunit:operation {execution: test-compile}]
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Error executing database operation: CLEAN_INSERT
> 
> Embedded error: java.lang.UnsatisfiedLinkError: no db2jdbc in
> java.library.path
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 10 seconds
> [INFO] Finished at: Mon Oct 20 16:47:09 GMT-05:00 2008
> [INFO] Final Memory: 19M/121M
> [INFO]
> ------------------------------------------------------------------------
> 
> 
> I have a feeling this is merely maven cluelessness, does anyone see what
> I'm doing wrong?
> 
> Thanks...
> 
> --jack
> 
> 
> 
> jackalista wrote:
>> 
>> I'm piecing together the profile for DB2, if someone would comment and
>> help me tweak this I'd appreciate it.  I'm trying to put together some
>> code in a hurry to do some performance testing and need to do it against
>> DB2.  I'm hoping to use appfuse on this project so I need to figure out
>> how to set appfuse up to use DB2.  We're using DB2 version 9.5, the
>> driver is in a zip file called db2java.zip.
>> 
>> Here's the profile I've got so far, can anyone take a look at this and
>> tell me if it's correct?:
>> 
>>           <profile>
>>             <id>db2</id>
>>             <properties>
>>                
>> <hibernate.dialect>org.hibernate.dialect.DB2Dialect</hibernate.dialect>
>>                 <jdbc.groupId>com.ibm</jdbc.groupId>
>>                 <jdbc.artifactId>db2jcc</jdbc.artifactId>
>>                 <jdbc.version>3.50.152</jdbc.version>
>>                
>> <jdbc.driverClassName>COM.ibm.db2.jdbc.app.DB2Driver</jdbc.driverClassName>
>>                
>> <jdbc.url><![CDATA[jdbc:db2://myhost:50000/mydb]]></jdbc.url>
>>                 <jdbc.username>foo</jdbc.username>
>>                 <jdbc.password>bar</jdbc.password>
>>             </properties>
>>         </profile>
>> 
>> The part I'm not sure about are the artifactId.  I seems like it should
>> either be db2jcc or db2java, I'm not sure which is right.  I tried
>> running the following command and it succeeded, so thta may confirm that
>> db2jcc is correct, but as I'm pretty new to maven I'm not too sure. 
>> Here's the command:
>> 
>> mvn install:install-file
>> -Dfile=/home/jack/dnlds/java/db2/jdbc.driver/db2java.zip
>> -DgroupId=com.ibm -DartifactId=db2jcc -Dversion=3.50.152 -Dpackaging=jar
>> -DgeneratePom=true
>> 
>> If anyone would help me figure out if this is the right approach, I'd be
>> very grateful, tia...
>> 
>> --jack
>> 
>> 
>> 
>> jackalista wrote:
>>> 
>>> I'm trying to run down how to configure appfuse to use DB2 so am finding
>>> a;ll these threads.  DB2 *does* have a single zip file for version 9.5
>>> of the DB.  
>>> 
>>> What I'm not so clear on is how to set this up.  Do I need to create a
>>> profile in the top pom.xml?  What other steps are involved?  I'm seeing
>>> info but some of it appears irrelevant (like the comments about multiple
>>> jars for the jdbc driver, for ex.).  Is there a list that explains how
>>> to integrate a DB?
>>> 
>>> Here's what appears to be the necessary steps:
>>> 
>>> 1. create a profile for DB2
>>> 2. somehow import the jar (actally a zip file in this case) into my
>>> project
>>> 3. set up hibernate to use the DB2 dialect (and where is this now?  I'm
>>> also semi new to appfuse 2.x)
>>> 
>>> Is that the correct set of steps?  Is the complete process spelled out
>>> anywhere?
>>> 
>>> thanks...
>>> 
>>> --j
>>> 
>>> 
>>> 
>>> mraible wrote:
>>>> 
>>>> You should be able to. I've tried to use the Derby Driver with DB2,
>>>> but it didn't work. The main issue we've had in adding DB2 support is
>>>> the fact that it requires multiple JARs for its JDBC Driver. If you
>>>> can find a single JAR/artifact we can use, we'd be happy to add
>>>> support. In the meantime, there's two things you can do:
>>>> 
>>>> 1. Replace all references to jdbc.* dependencies with the two
>>>> depdendencies that DB2 requires in pom.xml.
>>>> 
>>>> 2. Create a pom that has a dependency on the two DB2 artifacts and
>>>> install it in your local repository.
>>>> 
>>>> See the following entry (and comments) on my blog for more solutions:
>>>> 
>>>> http://raibledesigns.com/rd/entry/database_profiles_in_appfuse_2
>>>> 
>>>> Matt
>>>> 
>>>> On 9/26/07, meisam4910 <[EMAIL PROTECTED]> wrote:
>>>>>
>>>>> does Appfuse work with IBM DB2 ? in its database list i could not
>>>>> found the
>>>>> DB2 name :(( is there any way to use DB2 with appfuse ?
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/IBM-DB2-tf4521471s2369.html#a12898330
>>>>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>
>>>>>
>>>> 
>>>> 
>>>> -- 
>>>> http://raibledesigns.com
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/IBM-DB2-tp12898330s2369p20079950.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to