You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Dyblast (JIRA)" <ji...@apache.org> on 2011/02/06 01:56:30 UTC

[jira] Created: (FELIX-2825) maven-ipojo-plugin & WAR

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:
-------------------------------------------------
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>1.4.3</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                        <configuration>
                            <instructions>
                                <Bundle-ClassPath>
                                    .,
                                    WEB-INF/classes
                                </Bundle-ClassPath>
                                <Embed-Directory>WEB-INF/lib</Embed-Directory>
                                <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                                <Embed-Transitive>true</Embed-Transitive>
                                <Web-ContextPath>webapp</Web-ContextPath>
                                <Webapp-Context>webapp</Webapp-Context>
                            </instructions>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <supportedProjectTypes>
                        <supportedProjectType>jar</supportedProjectType>
                        <supportedProjectType>bundle</supportedProjectType>
                        <supportedProjectType>war</supportedProjectType>
                    </supportedProjectTypes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-ipojo-plugin</artifactId>
                <version>1.8.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>ipojo-bundle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
-------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (FELIX-2825) maven-ipojo-plugin & WAR

Posted by "Dyblast (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991227#comment-12991227 ] 

Dyblast commented on FELIX-2825:
--------------------------------

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.


> 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:
> -------------------------------------------------
>         <plugins>
>             <plugin>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>                     </archive>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <id>bundle-manifest</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>manifest</goal>
>                         </goals>
>                         <configuration>
>                             <instructions>
>                                 <Bundle-ClassPath>
>                                     .,
>                                     WEB-INF/classes
>                                 </Bundle-ClassPath>
>                                 <Embed-Directory>WEB-INF/lib</Embed-Directory>
>                                 <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                 <Embed-Transitive>true</Embed-Transitive>
>                                 <Web-ContextPath>webapp</Web-ContextPath>
>                                 <Webapp-Context>webapp</Webapp-Context>
>                             </instructions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <supportedProjectTypes>
>                         <supportedProjectType>jar</supportedProjectType>
>                         <supportedProjectType>bundle</supportedProjectType>
>                         <supportedProjectType>war</supportedProjectType>
>                     </supportedProjectTypes>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-ipojo-plugin</artifactId>
>                 <version>1.8.0</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>ipojo-bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
> -------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-2825) The maven-ipojo-plugin does not replace component classes in WAR files

Posted by "Guillaume Sauthier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178707#comment-13178707 ] 

Guillaume Sauthier commented on FELIX-2825:
-------------------------------------------

As you already have the source code of the manipulator, maybe you could add a simple WABResourceMapperTestCase (if not already existing) that reproduce the problem.

                
> The maven-ipojo-plugin does not replace component classes in WAR files
> ----------------------------------------------------------------------
>
>                 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
>            Assignee: Clement Escoffier
>             Fix For: ipojo-manipulator-1.8.2
>
>
> 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:
> -------------------------------------------------
>         <plugins>
>             <plugin>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>                     </archive>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <id>bundle-manifest</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>manifest</goal>
>                         </goals>
>                         <configuration>
>                             <instructions>
>                                 <Bundle-ClassPath>
>                                     .,
>                                     WEB-INF/classes
>                                 </Bundle-ClassPath>
>                                 <Embed-Directory>WEB-INF/lib</Embed-Directory>
>                                 <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                 <Embed-Transitive>true</Embed-Transitive>
>                                 <Web-ContextPath>webapp</Web-ContextPath>
>                                 <Webapp-Context>webapp</Webapp-Context>
>                             </instructions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <supportedProjectTypes>
>                         <supportedProjectType>jar</supportedProjectType>
>                         <supportedProjectType>bundle</supportedProjectType>
>                         <supportedProjectType>war</supportedProjectType>
>                     </supportedProjectTypes>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-ipojo-plugin</artifactId>
>                 <version>1.8.0</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>ipojo-bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
> -------------------------------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (FELIX-2825) The maven-ipojo-plugin does not replace component classes in WAR files

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier updated FELIX-2825:
-------------------------------------

    Summary: The maven-ipojo-plugin does not replace component classes in WAR files  (was: maven-ipojo-plugin & WAR)

> The maven-ipojo-plugin does not replace component classes in WAR files
> ----------------------------------------------------------------------
>
>                 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
>             Fix For: ipojo-manipulator-1.8.2
>
>
> 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:
> -------------------------------------------------
>         <plugins>
>             <plugin>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>                     </archive>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <id>bundle-manifest</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>manifest</goal>
>                         </goals>
>                         <configuration>
>                             <instructions>
>                                 <Bundle-ClassPath>
>                                     .,
>                                     WEB-INF/classes
>                                 </Bundle-ClassPath>
>                                 <Embed-Directory>WEB-INF/lib</Embed-Directory>
>                                 <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                 <Embed-Transitive>true</Embed-Transitive>
>                                 <Web-ContextPath>webapp</Web-ContextPath>
>                                 <Webapp-Context>webapp</Webapp-Context>
>                             </instructions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <supportedProjectTypes>
>                         <supportedProjectType>jar</supportedProjectType>
>                         <supportedProjectType>bundle</supportedProjectType>
>                         <supportedProjectType>war</supportedProjectType>
>                     </supportedProjectTypes>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-ipojo-plugin</artifactId>
>                 <version>1.8.0</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>ipojo-bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
> -------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (FELIX-2825) The maven-ipojo-plugin does not replace component classes in WAR files

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier resolved FELIX-2825.
--------------------------------------

    Resolution: Fixed
      Assignee: Clement Escoffier

> The maven-ipojo-plugin does not replace component classes in WAR files
> ----------------------------------------------------------------------
>
>                 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
>            Assignee: Clement Escoffier
>             Fix For: ipojo-manipulator-1.8.2
>
>
> 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:
> -------------------------------------------------
>         <plugins>
>             <plugin>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>                     </archive>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <id>bundle-manifest</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>manifest</goal>
>                         </goals>
>                         <configuration>
>                             <instructions>
>                                 <Bundle-ClassPath>
>                                     .,
>                                     WEB-INF/classes
>                                 </Bundle-ClassPath>
>                                 <Embed-Directory>WEB-INF/lib</Embed-Directory>
>                                 <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                 <Embed-Transitive>true</Embed-Transitive>
>                                 <Web-ContextPath>webapp</Web-ContextPath>
>                                 <Webapp-Context>webapp</Webapp-Context>
>                             </instructions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <supportedProjectTypes>
>                         <supportedProjectType>jar</supportedProjectType>
>                         <supportedProjectType>bundle</supportedProjectType>
>                         <supportedProjectType>war</supportedProjectType>
>                     </supportedProjectTypes>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-ipojo-plugin</artifactId>
>                 <version>1.8.0</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>ipojo-bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
> -------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (FELIX-2825) maven-ipojo-plugin & WAR

Posted by "Dyblast (JIRA)" <ji...@apache.org>.
    [ 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:09 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("WEB-INF/classes/" + curEntry.getName())) {

      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.

  
> 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:
> -------------------------------------------------
>         <plugins>
>             <plugin>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>                     </archive>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <id>bundle-manifest</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>manifest</goal>
>                         </goals>
>                         <configuration>
>                             <instructions>
>                                 <Bundle-ClassPath>
>                                     .,
>                                     WEB-INF/classes
>                                 </Bundle-ClassPath>
>                                 <Embed-Directory>WEB-INF/lib</Embed-Directory>
>                                 <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                 <Embed-Transitive>true</Embed-Transitive>
>                                 <Web-ContextPath>webapp</Web-ContextPath>
>                                 <Webapp-Context>webapp</Webapp-Context>
>                             </instructions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <supportedProjectTypes>
>                         <supportedProjectType>jar</supportedProjectType>
>                         <supportedProjectType>bundle</supportedProjectType>
>                         <supportedProjectType>war</supportedProjectType>
>                     </supportedProjectTypes>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-ipojo-plugin</artifactId>
>                 <version>1.8.0</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>ipojo-bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
> -------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (FELIX-2825) maven-ipojo-plugin & WAR

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier updated FELIX-2825:
-------------------------------------

    Fix Version/s: ipojo-manipulator-1.8.2

> 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
>             Fix For: ipojo-manipulator-1.8.2
>
>
> 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:
> -------------------------------------------------
>         <plugins>
>             <plugin>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>                     </archive>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <id>bundle-manifest</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>manifest</goal>
>                         </goals>
>                         <configuration>
>                             <instructions>
>                                 <Bundle-ClassPath>
>                                     .,
>                                     WEB-INF/classes
>                                 </Bundle-ClassPath>
>                                 <Embed-Directory>WEB-INF/lib</Embed-Directory>
>                                 <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                 <Embed-Transitive>true</Embed-Transitive>
>                                 <Web-ContextPath>webapp</Web-ContextPath>
>                                 <Webapp-Context>webapp</Webapp-Context>
>                             </instructions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <supportedProjectTypes>
>                         <supportedProjectType>jar</supportedProjectType>
>                         <supportedProjectType>bundle</supportedProjectType>
>                         <supportedProjectType>war</supportedProjectType>
>                     </supportedProjectTypes>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-ipojo-plugin</artifactId>
>                 <version>1.8.0</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>ipojo-bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
> -------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (FELIX-2825) The maven-ipojo-plugin does not replace component classes in WAR files

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991422#comment-12991422 ] 

Clement Escoffier commented on FELIX-2825:
------------------------------------------

Fixed in trunk.

I've modified your patch a bit, please check with the manipulator and the maven-ipojo-plugin from the trunk (1.9.0-SNAPSHOT).

Thanks

> The maven-ipojo-plugin does not replace component classes in WAR files
> ----------------------------------------------------------------------
>
>                 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
>            Assignee: Clement Escoffier
>             Fix For: ipojo-manipulator-1.8.2
>
>
> 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:
> -------------------------------------------------
>         <plugins>
>             <plugin>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>                     </archive>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <id>bundle-manifest</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>manifest</goal>
>                         </goals>
>                         <configuration>
>                             <instructions>
>                                 <Bundle-ClassPath>
>                                     .,
>                                     WEB-INF/classes
>                                 </Bundle-ClassPath>
>                                 <Embed-Directory>WEB-INF/lib</Embed-Directory>
>                                 <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                 <Embed-Transitive>true</Embed-Transitive>
>                                 <Web-ContextPath>webapp</Web-ContextPath>
>                                 <Webapp-Context>webapp</Webapp-Context>
>                             </instructions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <supportedProjectTypes>
>                         <supportedProjectType>jar</supportedProjectType>
>                         <supportedProjectType>bundle</supportedProjectType>
>                         <supportedProjectType>war</supportedProjectType>
>                     </supportedProjectTypes>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-ipojo-plugin</artifactId>
>                 <version>1.8.0</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>ipojo-bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
> -------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-2825) The maven-ipojo-plugin does not replace component classes in WAR files

Posted by "Bob Ziuchkovski (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178088#comment-13178088 ] 

Bob Ziuchkovski commented on FELIX-2825:
----------------------------------------

I have run into the same problem.  I checked-out and built the ipojo trunk to test this fix.  Unfortunately, it looks like the code in the externalize() method of src/main/java/org/apache/felix/ipojo/manipulator/store/mapper/WABResourceMapper.java fails via throwing IllegalArgumentException when it encounters any non-class file, such as META-INF/MANIFEST.MF.  If desired, I can craft and upload a simple test maven war project to reproduce the issue.
                
> The maven-ipojo-plugin does not replace component classes in WAR files
> ----------------------------------------------------------------------
>
>                 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
>            Assignee: Clement Escoffier
>             Fix For: ipojo-manipulator-1.8.2
>
>
> 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:
> -------------------------------------------------
>         <plugins>
>             <plugin>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>                     </archive>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <id>bundle-manifest</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>manifest</goal>
>                         </goals>
>                         <configuration>
>                             <instructions>
>                                 <Bundle-ClassPath>
>                                     .,
>                                     WEB-INF/classes
>                                 </Bundle-ClassPath>
>                                 <Embed-Directory>WEB-INF/lib</Embed-Directory>
>                                 <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                 <Embed-Transitive>true</Embed-Transitive>
>                                 <Web-ContextPath>webapp</Web-ContextPath>
>                                 <Webapp-Context>webapp</Webapp-Context>
>                             </instructions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <supportedProjectTypes>
>                         <supportedProjectType>jar</supportedProjectType>
>                         <supportedProjectType>bundle</supportedProjectType>
>                         <supportedProjectType>war</supportedProjectType>
>                     </supportedProjectTypes>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-ipojo-plugin</artifactId>
>                 <version>1.8.0</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>ipojo-bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
> -------------------------------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (FELIX-2825) maven-ipojo-plugin & WAR

Posted by "Dyblast (JIRA)" <ji...@apache.org>.
    [ 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:
> -------------------------------------------------
>         <plugins>
>             <plugin>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>                     </archive>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <id>bundle-manifest</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>manifest</goal>
>                         </goals>
>                         <configuration>
>                             <instructions>
>                                 <Bundle-ClassPath>
>                                     .,
>                                     WEB-INF/classes
>                                 </Bundle-ClassPath>
>                                 <Embed-Directory>WEB-INF/lib</Embed-Directory>
>                                 <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                 <Embed-Transitive>true</Embed-Transitive>
>                                 <Web-ContextPath>webapp</Web-ContextPath>
>                                 <Webapp-Context>webapp</Webapp-Context>
>                             </instructions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <supportedProjectTypes>
>                         <supportedProjectType>jar</supportedProjectType>
>                         <supportedProjectType>bundle</supportedProjectType>
>                         <supportedProjectType>war</supportedProjectType>
>                     </supportedProjectTypes>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-ipojo-plugin</artifactId>
>                 <version>1.8.0</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>ipojo-bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
> -------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (FELIX-2825) maven-ipojo-plugin & WAR

Posted by "Dyblast (JIRA)" <ji...@apache.org>.
    [ 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:46 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: 
                String classEntry = curEntry.getName().replace("WEB-INF/classes/","");
                if (m_classes.containsKey(classEntry)) {
                    JarEntry je = new JarEntry(curEntry.getName());
                    byte[] outClazz = (byte[]) m_classes.get(classEntry);

      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(curEntry.getName().replace("WEB-INF/classes/",""))) {
  
> 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:
> -------------------------------------------------
>         <plugins>
>             <plugin>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>                     </archive>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <id>bundle-manifest</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>manifest</goal>
>                         </goals>
>                         <configuration>
>                             <instructions>
>                                 <Bundle-ClassPath>
>                                     .,
>                                     WEB-INF/classes
>                                 </Bundle-ClassPath>
>                                 <Embed-Directory>WEB-INF/lib</Embed-Directory>
>                                 <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                 <Embed-Transitive>true</Embed-Transitive>
>                                 <Web-ContextPath>webapp</Web-ContextPath>
>                                 <Webapp-Context>webapp</Webapp-Context>
>                             </instructions>
>                         </configuration>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <supportedProjectTypes>
>                         <supportedProjectType>jar</supportedProjectType>
>                         <supportedProjectType>bundle</supportedProjectType>
>                         <supportedProjectType>war</supportedProjectType>
>                     </supportedProjectTypes>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-ipojo-plugin</artifactId>
>                 <version>1.8.0</version>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>ipojo-bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
> -------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira