Re: Issue with ProGuard Maven plugin.

2008-07-03 Thread Mikel Cármenes Cavia
That makes pretty good sense.

I won't be having enough time today to finish implementing your solution,
though I am almost all done.

So, from what I understand, you do keep your jar dependencies in a lib
folder or some other sort of external storage, correct?

Would it be possible for me to, after having obfuscated just my code, to
grab that jar and package it along with the other jar dependencies (such as
hibernate, jfreechart, etc) into another jar?

Thanks for all the help mate, it is truly appreciated.

Regards,

Mikel

On Thu, Jul 3, 2008 at 05:12, Dirk Olmes <[EMAIL PROTECTED]> wrote:

> Mikel Cármenes Cavia wrote:
>
>> Well, that sure sounds like another very intelligent way to do it. Would
>> you
>> mind sharing the portion of your POM that takes care of this sort of
>> functionality?
>>
>
> Ok, here we go ...
>
> Step 1: list all the dependencies into a text file
> 
>org.apache.maven.plugins
>maven-dependency-plugin
>2.0
>
>
>generate-sources
>
>resolve
>
>
>de.exentra
>
> ${project.build.directory}/dependencies.txt
>
>
>
> 
>
>
> Step2: fill out the proguard template
> 
>org.codehaus.mojo
>exec-maven-plugin
>1.1-beta-1
>
>
>process-classes
>
>java
>
>
>com.xxx.ProguardConfigFilter
>
>
> ${project.build.directory}/dependencies.txt
>${settings.localRepository}
>
> ${project.basedir}/proguard.conf.in
>
> ${project.build.directory}/proguard.conf
>
>
>
>
> 
>
> I'll leave the implementation of ProguardConfigFilter as an exercise to the
> reader but it's fairly simple: read in the generated dependencies.txt, build
> full paths to the jars in the local repository and stuff that into the
> proguard.conf.in. Finally, write the result to proguard.conf
>
> Step 3: pack up all my project's classes into a single jar
> 
>org.apache.maven.plugins
>maven-assembly-plugin
>
>
>process-classes
>
>attached
>
>
>my-project-open
>false
>
>assembly.xml
>
>false
>
>
>
> 
>
> the assembly.xml is fairly simple, too but it assumes that all my project's
> modules have the same groupId:
> 
>deployment
>
>jar
>
>false
>
>
>
>
>true
>runtime
>
>com.xxx:*
>
>
>
> 
>
> Step4: proguard
> 
>com.pyx4me
>proguard-maven-plugin
>2.0.2
>
>
>package
>
>proguard
>
>
>
>
>
> ${project.build.directory}/proguard.conf
>false
>my-project-open.jar
>my-project.jar
>
>${java.home}/lib/rt.jar
>
>
> 
>
>  Further, do you incorporate your "other" dependencies into
>> the jar after ProGuard is done with the obfuscation, or do you always keep
>> them outside?
>>
>
> As you might have seen from the steps above, my build is special in two
> ways:
> - we don't obfuscate any third party dependencies. The philosophy is that
> you don't want to obfuscate something that's publicly available anyway.
> - we pack up all our project's output into a single jar. That's due to the
> fact that third party dependencies almost never change but our project does.
> With this approach, deployment becomes easy: just swap out a single jar and
> be done :-)
>
>  Thanks so much for the insight Dirk!
>>
>
> Hope this helps,
>
>
> -dirk
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Issue with ProGuard Maven plugin.

2008-07-02 Thread Mikel Cármenes Cavia
Well, that sure sounds like another very intelligent way to do it. Would you
mind sharing the portion of your POM that takes care of this sort of
functionality? Further, do you incorporate your "other" dependencies into
the jar after ProGuard is done with the obfuscation, or do you always keep
them outside? Thanks so much for the insight Dirk!

Cheers.

On Wed, Jul 2, 2008 at 09:43, Dirk Olmes <[EMAIL PROTECTED]> wrote:

> Mikel Cármenes Cavia wrote:
>
>> I wonder if this could have anything to do with the libraries themselves
>> being obfuscated, thus why some stuff can't be found. Is there any way to
>> prevent these from being obfuscated? I know of the easiest way, and that
>> would be for all the jar's to sit outside of the main application .jar,
>> however I would like to keep them inside. Other than that, I can't really
>> think of why this would be happening...
>>
>
> I think your analysis is spot on, Mikel. I worked around this using a
> slightly different approach:
>
> - only the artifacts in my jar are obfuscated
> - I use the dependency plugin to list all the "other" dependencies into a
> temporary file
> - I use the exec plugin to read in that file and fill out a proguard
> template file which is then passed as config into the proguard plugin.
>
> While this approach is somewhat complicated to set up it has been working
> flawlessly for me for quite some time now.
>
>
> -dirk
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Issue with ProGuard Maven plugin.

2008-07-02 Thread Mikel Cármenes Cavia
I wonder if this could have anything to do with the libraries themselves
being obfuscated, thus why some stuff can't be found. Is there any way to
prevent these from being obfuscated? I know of the easiest way, and that
would be for all the jar's to sit outside of the main application .jar,
however I would like to keep them inside. Other than that, I can't really
think of why this would be happening...

On Wed, Jul 2, 2008 at 08:51, Mikel Cármenes Cavia <[EMAIL PROTECTED]> wrote:

> Hmm, I am still getting the same error/warning messages after adding that
> to my POM. It seems like the jar's specified in the POM are being included,
> judging from this:
>
> *[INFO] proguard jar: C:\Documents and
> Settings\Mikel\.m2\repository\net\sf\proguard\proguard\4.1\proguard-4.1.jar
>  [proguard] ProGuard, version 4.1
>  [proguard] Reading input...
>  [proguard] Reading program jar
> [C:\iBuilder~Storage\GITSYSTEMS\target\GITSYSTEMS-1.0-jar-with-dependencies.jar]
> (filtered)
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\AbsoluteLayout\AbsoluteLayout\1.0.1\AbsoluteLayout-1.0.1.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\ant\ant\1.6.5\ant-1.6.5.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\org\antlr\antlr\2.7.6\antlr-2.7.6.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\org\apache\ant\ant-antlr\1.6.5\ant-antlr-1.6.5.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\cglib\cglib-nodep\2.1_3\cglib-nodep-2.1_3.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\commons-collections\commons-collections\2.1.1\commons-collections-2.1.1.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\commons-digester\commons-digester\1.7\commons-digester-1.7.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\xml-apis\xml-apis\1.0.b2\xml-apis-1.0.b2.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\concurrent\concurrent\1.3.2\concurrent-1.3.2.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\gnujaxp\gnujaxp\1.0.0\gnujaxp-1.0.0.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\org\hibernate\hibernate\3.2.6.ga
> \hibernate-3.2.6.ga.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\net\sf\ehcache\ehcache\1.2.3\ehcache-1.2.3.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\javax\transaction\jta\1.0.1\jta-1.0.1.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\asm\asm-attrs\1.5.3\asm-attrs-1.5.3.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\antlr\antlr\2.7.6\antlr-2.7.6.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\cglib\cglib\2.1_3\cglib-2.1_3.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\asm\asm\1.5.3\asm-1.5.3.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\ini4j\ini4j\0.3.2\ini4j-0.3.2.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\jacob\jacob\1.14\jacob-1.14.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\net\sf\jasperreports\jasperreports\3.0.0\jasperreports-3.0.0.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\jfree\jfreechart\1.0.9\jfreechart-1.0.9.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\jfree\jcommon\1.0.12\jcommon-1.0.12.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\jna\jna\3.0.3\jna-3.0.3.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\log4j\log4j\1.2.11\log4j-1.2.11.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\mysql-connector-java\mysql-connector-java\5.0.3\mysql-connector-java-5.0.3.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\poi\poi\2.5.

Re: Issue with ProGuard Maven plugin.

2008-07-02 Thread Mikel Cármenes Cavia
braryclasses'
option.
 [proguard] Warning: there were 27 unresolved references to program class
members.
 [proguard]  Your input classes appear to be inconsistent.
 [proguard]  You may need to recompile them and try again.
 [proguard]  Alternatively, you may have to specify the options
 [proguard]  '-dontskipnonpubliclibraryclasses' and/or
 [proguard]  '-dontskipnonpubliclibraryclassmembers'.
 [proguard] java.io.IOException: Please correct the above warnings first.
 [proguard] at proguard.Initializer.execute(Initializer.java:277)
 [proguard] at proguard.ProGuard.initialize(ProGuard.java:210)
 [proguard] at proguard.ProGuard.execute(ProGuard.java:85)
 [proguard] at proguard.ProGuard.main(ProGuard.java:499)
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Obfuscation failed (result=1)
[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: 1 minute 2 seconds
[INFO] Finished at: Wed Jul 02 08:47:01 ADT 2008
[INFO] Final Memory: 11M/23M
[INFO]

*

I have already tried specifying the suggested options, to no avail.

I'm gonna go ahead and post in the pyx4me mailing list. Thanks anyways, and
if anyone has any idea why this is happening, please let me know!

Cheers.

On Wed, Jul 2, 2008 at 06:43, Dirk Olmes <[EMAIL PROTECTED]> wrote:

> Mikel Cármenes Cavia wrote:
>
>> Isn't that feature enabled automatically?
>>
>
> It definitely is if you specify it in your POM.
>
> > I thought that Maven took care of
>
>> the dependencies specified in the POM by passing these over to ProGuard...
>> It'd be lovely to get this all to work!
>>
>
> I'm pretty sure that the plugin works as I use at - albeit a little bit
> different due to different requirements.
>
>
> -dirk
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Issue with ProGuard Maven plugin.

2008-07-01 Thread Mikel Cármenes Cavia
Isn't that feature enabled automatically? I thought that Maven took care of
the dependencies specified in the POM by passing these over to ProGuard...
It'd be lovely to get this all to work!

Thanks.

On Tue, Jul 1, 2008 at 15:19, Dirk Olmes <[EMAIL PROTECTED]> wrote:

> Mikel Cármenes Cavia wrote:
>
>> I actually managed to get past this error, I shamelessly forgot to take
>> care
>> of my ProGuard parameters. My POM now looks includes all of the pertinent
>> options, however, I continue to get errors, and I really have no clue what
>> they mean:
>>
>> Here they are:
>>
>>  [proguard] Warning: org.apache.tools.ant.Main: can't find superclass or
>> interface org.apache.tools.ant.launch.AntMain
>>
> [...]
>
> Did you try with true?
>
> -dirk
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Issue with ProGuard Maven plugin.

2008-06-30 Thread Mikel Cármenes Cavia
rreports.engine.export.JRXlsExporter: can't
find referenced method 'org.apache.poi.hssf.usermodel.HSSFPicture
createPicture(org.apache.poi.hssf.usermodel.HSSFClientAnchor,int)' in class
org.apache.poi.hssf.usermodel.HSSFPatriarch
 [proguard] Warning: net.sf.ehcache.hibernate.EhCacheProvider: can't find
referenced method 'CacheException(java.lang.Exception)' in class
org.hibernate.cache.CacheException
 [proguard] Warning: net.sf.ehcache.hibernate.EhCache: can't find referenced
method 'CacheException(java.lang.Exception)' in class
org.hibernate.cache.CacheException
 [proguard] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find
referenced method 'void
log(java.lang.String,org.apache.log4j.Level,java.lang.Object,java.lang.Throwable)'
in class org.apache.log4j.Category
 [proguard] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find
referenced method 'boolean isEnabledFor(org.apache.log4j.Level)' in class
org.apache.log4j.Category
 [proguard] Warning: org.jdesktop.swingx.auth.LoginService$1: can't find
referenced method 'boolean isCancelled()' in class
org.jdesktop.swingx.auth.LoginService$1
 [proguard] Warning: there were 33 unresolved references to superclasses or
interfaces.
 [proguard]  You may need to specify additional library jars (using
'-libraryjars'),
 [proguard]  or perhaps the '-dontskipnonpubliclibraryclasses'
option.
 [proguard] Warning: there were 27 unresolved references to program class
members.
 [proguard]  Your input classes appear to be inconsistent.
 [proguard]  You may need to recompile them and try again.
 [proguard]  Alternatively, you may have to specify the options
 [proguard]  '-dontskipnonpubliclibraryclasses' and/or
 [proguard]  '-dontskipnonpubliclibraryclassmembers'.
 [proguard] java.io.IOException: Please correct the above warnings first.
 [proguard] at proguard.Initializer.execute(Initializer.java:277)
 [proguard] at proguard.ProGuard.initialize(ProGuard.java:210)
 [proguard] at proguard.ProGuard.execute(ProGuard.java:85)
 [proguard] at proguard.ProGuard.main(ProGuard.java:499)
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Obfuscation failed (result=1)
[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: 58 seconds
[INFO] Finished at: Mon Jun 30 16:42:54 ADT 2008
[INFO] Final Memory: 15M/29M
[INFO]



As far as I know, all the project dependencies are handled automatically, so
I really shouldn't have to worry about the lib parameters, right?

Cheers,

Mikel



On Mon, Jun 30, 2008 at 15:20, Mikel Cármenes Cavia <[EMAIL PROTECTED]> wrote:

> Hey guys,
>
> I am trying to obfuscate my code by using Maven's ProGuard plugin.
>
> This is the section I added to my POM file to activate the plugin:
> ...
> 
> com.pyx4me
> proguard-maven-plugin
> 
>
>package
>proguard
>
> 
> 
> true
> ${project.build.finalName}.jar
> ${project.build.finalName}-small.jar
>
> ${project.build.directory}
>
> ${basedir}/proguard.conf
> 
> ${java.home}/lib/rt.jar
> 
> 
> -dontshrink
> -dontnote
> 
> 
>   
> ...
> And this is what I get at the very end of my packaging:
>
> ...
> [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\mysql-connector-java\mysql-connector-java\5.0.3\mysql-connector-java-5.0.3.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\poi\poi\2.5.1-final-20040804\poi-2.5.1-final-20040804.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\servlet\servlet\4.1.31\servlet-4.1.31.jar]
>  [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\swingx\swingx\0.9.3\swingx-0.9.3.jar]
>  [proguard] Reading library jar [C:\Program
> Files\Java\jdk1.6.0_06\jre\lib\rt.jar]
>  [proguard] Error: You have to specify '-keep' options for the shrinking
> step.
> [INFO]
> 
> [ERROR] BUILD ERROR
> [INFO]
> 
> [INFO] Obfuscation failed (result=1)
> [INFO]
> 
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> 
> [INFO] Total time: 33 seconds
> [INFO] Finished at: Mon Jun 30 15:19:07 ADT 2008
> [INFO] Final Memory: 15M/29M
> [INFO]
> 
>
>
> Does anybody know what might be causing this? Thanks!
>
>


Issue with ProGuard Maven plugin.

2008-06-30 Thread Mikel Cármenes Cavia
Hey guys,

I am trying to obfuscate my code by using Maven's ProGuard plugin.

This is the section I added to my POM file to activate the plugin:
...

com.pyx4me
proguard-maven-plugin

   
   package
   proguard
   


true
${project.build.finalName}.jar
${project.build.finalName}-small.jar

${project.build.directory}

${basedir}/proguard.conf

${java.home}/lib/rt.jar


-dontshrink
-dontnote


  
...
And this is what I get at the very end of my packaging:

...
[proguard] Reading library jar [C:\Documents and
Settings\Mikel\.m2\repository\mysql-connector-java\mysql-connector-java\5.0.3\mysql-connector-java-5.0.3.jar]
 [proguard] Reading library jar [C:\Documents and
Settings\Mikel\.m2\repository\poi\poi\2.5.1-final-20040804\poi-2.5.1-final-20040804.jar]
 [proguard] Reading library jar [C:\Documents and
Settings\Mikel\.m2\repository\servlet\servlet\4.1.31\servlet-4.1.31.jar]
 [proguard] Reading library jar [C:\Documents and
Settings\Mikel\.m2\repository\swingx\swingx\0.9.3\swingx-0.9.3.jar]
 [proguard] Reading library jar [C:\Program
Files\Java\jdk1.6.0_06\jre\lib\rt.jar]
 [proguard] Error: You have to specify '-keep' options for the shrinking
step.
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Obfuscation failed (result=1)
[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: 33 seconds
[INFO] Finished at: Mon Jun 30 15:19:07 ADT 2008
[INFO] Final Memory: 15M/29M
[INFO]



Does anybody know what might be causing this? Thanks!


Re: Where to put DLLs required by gwt-dev.jar ??

2008-06-25 Thread Mikel Cármenes Cavia
Hello Nicholas,

Would you mind elaborating a little more on how you went about getting your
DLL's to work?

I'm guessing that the answer you found was in my message thread about
incorporating DLL's, shockingly though, I still have not managed to figure
this one out myself!

I have two DLL's and I currently have not discovered a way to put them
inside my jar, in the very location where the Java code looks via JNA.

Thanks in advance mate!

Mikel

On Tue, Jun 24, 2008 at 07:22, nicolas de loof <[EMAIL PROTECTED]> wrote:

> I've found an answer in recent list archive about incorporating DLLs in
> maven project.
>
> For info I'll package all the DLLs in a zip, use dependency:unpack, and set
> my java.library.path
>
> 2008/6/24 nicolas de loof <[EMAIL PROTECTED]>:
>
> > I've setup my project with a dependency to gwt-dev-windows.jar, that is
> > downloaded in my local repository.
> >
> > To run the hosted mode I need two DLLs to be present in the same folder
> (in
> > my local repository)
> >
> > How can I set my dependencies/repository to get those DLLs downloaded and
> > installed by maven ?
> >
> > Nico.
> >
>


Re: Use Maven2 to build from a CVS tag

2008-06-18 Thread Mikel Cármenes Cavia
I'm developing a tool that among other things, allows for the user to pick a
CVS version and build it with maven (this is part of the process anyways).
While I have not got as far as you seem to be yet, I do not know of any
automated way to do this.

Could you elaborate on how you use the maven release plugin? Does it
generate a pom file by itself?

I have successfully mavenized the file system, so that dependencies reside
inside of the resources folder and the code is in its right place, however I
haven't yet figured out how to go about generating a pom file to feed maven
with all the correct dependencies in it, keeping in mind inter-dependence
and whatnot (such that things aren't listed multiple times..)


On Wed, Jun 18, 2008 at 10:38, Jeudy, Guillaume <[EMAIL PROTECTED]>
wrote:

> Hi maven savvy developers,
>
> Is there an automated way to trigger a maven build from a cvs tagged
> version ?
>
> Basically I want to check out the source code for a given tag and trigger
> the maven build.
>
> So far I need to do these steps separately (checkout with cvs then build
> with maven).
>
> I use the maven release plugin to create a new CVS tag and handle the build
> and everything.
>
> The trick is I have to rebuild with a different profile for every
> environment we have. This rebuild operation is done locally on the box where
> its going to be deployed using an environment properties file injected on
> the command-line. This rebuild needs to sync for a given tag in CVS
> automatically.
>
> It would be great to know how others have tackled this.
>
> Thanks,
> -Guillaume
>
>
>
> 
> This electronic mail (including any attachments) may contain information
> that is privileged, confidential, and/or otherwise protected from disclosure
> to anyone other than its intended recipient(s). Any dissemination or use of
> this electronic email or its contents (including any attachments) by persons
> other than the intended recipient(s) is strictly prohibited. If you have
> received this message in error, please notify us immediately by reply email
> so that we may correct our internal records. Please then delete the original
> message (including any attachments) in its entirety. Thank you.
>


Re: Incorporating DLL's into Maven Project.

2008-06-18 Thread Mikel Cármenes Cavia
I'm lost with this DLL business... What pains me the most is that I'm sure
it's quite the trivial thing to do, but I can't seem to figure it out...
Mikel

On Tue, Jun 17, 2008 at 15:31, Mikel Cármenes Cavia <[EMAIL PROTECTED]>
wrote:

> Kalle,
> I have made sure to carefully deploy the dll's to my repository, with the
> appropriate packaging parameters and all. Initially I was using mvn
> install:install-file, I now use mvn deploy:deploy-file, and when I look
> inside the repository, it all seems to be there, and it looks to be correct.
>
> The problem I am having is still at the packaging stage, with the error
> handling file set... and the PlexusIoResourceCollection not found.
>
> This is the same error I had before. It also says no such archiver "dll".
> Does my pom look good to you? (I don't wanna clutter pasting it all again,
> the pom and error are in the previous message).
>
> Thanks for your help.
>
> Mikel
>
> On Tue, Jun 17, 2008 at 15:14, Kalle Korhonen <[EMAIL PROTECTED]>
> wrote:
>
>> I'm guessing you didn't install the dll with the packaging type "dll" (use
>> -Dpackaging=dll, the default is jar -
>> http://maven.apache.org/plugins/maven-deploy-plugin/usage.html). Check
>> your
>> local repository and the pom for the dll. Regarding your earlier question,
>> you sure can package it into a jar and JNA's supposed to extract it out
>> from the jar automatically if not found on library path but that was
>> exactly
>> your original problem: either it wasn't working or java.library.path
>> wasn't
>> set properly. Even with JNA, it's recommended practice to have the library
>> in an accessible location on the system (
>>
>> https://jna.dev.java.net/javadoc/com/sun/jna/Native.html#loadLibrary(java.lang.String,%20java.lang.Class)
>> )
>>
>> Kalle
>>
>>
>> On Tue, Jun 17, 2008 at 10:23 AM, Mikel Cármenes Cavia <[EMAIL PROTECTED]>
>> wrote:
>>
>> > I have followed the steps, and I am now getting the following error
>> message
>> > when I try to package my project:
>> >
>> > [INFO]
>> > 
>> > [ERROR] BUILD ERROR
>> > [INFO]
>> > 
>> > [INFO] Failed to create assembly: Error adding file-set for
>> > 'org.git.systems:Cur
>> > vi:dll:1.0.0' to archive: Error adding archived file-set.
>> > PlexusIoResourceCollec
>> > tion not found for: C:\Documents and
>> > Settings\Mikel\.m2\repository\org\git\syste
>> > ms\Curvi\1.0.0\Curvi-1.0.0.dll
>> >
>> > No such archiver: 'dll'.
>> > [INFO]
>> > 
>> > [INFO] For more information, run Maven with the -e switch
>> > [INFO]
>> > 
>> > [INFO] Total time: 6 seconds
>> > [INFO] Finished at: Tue Jun 17 14:18:20 ADT 2008
>> > [INFO] Final Memory: 12M/25M
>> > [INFO]
>> > 
>> >
>> > Basically, I manually deployed the two dll's to Maven's repository (via
>> mvn
>> > install:install-file) and then made the following changes to my pom:
>> >
>> > ...
>> > 
>> >  org.git.systems
>> >  Curvi
>> >  1.0.0
>> >  compile
>> > dll
>> >
>> > 
>> >  org.git.systems
>> >  OptimizedSolver
>> >  1.0.0
>> >  compile
>> > dll
>> >
>> > ...
>> >
>> >
>> > ...
>> > 
>> >org.apache.maven.plugins
>> >maven-dependency-plugin
>> >
>> >  
>> >copy
>> >package
>> >
>> >  copy
>> >
>> >
>> >  
>> >
>> >  org.git.systems
>> >  Curvi
>> >  1.0.0
>> >  dll
>> >  true
>> >  /testingDLL
>> >  Curvi
>> >
>> >  
>> >
>> >  
>> >

Re: Incorporating DLL's into Maven Project.

2008-06-17 Thread Mikel Cármenes Cavia
Kalle,
I have made sure to carefully deploy the dll's to my repository, with the
appropriate packaging parameters and all. Initially I was using mvn
install:install-file, I now use mvn deploy:deploy-file, and when I look
inside the repository, it all seems to be there, and it looks to be correct.

The problem I am having is still at the packaging stage, with the error
handling file set... and the PlexusIoResourceCollection not found.

This is the same error I had before. It also says no such archiver "dll".
Does my pom look good to you? (I don't wanna clutter pasting it all again,
the pom and error are in the previous message).

Thanks for your help.

Mikel

On Tue, Jun 17, 2008 at 15:14, Kalle Korhonen <[EMAIL PROTECTED]>
wrote:

> I'm guessing you didn't install the dll with the packaging type "dll" (use
> -Dpackaging=dll, the default is jar -
> http://maven.apache.org/plugins/maven-deploy-plugin/usage.html). Check
> your
> local repository and the pom for the dll. Regarding your earlier question,
> you sure can package it into a jar and JNA's supposed to extract it out
> from the jar automatically if not found on library path but that was
> exactly
> your original problem: either it wasn't working or java.library.path wasn't
> set properly. Even with JNA, it's recommended practice to have the library
> in an accessible location on the system (
>
> https://jna.dev.java.net/javadoc/com/sun/jna/Native.html#loadLibrary(java.lang.String,%20java.lang.Class)
> )
>
> Kalle
>
>
> On Tue, Jun 17, 2008 at 10:23 AM, Mikel Cármenes Cavia <[EMAIL PROTECTED]>
> wrote:
>
> > I have followed the steps, and I am now getting the following error
> message
> > when I try to package my project:
> >
> > [INFO]
> > 
> > [ERROR] BUILD ERROR
> > [INFO]
> > 
> > [INFO] Failed to create assembly: Error adding file-set for
> > 'org.git.systems:Cur
> > vi:dll:1.0.0' to archive: Error adding archived file-set.
> > PlexusIoResourceCollec
> > tion not found for: C:\Documents and
> > Settings\Mikel\.m2\repository\org\git\syste
> > ms\Curvi\1.0.0\Curvi-1.0.0.dll
> >
> > No such archiver: 'dll'.
> > [INFO]
> > 
> > [INFO] For more information, run Maven with the -e switch
> > [INFO]
> > 
> > [INFO] Total time: 6 seconds
> > [INFO] Finished at: Tue Jun 17 14:18:20 ADT 2008
> > [INFO] Final Memory: 12M/25M
> > [INFO]
> > 
> >
> > Basically, I manually deployed the two dll's to Maven's repository (via
> mvn
> > install:install-file) and then made the following changes to my pom:
> >
> > ...
> > 
> >  org.git.systems
> >  Curvi
> >  1.0.0
> >  compile
> > dll
> >
> > 
> >  org.git.systems
> >  OptimizedSolver
> >  1.0.0
> >  compile
> > dll
> >
> > ...
> >
> >
> > ...
> > 
> >org.apache.maven.plugins
> >maven-dependency-plugin
> >
> >  
> >copy
> >package
> >
> >  copy
> >    
> >
> >  
> >
> >  org.git.systems
> >  Curvi
> >  1.0.0
> >  dll
> >  true
> >  /testingDLL
> >  Curvi
> >
> >  
> >
> >  
> >
> >  
> >
> > 
> >
> > 
> > 
> >
> >
> > Is there something I did wrong along the process?
> >
> > Thanks, I can't wait to get this to work.
> >
> >
> > On Tue, Jun 17, 2008 at 08:12, Mikel Cármenes Cavia <[EMAIL PROTECTED]>
> > wrote:
> >
> > > I will give those steps a shot today and let you all know if I run into
> > any
> > > problems. It sounds like a pretty logical thing to do actually, and
> > > fortunately I do not require cross-platform compilation and support at
> > this
> > > point.
> > > One quick question though, when you say that I should use the
> dependency
> >

Re: Incorporating DLL's into Maven Project.

2008-06-17 Thread Mikel Cármenes Cavia
I have followed the steps, and I am now getting the following error message
when I try to package my project:

[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Failed to create assembly: Error adding file-set for
'org.git.systems:Cur
vi:dll:1.0.0' to archive: Error adding archived file-set.
PlexusIoResourceCollec
tion not found for: C:\Documents and
Settings\Mikel\.m2\repository\org\git\syste
ms\Curvi\1.0.0\Curvi-1.0.0.dll

No such archiver: 'dll'.
[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: 6 seconds
[INFO] Finished at: Tue Jun 17 14:18:20 ADT 2008
[INFO] Final Memory: 12M/25M
[INFO]


Basically, I manually deployed the two dll's to Maven's repository (via mvn
install:install-file) and then made the following changes to my pom:

...

  org.git.systems
  Curvi
  1.0.0
  compile
dll


  org.git.systems
  OptimizedSolver
  1.0.0
  compile
dll

...


...

org.apache.maven.plugins
maven-dependency-plugin

  
copy
package

  copy


  

  org.git.systems
  Curvi
  1.0.0
  dll
  true
  /testingDLL
  Curvi

  

  

  







Is there something I did wrong along the process?

Thanks, I can't wait to get this to work.


On Tue, Jun 17, 2008 at 08:12, Mikel Cármenes Cavia <[EMAIL PROTECTED]>
wrote:

> I will give those steps a shot today and let you all know if I run into any
> problems. It sounds like a pretty logical thing to do actually, and
> fortunately I do not require cross-platform compilation and support at this
> point.
> One quick question though, when you say that I should use the dependency
> plugin to copy the DLL's to the target directory or other suitable location,
> could I specify that the DLL's be put inside the jar? (that is, in the
> resources folder).
>
> Thanks!
>
>
> On Mon, Jun 16, 2008 at 15:37, Kalle Korhonen <[EMAIL PROTECTED]>
> wrote:
>
>> If you don't need to worry about cross-platform compilation & support (and
>> sounds like you don't), the most straight-forwarded way to do this is to
>> deploy your dll to a Maven repository with type "dll", declare a
>> straight-up
>> dependency to it in your pom and then use the dependency plugin to copy
>> the
>> lib to the target dir or other suitable location for development
>> environment
>> and structure you assembly (or whatever is the format of the actual
>> delivery) similarly. If cross-platform support is desired, nar plugin (
>> http://java.freehep.org/freehep-nar-plugin/intro.html) is a bit more
>> involving but simplifies things greatly. However, using it requires some
>> code changes.
>>
>> Kalle
>>
>>
>> On Mon, Jun 16, 2008 at 11:19 AM, Mikel Cármenes Cavia <[EMAIL PROTECTED]>
>> wrote:
>>
>> > Hey guys,
>> > I need to include three DLL's in my Maven project. Prior to deciding to
>> > email the list, I have looked around the archives, and haven't been able
>> to
>> > find anything that would seem to answer my problem (which is a very easy
>> > one
>> > in nature).
>> >
>> > I use JNA to interface with two of the three DLL's (the third one is for
>> > Jacob, and its location needs to be set as a system variable).
>> >
>> > In Java, I do the following:
>> >
>> > URL libURL = this.getClass().getResource("/org/git/systems/DLLs/");
>> > System.setProperty("jna.library.path", libURL.getPath());
>> >
>> > And then declare the following interface
>> >
>> > public interface CurviLibrary extends Library {
>> > CurviLibrary CurviInitialization = (CurviLibrary)
>> > Native.loadLibrary("Curvi",CurviLibrary.class);
>> > CurviLibrary OptimizedSolver = (CurviLibrary)
>> > Native.loadLibrary("OptimizedSolver",CurviLibrary.class);
>> > DoubleByReference GIT_CURVIG(float[] timeData, float[] rawData, float[]
>> > relax, int rawDataSize, double alphaValue,
>> > long numberOfBins);
>> >

Re: Incorporating DLL's into Maven Project.

2008-06-17 Thread Mikel Cármenes Cavia
I will give those steps a shot today and let you all know if I run into any
problems. It sounds like a pretty logical thing to do actually, and
fortunately I do not require cross-platform compilation and support at this
point.
One quick question though, when you say that I should use the dependency
plugin to copy the DLL's to the target directory or other suitable location,
could I specify that the DLL's be put inside the jar? (that is, in the
resources folder).

Thanks!

On Mon, Jun 16, 2008 at 15:37, Kalle Korhonen <[EMAIL PROTECTED]>
wrote:

> If you don't need to worry about cross-platform compilation & support (and
> sounds like you don't), the most straight-forwarded way to do this is to
> deploy your dll to a Maven repository with type "dll", declare a
> straight-up
> dependency to it in your pom and then use the dependency plugin to copy the
> lib to the target dir or other suitable location for development
> environment
> and structure you assembly (or whatever is the format of the actual
> delivery) similarly. If cross-platform support is desired, nar plugin (
> http://java.freehep.org/freehep-nar-plugin/intro.html) is a bit more
> involving but simplifies things greatly. However, using it requires some
> code changes.
>
> Kalle
>
>
> On Mon, Jun 16, 2008 at 11:19 AM, Mikel Cármenes Cavia <[EMAIL PROTECTED]>
> wrote:
>
> > Hey guys,
> > I need to include three DLL's in my Maven project. Prior to deciding to
> > email the list, I have looked around the archives, and haven't been able
> to
> > find anything that would seem to answer my problem (which is a very easy
> > one
> > in nature).
> >
> > I use JNA to interface with two of the three DLL's (the third one is for
> > Jacob, and its location needs to be set as a system variable).
> >
> > In Java, I do the following:
> >
> > URL libURL = this.getClass().getResource("/org/git/systems/DLLs/");
> > System.setProperty("jna.library.path", libURL.getPath());
> >
> > And then declare the following interface
> >
> > public interface CurviLibrary extends Library {
> > CurviLibrary CurviInitialization = (CurviLibrary)
> > Native.loadLibrary("Curvi",CurviLibrary.class);
> > CurviLibrary OptimizedSolver = (CurviLibrary)
> > Native.loadLibrary("OptimizedSolver",CurviLibrary.class);
> > DoubleByReference GIT_CURVIG(float[] timeData, float[] rawData, float[]
> > relax, int rawDataSize, double alphaValue,
> > long numberOfBins);
> > }
> >
> > So when compiled via Eclipse, this works like a charm. I have tried
> placing
> > the DLL's within /main/resources/org/git/systems/DLLs but this does not
> > seem
> > to work, as the jar looks in
> >
> >
> file:/C:/DEV/Maven/GITSYSTEMS/target/GITSYSTEMS-1.0-jar-with-dependencies.jar!/org/git/systems/DLLs/
> > which would make sense, if only a jar wasn't a package.
> >
> > How may I go about adding these DLLs to my Maven project, without having
> to
> > modify the existing Java code?
> >
> > I am assuming they will have to go outside of the jar, but I am unsure as
> > to
> > how to reference and go from there.
> >
> > Thanks guys!
> >
>


Incorporating DLL's into Maven Project.

2008-06-16 Thread Mikel Cármenes Cavia
Hey guys,
I need to include three DLL's in my Maven project. Prior to deciding to
email the list, I have looked around the archives, and haven't been able to
find anything that would seem to answer my problem (which is a very easy one
in nature).

I use JNA to interface with two of the three DLL's (the third one is for
Jacob, and its location needs to be set as a system variable).

In Java, I do the following:

URL libURL = this.getClass().getResource("/org/git/systems/DLLs/");
System.setProperty("jna.library.path", libURL.getPath());

And then declare the following interface

public interface CurviLibrary extends Library {
CurviLibrary CurviInitialization = (CurviLibrary)
Native.loadLibrary("Curvi",CurviLibrary.class);
CurviLibrary OptimizedSolver = (CurviLibrary)
Native.loadLibrary("OptimizedSolver",CurviLibrary.class);
DoubleByReference GIT_CURVIG(float[] timeData, float[] rawData, float[]
relax, int rawDataSize, double alphaValue,
long numberOfBins);
}

So when compiled via Eclipse, this works like a charm. I have tried placing
the DLL's within /main/resources/org/git/systems/DLLs but this does not seem
to work, as the jar looks in
file:/C:/DEV/Maven/GITSYSTEMS/target/GITSYSTEMS-1.0-jar-with-dependencies.jar!/org/git/systems/DLLs/
which would make sense, if only a jar wasn't a package.

How may I go about adding these DLLs to my Maven project, without having to
modify the existing Java code?

I am assuming they will have to go outside of the jar, but I am unsure as to
how to reference and go from there.

Thanks guys!


Re: CGLIB Enhancement failed.

2008-06-13 Thread Mikel Cármenes Cavia
On a completely different note, I am looking to build a custom build tool
that takes my application from the file system, or from version control, and
based on Maven and launch4j, builds a Windows executable.
Do any of you guys know of a way that I could query mvnrepository.com from
java to get the right pom declarations for each of the dependencies? This is
the only way I can think of to add some dynamism to the whole custom build
process.

Cheers!


On Fri, Jun 13, 2008 at 11:08, Mikel Cármenes Cavia <[EMAIL PROTECTED]>
wrote:

> Thanks so much Simon and Fabio, it's all up and running now!
> Your help is truly appreciated.
>
>
> 2008/6/13 Fabio Braga de Oliveira <[EMAIL PROTECTED]>:
>
>> It's very difficult to guess, but I think the tip is:
>>
>> Caused by: java.lang.ClassNotFoundException:
>> net.sf.cglib.transform.impl.InterceptFieldEnabled
>>
>> Something related yet with Hibernate or cglib or its dependencies... You
>> are building a single jar with all dependencies packaged in it, right? Maybe
>> some dependencies are overwriting classes. Do a test without packaging this
>> way.
>>
>> I added one dependency some time ago, which had a misbehavior of declare a
>> specific version dependency. I needed to add the  element
>> in the dependency declaration to remove the extra library.
>>
>> All the best!
>>
>>
>> Mikel Cármenes Cavia escreveu:
>>
>>  Here is the complete exception, in case this helps:
>>>
>>> C:\DEV\Maven\GITSYSTEMS\target>java -jar
>>> GITSYSTEMS-1.0-jar-with-dependencies.jar
>>> Initial SessionFactory creation failed.java.lang.NoClassDefFoundError
>>> Exception occurred during event dispatching:
>>> java.lang.ExceptionInInitializerError
>>>at
>>> org.git.systems.data.HibernateUtil.(HibernateUtil.java:71)
>>>at org.git.systems.data.dao.UserDAO.validateUser(UserDAO.java:49)
>>>at
>>> org.git.systems.system.UserManager.loginUser(UserManager.java:57)
>>>at
>>> org.git.systems.gui.LoginJDialog.actionPerformed(LoginJDialog.java:174)
>>>at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>>>at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
>>> Source)
>>>at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
>>> Source)
>>>at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>>>at javax.swing.AbstractButton.doClick(Unknown Source)
>>>at
>>> javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(Unknown
>>> Source)
>>>at javax.swing.SwingUtilities.notifyAction(Unknown Source)
>>>at javax.swing.JComponent.processKeyBinding(Unknown Source)
>>>at javax.swing.KeyboardManager.fireBinding(Unknown Source)
>>>at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
>>>at
>>> javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown
>>> Source)
>>>at javax.swing.JComponent.processKeyBindings(Unknown Source)
>>>at javax.swing.JComponent.processKeyEvent(Unknown Source)
>>>at java.awt.Component.processEvent(Unknown Source)
>>>at java.awt.Container.processEvent(Unknown Source)
>>>at java.awt.Component.dispatchEventImpl(Unknown Source)
>>>at java.awt.Container.dispatchEventImpl(Unknown Source)
>>>at java.awt.Component.dispatchEvent(Unknown Source)
>>>at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
>>>at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
>>> Source)
>>>at
>>> java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown
>>> Source)
>>>at
>>> java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown
>>> Source)
>>>at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
>>> Source)
>>>at java.awt.Component.dispatchEventImpl(Unknown Source)
>>>at java.awt.Container.dispatchEventImpl(Unknown Source)
>>>at java.awt.Window.dispatchEventImpl(Unknown Source)
>>>at java.awt.Component.dispatchEvent(Unknown Source)
>>>at java.awt.EventQueue.dispatchEvent(Unknown Source)
>>>at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
>>> Source)
>>>at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
>>> Source)
>>>at java.awt.EventDispat

