Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 21686 invoked from network); 6 Feb 2011 22:43:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Feb 2011 22:43:52 -0000 Received: (qmail 17391 invoked by uid 500); 6 Feb 2011 22:43:52 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 17296 invoked by uid 500); 6 Feb 2011 22:43:51 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 17288 invoked by uid 99); 6 Feb 2011 22:43:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Feb 2011 22:43:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Feb 2011 22:43:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id A5872196EA3 for ; Sun, 6 Feb 2011 22:43:30 +0000 (UTC) Date: Sun, 6 Feb 2011 22:43:30 +0000 (UTC) From: "Dyblast (JIRA)" To: dev@felix.apache.org Message-ID: <1513537724.3019.1297032210659.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1991412534.2234.1296953790604.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Issue Comment Edited: (FELIX-2825) maven-ipojo-plugin & WAR MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991227#comment-12991227 ] Dyblast edited comment on FELIX-2825 at 2/6/11 10:42 PM: --------------------------------------------------------- I have found the issue... the class is correctly generated but it never inject into the final war... Indeed Pojoization.java:382 // If the class was manipulated, write out the manipulated // version of the bytecode if (m_classes.containsKey(curEntry.getName())) { JarEntry je = new JarEntry(curEntry.getName()); byte[] outClazz = (byte[]) m_classes.get(curEntry.getName()); if (outClazz != null && outClazz.length != 0) { jos.putNextEntry(je); // copy the entry header to jos jos.write(outClazz); So the program check if there is a class corresponding to a directory entry ... for example m_classes = {com/truc/blabla.class} and curEntry = WEB-INF/classes/com/truc/blabla.class So the orignal class is copied and not replaced. Small ugly fix: if (m_classes.containsKey(curEntry.getName()) || m_classes.containsKey(curEntry.getName().replace("WEB-INF/classes/",""))) { was (Author: dyblast): I have found the issue... the class is correctly generated but it never inject into the final war... Indeed Pojoization.java:382 // If the class was manipulated, write out the manipulated // version of the bytecode if (m_classes.containsKey(curEntry.getName())) { JarEntry je = new JarEntry(curEntry.getName()); byte[] outClazz = (byte[]) m_classes.get(curEntry.getName()); if (outClazz != null && outClazz.length != 0) { jos.putNextEntry(je); // copy the entry header to jos jos.write(outClazz); So the program check if there is a class corresponding to a directory entry ... for example m_classes = {com/truc/blabla.class} and curEntry = WEB-INF/classes/com/truc/blabla.class So the orignal class is copied and not replaced. Small ugly fix: if (m_classes.containsKey(curEntry.getName()) || m_classes.containsKey("WEB-INF/classes/" + curEntry.getName())) { > maven-ipojo-plugin & WAR > ------------------------ > > Key: FELIX-2825 > URL: https://issues.apache.org/jira/browse/FELIX-2825 > Project: Felix > Issue Type: Bug > Components: iPOJO > Affects Versions: iPOJO-1.8.0 > Environment: Jetty, Windows > Reporter: Dyblast > > HI, > I have notice a problem with the maven-ipojo-plugin on war package. > The resulting classes are incorrect. > Indeed when i create a war i have this error when i deploy it: > createInstance -> Cannot invoke the constructor (method not found) : > Now if i create a bundle instead, i take the classes from it and i put it in the former war, the war works > my plugins part of maven: > ------------------------------------------------- > > > maven-war-plugin > > > ${project.build.outputDirectory}/META-INF/MANIFEST.MF > > > > > org.apache.felix > maven-bundle-plugin > 1.4.3 > true > > > bundle-manifest > process-classes > > manifest > > > > > ., > WEB-INF/classes > > WEB-INF/lib > *;scope=compile|runtime > true > webapp > webapp > > > > > > > jar > bundle > war > > > > > org.apache.felix > maven-ipojo-plugin > 1.8.0 > > > > ipojo-bundle > > > > > > ------------------------------------------------------------- -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira