How to create a JNLP file without version.xml using webstart-maven-plugin
Hi list! I'm using the webstart-maven-plugin, building a war file using the jnlp-download-servlet goal, and everything works fine until now. But I'm doing some RMI stuff, and I need the java.rmi.server.codebase property correctly set. Doing some debug, I found that the codebase is being set to the href attribute of the .jnlp file, what make sense, of course, and is exactly what I need. But the webstart plugin is generating the version.xml file, what is perfectly fine, but this removes the version info form the jar href. Finally, someone knows how to generate the .jnlp without generating the version.xml, putting the version info in the href attribute? 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 begin:vcard fn:Fabio Oliveira n:Oliveira;Fabio org;quoted-printable:S=C3=ADmula Sistemas de Planejamento e Com=C3=A9rcio Ltda. adr;quoted-printable:;;Av. Jos=C3=A9 Bonif=C3=A1cio, 2510;Campinas;SP;13093-240;Brazil email;internet:[EMAIL PROTECTED] title:Gerente de Projetos de Software tel;work:+55 19 3295-2111 tel;cell:+55 19 9270-6574 x-mozilla-html:FALSE url:http://www.simula.com.br version:2.1 end:vcard smime.p7s Description: S/MIME Cryptographic Signature
Re: Deployable archive including libs
A maven project has a default directory structure. Put your hibernate.cfg.xml in the src/main/resources directory, and it will be copied in the WEB-INF/classes, and probably will work. sourcex escreveu: Unfortunately, a new issue just popped up about the same topic - my hibernate project has been included in my WAR but without hibernate.cfg.xml and the other XML files. Only classes has been inserted. How could I import the other configuration files like .xml, .log, .txt etc? -- 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 begin:vcard fn:Fabio Oliveira n:Oliveira;Fabio org;quoted-printable:S=C3=ADmula Sistemas de Planejamento e Com=C3=A9rcio Ltda. adr;quoted-printable:;;Av. Jos=C3=A9 Bonif=C3=A1cio, 2510;Campinas;SP;13093-240;Brazil email;internet:[EMAIL PROTECTED] title:Gerente de Projetos de Software tel;work:+55 19 3295-2111 tel;cell:+55 19 9270-6574 x-mozilla-html:FALSE url:http://www.simula.com.br version:2.1 end:vcard smime.p7s Description: S/MIME Cryptographic Signature
Re: Deployable archive including libs
Hi sourcex, It's incredible easy. In the WAR pom, declare war. Example: http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";> 4.0.0 com.your.company yourArtifact war Web Application Name 1.0-SNAPSHOT http://maven.apache.org com.your.dependency artifact-id version ... All its dependencies will be bundle in a .war file, including your JSE library. I suggest you to read any maven 2 book, there are some free in the web, see: http://maven.apache.org/articles.html Good luck! sourcex escreveu: Hi there, I'm new with Maven and I'm trying to create a .WAR archive to be deployed on a remote server with no Maven installed. I also need that .WAR archive to be bundled with all the libraries that the project uses. There is also a connection between a JSE project and JEE project, so I tried to create a separate .pom file which creates a JAR file from my JSE project, creates a WAR file for my JEE project and includes the first archive (and all other libs) in the .WAR file (as with ant). Well, I didn't succeed with that. Any recommendations? Thanks in advance. -- 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 begin:vcard fn:Fabio Oliveira n:Oliveira;Fabio org;quoted-printable:S=C3=ADmula Sistemas de Planejamento e Com=C3=A9rcio Ltda. adr;quoted-printable:;;Av. Jos=C3=A9 Bonif=C3=A1cio, 2510;Campinas;SP;13093-240;Brazil email;internet:[EMAIL PROTECTED] title:Gerente de Projetos de Software tel;work:+55 19 3295-2111 tel;cell:+55 19 9270-6574 x-mozilla-html:FALSE url:http://www.simula.com.br version:2.1 end:vcard smime.p7s Description: S/MIME Cryptographic Signature
Re: CGLIB Enhancement failed.
ersister.(SingleTableEntityPersister.java:10 8) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:216) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) at org.git.systems.data.HibernateUtil.(HibernateUtil.java:65) ... 53 more Caused by: java.lang.ClassNotFoundException: net.sf.cglib.transform.impl.InterceptFieldEnabled at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) 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 -- 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 begin:vcard fn:Fabio Oliveira n:Oliveira;Fabio org;quoted-printable:S=C3=ADmula Sistemas de Planejamento e Com=C3=A9rcio Ltda. adr;quoted-printable:;;Av. Jos=C3=A9 Bonif=C3=A1cio, 2510;Campinas;SP;13093-240;Brazil email;internet:[EMAIL PROTECTED] title:Gerente de Projetos de Software tel;work:+55 19 3295-2111 tel;cell:+55 19 9270-6574 x-mozilla-html:FALSE url:http://www.simula.com.br version:2.1 end:vcard smime.p7s Description: S/MIME Cryptographic Signature
Re: CGLIB Enhancement failed.
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 begin:vcard fn:Fabio Oliveira n:Oliveira;Fabio org;quoted-printable:S=C3=ADmula Sistemas de Planejamento e Com=C3=A9rcio Ltda. adr;quoted-printable:;;Av. Jos=C3=A9 Bonif=C3=A1cio, 2510;Campinas;SP;13093-240;Brazil email;internet:[EMAIL PROTECTED] title:Gerente de Projetos de Software tel;work:+55 19 3295-2111 tel;cell:+55 19 9270-6574 x-mozilla-html:FALSE url:http://www.simula.com.br version:2.1 end:vcard smime.p7s Description: S/MIME Cryptographic Signature
Re: Signing dependencies during a war build
Hi Jerome, I wrote both the jar:sign and webstart mojos and I am not aware of an off the shelf war-with-signed-dependencies solution. If you find one, or end up creating yours, please let us know :) Jerome I want to thank you for your excellent work. Without your help my work will be very difficult, maybe impossible. I never did a maven plugin, maybe it's the time to start, can give me some advices on how to start? A good candidate solution (I think...) is to use the assembly plugin. I already did a .jar file where all the dependencies are unzipped in a single .jar and then this one was signed. Again, tips? 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 begin:vcard fn:Fabio Oliveira n:Oliveira;Fabio org;quoted-printable:S=C3=ADmula Sistemas de Planejamento e Com=C3=A9rcio Ltda. adr;quoted-printable:;;Av. Jos=C3=A9 Bonif=C3=A1cio, 2510;Campinas;SP;13093-240;Brazil email;internet:[EMAIL PROTECTED] title:Gerente de Projetos de Software tel;work:+55 19 3295-2111 tel;cell:+55 19 9270-6574 x-mozilla-html:FALSE url:http://www.simula.com.br version:2.1 end:vcard smime.p7s Description: S/MIME Cryptographic Signature
Signing dependencies during a war build
Hi list, I'm developing a 3-tier system, and I want to distribute the desktop using the Java Webstart. Until now, I already did great progresses in my quest. In the server side I'm deploying a web application using Spring, and I publish some services using RMI. In the desktop, I'm using the Netbeans RCP, packaging all the code and libraries using the webstart-maven-plugin. To give the necessary permissions, I'm using the configuration section, signing all the jars with a valid certificate, and everything works well. But now some problems: I'm using hibernate, and the hibernate use the cglib library to do some bytecode manipulations. The code in the client side is signed, and the SecurityManager doesn't allow this unknown, runtime-generated code to run in the desktop. Every time I query the database and try to use one database mapped object, everything blows up. To fix the mess, I did, manually, a war file with the domain libraries, hibernate.jar and cglib.jar signed. And everything worked! But know I want to do automatically. Does someone know how to create a war where each dependency jar file is signed? Something like what the webstart-maven-plugin do while generating the jnlp application. Thanks in advance, and I apologize my English mistakes. -- 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 begin:vcard fn:Fabio Oliveira n:Oliveira;Fabio org;quoted-printable:S=C3=ADmula Sistemas de Planejamento e Com=C3=A9rcio Ltda. adr;quoted-printable:;;Av. Jos=C3=A9 Bonif=C3=A1cio, 2510;Campinas;SP;13093-240;Brazil email;internet:[EMAIL PROTECTED] title:Gerente de Projetos de Software tel;work:+55 19 3295-2111 tel;cell:+55 19 9270-6574 x-mozilla-html:FALSE url:http://www.simula.com.br version:2.1 end:vcard smime.p7s Description: S/MIME Cryptographic Signature