Re: CGLIB Enhancement failed.

2008-06-13 Thread Mikel Cármenes Cavia
Thanks so much Simon and Fabio, it's all up and running now!
Your help is truly appreciated.


2008/6/13 Fabio Braga de Oliveira <[EMAIL PROTECTED]>:

> It's very difficult to guess, but I think the tip is:
>
> Caused by: java.lang.ClassNotFoundException:
> net.sf.cglib.transform.impl.InterceptFieldEnabled
>
> Something related yet with Hibernate or cglib or its dependencies... You
> are building a single jar with all dependencies packaged in it, right? Maybe
> some dependencies are overwriting classes. Do a test without packaging this
> way.
>
> I added one dependency some time ago, which had a misbehavior of declare a
> specific version dependency. I needed to add the  element
> in the dependency declaration to remove the extra library.
>
> All the best!
>
>
> Mikel Cármenes Cavia escreveu:
>
>  Here is the complete exception, in case this helps:
>>
>> C:\DEV\Maven\GITSYSTEMS\target>java -jar
>> GITSYSTEMS-1.0-jar-with-dependencies.jar
>> Initial SessionFactory creation failed.java.lang.NoClassDefFoundError
>> Exception occurred during event dispatching:
>> java.lang.ExceptionInInitializerError
>>at
>> org.git.systems.data.HibernateUtil.(HibernateUtil.java:71)
>>at org.git.systems.data.dao.UserDAO.validateUser(UserDAO.java:49)
>>at
>> org.git.systems.system.UserManager.loginUser(UserManager.java:57)
>>at
>> org.git.systems.gui.LoginJDialog.actionPerformed(LoginJDialog.java:174)
>>at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>>at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
>> Source)
>>at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
>> Source)
>>at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>>at javax.swing.AbstractButton.doClick(Unknown Source)
>>at
>> javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(Unknown
>> Source)
>>at javax.swing.SwingUtilities.notifyAction(Unknown Source)
>>at javax.swing.JComponent.processKeyBinding(Unknown Source)
>>at javax.swing.KeyboardManager.fireBinding(Unknown Source)
>>at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
>>at
>> javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown
>> Source)
>>at javax.swing.JComponent.processKeyBindings(Unknown Source)
>>at javax.swing.JComponent.processKeyEvent(Unknown Source)
>>at java.awt.Component.processEvent(Unknown Source)
>>at java.awt.Container.processEvent(Unknown Source)
>>at java.awt.Component.dispatchEventImpl(Unknown Source)
>>at java.awt.Container.dispatchEventImpl(Unknown Source)
>>at java.awt.Component.dispatchEvent(Unknown Source)
>>at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
>>at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
>> Source)
>>at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown
>> Source)
>>at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown
>> Source)
>>at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
>> Source)
>>at java.awt.Component.dispatchEventImpl(Unknown Source)
>>at java.awt.Container.dispatchEventImpl(Unknown Source)
>>at java.awt.Window.dispatchEventImpl(Unknown Source)
>>at java.awt.Component.dispatchEvent(Unknown Source)
>>at java.awt.EventQueue.dispatchEvent(Unknown Source)
>>at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
>> Source)
>>at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
>>at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
>>at java.awt.Dialog$1.run(Unknown Source)
>>at java.awt.Dialog$3.run(Unknown Source)
>>at java.security.AccessController.doPrivileged(Native Method)
>>at java.awt.Dialog.show(Unknown Source)
>>at java.awt.Component.show(Unknown Source)
>>at java.awt.Component.setVisible(Unknown Source)
>>at java.awt.Window.setVisible(Unknown Source)
>>at java.awt.Dialog.setVisible(Unknown Source)
>>at org.git.systems.gui.LoginJDialog.(LoginJDialog.java:44)
>>at
>>
>> org.git.systems.gui.mainwindow.GITCAPMainJFrame.(GITCAPMainJFrame.java:63)
>>at org.git.systems.GITCap$1.run(GITCap.java:61)
>>at java.awt.event.InvocationEvent.dispatch(Unknown Source)
>>at java.awt.

Re: CGLIB Enhancement failed.

2008-06-13 Thread Mikel Cármenes Cavia
 at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
... 61 more


Thanks!

On Fri, Jun 13, 2008 at 10:18, Mikel Cármenes Cavia <[EMAIL PROTECTED]>
wrote:

> Thanks Fabio, I should have realized that I was adding cglib twice, since
> Hibernate adds it already as a transitive dependency. So I have removed
> cglib from my pom, but now I get an event dispatching error when the session
> factory is built.
> This is the code where the problem resides:
>
> ...
> .addClass(org.git.systems.data.SampleState.class);
>  sessionFactory = cfg.buildSessionFactory();
>   } catch (Throwable ex) {
>  // Make sure you log the exception, as it might be swallowed
> System.err.println("Initial SessionFactory creation failed. " +
> ex);
> throw new ExceptionInInitializerError(ex);
> }
>
> And this is the exception:
>
> Initial SessionFactory creation failed. java.lang.NoClassDefFoundError
> Exception occurred during event dispatching:
> java.lang.ExceptionInInitializerError
> at org.git.systems.data.HibernateUtil.(HibernateUtil.java:71)
>
> It seems like Hibernate is looking for something it can't find, and I'm
> totally clueless as to what that might be...
>
> Mikel
>
> 2008/6/13 Fabio Braga de Oliveira <[EMAIL PROTECTED]>:
>
> Hi Mikel,
>>
>> This happened to me when 2 different cglib versions where added to the
>> build. Look for a library adding the cglib as a transitive dependency, and
>> exclude the oldest one.
>>
>> Good luck!
>>
>>
>> Mikel Cármenes Cavia escreveu:
>>
>>  Hey guys,
>>> Does anybody know what the following error might be caused by?
>>>
>>> 09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement failed:
>>> org.git.systems.data.PcCalc
>>> java.lang.NoClassDefFoundError: Could not initialize class
>>> net.sf.cglib.proxy.Enhancer
>>>
>>> I've made sure that cglib is correctly added, and its .jar is indeed
>>> there
>>> when I check. This error has to do with Hibernate not being able to
>>> access
>>> this resource, thus it cannot execute sessionFactory =
>>> cfg.buildSessionFactory(); and communicate with the database.
>>>
>>> I can't think of anything as far as Maven goes that could be going wrong,
>>> since compiling and packaging works fine, I only get messages after the
>>> login panel of my application (that is, I try to log in and when it
>>> connects
>>> to the database to check my info, I get these errors).
>>>
>>> All errors whine about the same CGLIB Enhancement failing, so I'm
>>> guessing
>>> that every single class that requires Hibernate is throwing these
>>> exceptions.
>>>
>>> Any clues as to why this may be happening? Has anyone else ever had any
>>> issues with cglib?
>>>
>>> Thanks!
>>>
>>>
>>
>> --
>> Fabio Braga de Oliveira
>> Gerente de Projetos de Software
>> Work:   +55 19 3295-2111
>> Mobile: +55 19 9270-6574
>> E-mail: [EMAIL PROTECTED]
>>
>> Símula Sistemas de Planejamento e Comércio Ltda.
>> Url: http://www.simula.com.br
>> Address: Av. José Bonifácio, 2510
>> Zipcode 13093-240
>> Campinas - SP - Brazil
>>
>>
>>
>


Re: CGLIB Enhancement failed.

2008-06-13 Thread Mikel Cármenes Cavia
Thanks Fabio, I should have realized that I was adding cglib twice, since
Hibernate adds it already as a transitive dependency. So I have removed
cglib from my pom, but now I get an event dispatching error when the session
factory is built.
This is the code where the problem resides:

...
.addClass(org.git.systems.data.SampleState.class);
 sessionFactory = cfg.buildSessionFactory();
 } catch (Throwable ex) {
 // Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed. " + ex);
throw new ExceptionInInitializerError(ex);
}

And this is the exception:

Initial SessionFactory creation failed. java.lang.NoClassDefFoundError
Exception occurred during event dispatching:
java.lang.ExceptionInInitializerError
at org.git.systems.data.HibernateUtil.(HibernateUtil.java:71)

It seems like Hibernate is looking for something it can't find, and I'm
totally clueless as to what that might be...

Mikel

2008/6/13 Fabio Braga de Oliveira <[EMAIL PROTECTED]>:

> Hi Mikel,
>
> This happened to me when 2 different cglib versions where added to the
> build. Look for a library adding the cglib as a transitive dependency, and
> exclude the oldest one.
>
> Good luck!
>
>
> Mikel Cármenes Cavia escreveu:
>
>  Hey guys,
>> Does anybody know what the following error might be caused by?
>>
>> 09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement failed:
>> org.git.systems.data.PcCalc
>> java.lang.NoClassDefFoundError: Could not initialize class
>> net.sf.cglib.proxy.Enhancer
>>
>> I've made sure that cglib is correctly added, and its .jar is indeed there
>> when I check. This error has to do with Hibernate not being able to access
>> this resource, thus it cannot execute sessionFactory =
>> cfg.buildSessionFactory(); and communicate with the database.
>>
>> I can't think of anything as far as Maven goes that could be going wrong,
>> since compiling and packaging works fine, I only get messages after the
>> login panel of my application (that is, I try to log in and when it
>> connects
>> to the database to check my info, I get these errors).
>>
>> All errors whine about the same CGLIB Enhancement failing, so I'm guessing
>> that every single class that requires Hibernate is throwing these
>> exceptions.
>>
>> Any clues as to why this may be happening? Has anyone else ever had any
>> issues with cglib?
>>
>> Thanks!
>>
>>
>
> --
> Fabio Braga de Oliveira
> Gerente de Projetos de Software
> Work:   +55 19 3295-2111
> Mobile: +55 19 9270-6574
> E-mail: [EMAIL PROTECTED]
>
> Símula Sistemas de Planejamento e Comércio Ltda.
> Url: http://www.simula.com.br
> Address: Av. José Bonifácio, 2510
> Zipcode 13093-240
> Campinas - SP - Brazil
>
>
>


CGLIB Enhancement failed.

2008-06-13 Thread Mikel Cármenes Cavia
Hey guys,
Does anybody know what the following error might be caused by?

09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement failed:
org.git.systems.data.PcCalc
java.lang.NoClassDefFoundError: Could not initialize class
net.sf.cglib.proxy.Enhancer

I've made sure that cglib is correctly added, and its .jar is indeed there
when I check. This error has to do with Hibernate not being able to access
this resource, thus it cannot execute sessionFactory =
cfg.buildSessionFactory(); and communicate with the database.

I can't think of anything as far as Maven goes that could be going wrong,
since compiling and packaging works fine, I only get messages after the
login panel of my application (that is, I try to log in and when it connects
to the database to check my info, I get these errors).

All errors whine about the same CGLIB Enhancement failing, so I'm guessing
that every single class that requires Hibernate is throwing these
exceptions.

Any clues as to why this may be happening? Has anyone else ever had any
issues with cglib?

Thanks!


Resources not being added correctly.

2008-06-12 Thread Mikel Cármenes Cavia
 I am fairly new to Maven, and after a few days of playing around with it
and reading two pretty lengthy PDF's, I have managed to get it all to work
and create a nice jar file for my application, with all its dependencies.

However, I am having severe problems with adding resources, such that these
are packaged in the jar. For example, I have a gui/images folder that I'd
like included, so Java can find some image files when it looks in
org.git.systems.gui.images (that would be the actual path in the code). I
guess I'm just confused as to how to get Maven to include these sources (I
also don't really understand what is meant by not filtering resources...).

I thought that creating a new folder /src/main/resources was enough, and
that putting my resources there would suffice, but this does not seem to be
the case. I have tried placing the resources there, packaging the file, and
when I depackage the archive, my resources are nowhere to be found.

Thanks so much in advance, I can't wait to get this all working!

Mikel