[JBoss JIRA] (SHRINKWRAP-399) Descriptors 2.0 module BeansDescriptor API mixes String and Alternatives<BeansDescriptor>, is hard to use
by Craig Ringer (JIRA)
Craig Ringer created SHRINKWRAP-399:
---------------------------------------
Summary: Descriptors 2.0 module BeansDescriptor API mixes String and Alternatives<BeansDescriptor>, is hard to use
Key: SHRINKWRAP-399
URL: https://issues.jboss.org/browse/SHRINKWRAP-399
Project: ShrinkWrap
Issue Type: Feature Request
Components: ext-descriptors
Affects Versions: 1.0.0
Environment: java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)
Linux ayaki.localdomain 3.3.0-4.fc16.x86_64 #1 SMP Tue Mar 20 18:05:40 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Reporter: Craig Ringer
The API for BeansDescriptor in the Descriptors 2.0 module (org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-impl-javaee:jar:2.0.0-alpha-2) is confusing and hard to use for simple cases. It needs revision.
The distinction between BeansDescriptor.createAlternatives() and BeansDescriptor.getOrCreateAlternatives() isn't clear. Does the former unconditionally replace any existing alternatives entry?
There's no obvious .replace(oldBean, newBean) to swap alternatives. The descriptor needs simple methods for:
- Removing an alternative
- Replacing an alternative
- Adding an alternative
It almost appears that the descriptor module is trying to handle multiple <alternatives/> entries, if that's the purpose of BeansDescriptor.getAllAlternatives(). Weld doesn't permit multiple alternatives, as a test with multiple alternatives entries will show:
org.jboss.weld.exceptions.DefinitionException: WELD-001203 <alternatives> can only be specified once, but appears multiple times: vfs:/content/demo.jar/META-INF/beans.xml@6
... and as far as I can tell the beans.xml xsd backs that up: http://java.sun.com/xml/ns/javaee/beans_1_0.xsd
It doesn't make sense for the descriptors module to produce invalid descriptors; someone testing Weld code, JBoss descriptor loading, etc would use hand-crafted descriptors or descriptors produced using the XML APIs, not something like shrinkwrap descriptors. It really only needs to handle well-formed descriptors and should handle common tasks quickly and easily.
FWIW, I'm not a big fan of ".clazz" either. What does that *mean*? How about ".alternative(...)" or ".addAlternative(...)" or ".alternativeClass(...)" ? The method ".clazz(String)" doesn't tell the reader much.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 10 months
[JBoss JIRA] (SHRINKDESC-119) Create a Builder SPI
by Andrew Rubinger (JIRA)
Andrew Rubinger created SHRINKDESC-119:
------------------------------------------
Summary: Create a Builder SPI
Key: SHRINKDESC-119
URL: https://issues.jboss.org/browse/SHRINKDESC-119
Project: ShrinkWrap Descriptors
Issue Type: Feature Request
Reporter: Andrew Rubinger
Apart from the SWD object model, we could make it much easier to populate the metadata by introducing a "Builder" (name to be discussed) SPI. The purpose here would be a pluggable mechanism to accomplish code like the following:
{code}WebAppDescriptor desc = create(WebAppDescriptor.class)
.add(type(Servlet.class)
.className("com.acme.MyServlet")
.name("MyServletName"))
.add(build(Servlet.class)
.from(MyServlet.class));{code}
Here the WepAppDescriptor gets data added by scanning in annotations observed on the user's MyServlet, relieving the user of supplying the configuration manually.
A more full example is detailed in this Gist contributed by Aslak:
https://gist.github.com/1025597
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (SHRINKWRAP-408) org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-bom:1.0.0-beta-6 specifies scope in dependency management section
by Marek Novotny (JIRA)
Marek Novotny created SHRINKWRAP-408:
----------------------------------------
Summary: org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-bom:1.0.0-beta-6 specifies scope in dependency management section
Key: SHRINKWRAP-408
URL: https://issues.jboss.org/browse/SHRINKWRAP-408
Project: ShrinkWrap
Issue Type: Bug
Affects Versions: 1.0.0-beta-6
Reporter: Marek Novotny
org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-bom:1.0.0-beta-6 specifies scope runtime in dependency management section.
{code:xml}
<dependencies>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>${project.version}</version>
<scope>runtime</scope> <!-- NO REASON WHY TO SPECIFY SCOPE -->
</dependency>
</dependencies>
{code}
BOM generally shouldn't specify scope of managed dependency at all.
Right now Seam2 which uses org.jboss.arquillian:arquillian-bom:1.0.0.Final has got in dependency hierarchy that shrinkwrap-resolver-bom which changes scopes of its dependencies from test to runtime and that causes conflicts in application test war/ear with other libraries which are there in archive for functionality purposes.
One example of affection is this conflict between google-collections from shrinkwrap dependency tree and guava from other runtime dependency hierarchy:
{noformat}
19:30:33,910 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) Critical error during deployment: : java.lang.NoSuchMethodError: com.google.common.base.Platform.precomputeCharMatcher(Lcom/google/common/base/CharMatcher;)Lcom/google/common/base/CharMatcher;
at com.google.common.base.CharMatcher.precomputed(CharMatcher.java:657) [guava-11.0.2.jar:]
at com.google.common.base.CharMatcher.<clinit>(CharMatcher.java:75) [guava-11.0.2.jar:]
at com.google.common.base.Splitter.on(Splitter.java:125) [guava-11.0.2.jar:]
at org.richfaces.resource.ResourceLibraryFactoryImpl.<clinit>(ResourceLibraryFactoryImpl.java:43) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at org.richfaces.application.DefaultModule.configure(DefaultModule.java:32) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at org.richfaces.application.ServicesFactoryImpl.init(ServicesFactoryImpl.java:27) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at org.richfaces.application.InitializationListener.createFactory(InitializationListener.java:129) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at org.richfaces.application.InitializationListener.onStart(InitializationListener.java:67) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at org.richfaces.application.InitializationListener.processEvent(InitializationListener.java:147) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2168) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2144) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:302) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.jboss.seam.jsf.SeamApplication.publishEvent(SeamApplication.java:458) [jboss-seam.jar:2.3.0.CR1-SNAPSHOT]
at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:601) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:370) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
19:30:33,964 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/seam-blog]] (MSC service thread 1-3) Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: java.lang.NoSuchMethodError: com.google.common.base.Platform.precomputeCharMatcher(Lcom/google/common/base/CharMatcher;)Lcom/google/common/base/CharMatcher;
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
Caused by: java.lang.NoSuchMethodError: com.google.common.base.Platform.precomputeCharMatcher(Lcom/google/common/base/CharMatcher;)Lcom/google/common/base/CharMatcher;
at com.google.common.base.CharMatcher.precomputed(CharMatcher.java:657) [guava-11.0.2.jar:]
at com.google.common.base.CharMatcher.<clinit>(CharMatcher.java:75) [guava-11.0.2.jar:]
at com.google.common.base.Splitter.on(Splitter.java:125) [guava-11.0.2.jar:]
at org.richfaces.resource.ResourceLibraryFactoryImpl.<clinit>(ResourceLibraryFactoryImpl.java:43) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at org.richfaces.application.DefaultModule.configure(DefaultModule.java:32) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at org.richfaces.application.ServicesFactoryImpl.init(ServicesFactoryImpl.java:27) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at org.richfaces.application.InitializationListener.createFactory(InitializationListener.java:129) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at org.richfaces.application.InitializationListener.onStart(InitializationListener.java:67) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at org.richfaces.application.InitializationListener.processEvent(InitializationListener.java:147) [richfaces-core-impl-4.2.2.Final.jar:4.2.2.Final]
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2168) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2144) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:302) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.jboss.seam.jsf.SeamApplication.publishEvent(SeamApplication.java:458) [jboss-seam.jar:2.3.0.CR1-SNAPSHOT]
at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:601) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:370) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]
... 8 more
{noformat}
Please check all occurrences of this issue (specifying scope) in all Shrinkwrap BOMs as it is not good to find out in steps what is next remaining.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] Created: (SHRINKWRAP-247) Support recursive addition of web resources
by Karel Piwko (JIRA)
Support recursive addition of web resources
--------------------------------------------
Key: SHRINKWRAP-247
URL: https://issues.jboss.org/browse/SHRINKWRAP-247
Project: ShrinkWrap
Issue Type: Feature Request
Affects Versions: 1.0.0-alpha-11
Reporter: Karel Piwko
Assignee: Karel Piwko
Priority: Critical
Fix For: 1.0.0-alpha-12
There should be a similar way to include web resources recursively as for classes.
Imagine that you would like to build a complete WAR used for functional tests, than the deployment method body will look like:
WebArchive war = ShrinkWrap.create(WebArchive.class, "practice0x-testing.war")
.addLibraries(Dependencies.use(MavenDependencies.class).resolveFrom("pom.xml", new ScopeFilter("", "compile")))
.addPackages(true, NO_TEST_CLASSES, org.jboss.lectures.auction.AuctionManager.class.getPackage())
.addResource(new File("src/main/webapp/detail.xhtml"), ArchivePaths.create("detail.xhtml"))
.addResource(new File("src/main/webapp/index.html"), ArchivePaths.create("index.html"))
.addResource(new File("src/main/webapp/list.xhtml"), ArchivePaths.create("list.xhtml"))
.addResource(new File("src/main/webapp/myAuctions.xhtml"), ArchivePaths.create("myAuctions.xhtml"))
.addResource(new File("src/main/webapp/myOverview.xhtml"), ArchivePaths.create("myOverview.xhtml"))
.addResource(new File("src/main/webapp/newAuction.xhtml"), ArchivePaths.create("newAuction.xhtml"))
.addResource(new File("src/main/webapp/newAuctionDetails.xhtml"), ArchivePaths.create("newAuctionDetails.xhtml"))
.addResource(new File("src/main/webapp/newAuctionSummary.xhtml"), ArchivePaths.create("newAuctionSummary.xhtml"))
.addResource(new File("src/main/webapp/script.js"), ArchivePaths.create("script.js"))
.addResource(new File("src/main/webapp/style.css"), ArchivePaths.create("style.css"))
.addResource(new File("src/main/webapp/style.ie6.css"), ArchivePaths.create("style.ie6.css"))
.addResource(new File("src/main/webapp/style.ie7.css"), ArchivePaths.create("style.ie7.css"))
.addResource(new File("src/main/webapp/images/01.png"), ArchivePaths.create("images/01.png"))
.addResource(new File("src/main/webapp/images/02.png"), ArchivePaths.create("images/02.png"))
.addResource(new File("src/main/webapp/images/03.png"), ArchivePaths.create("images/03.png"))
.addResource(new File("src/main/webapp/images/Block-h.png"), ArchivePaths.create("images/Block-h.png"))
.addResource(new File("src/main/webapp/images/Block-s.png"), ArchivePaths.create("images/Block-s.png"))
.addResource(new File("src/main/webapp/images/Block-v.png"), ArchivePaths.create("images/Block-v.png"))
.addResource(new File("src/main/webapp/images/BlockContentBullets.png"), ArchivePaths.create("images/BlockContentBullets.png"))
.addResource(new File("src/main/webapp/images/BlockHeader.png"), ArchivePaths.create("images/BlockHeader.png"))
.addResource(new File("src/main/webapp/images/BlockHeaderIcon.png"), ArchivePaths.create("images/BlockHeaderIcon.png"))
.addResource(new File("src/main/webapp/images/Button.png"), ArchivePaths.create("images/Button.png"))
.addResource(new File("src/main/webapp/images/Footer.png"), ArchivePaths.create("images/Footer.png"))
.addResource(new File("src/main/webapp/images/Header.jpg"), ArchivePaths.create("images/Header.jpg"))
.addResource(new File("src/main/webapp/images/Header.png"), ArchivePaths.create("images/Header.png"))
.addResource(new File("src/main/webapp/images/MenuItem.png"), ArchivePaths.create("images/MenuItem.png"))
.addResource(new File("src/main/webapp/images/Page-BgGlare.png"), ArchivePaths.create("images/Page-BgGlare.png"))
.addResource(new File("src/main/webapp/images/Page-BgSimpleGradient.jpg"), ArchivePaths.create("images/Page-BgSimpleGradient.jpg"))
.addResource(new File("src/main/webapp/images/PostQuote.png"), ArchivePaths.create("images/PostQuote.png"))
.addResource(new File("src/main/webapp/images/Sheet-h.png"), ArchivePaths.create("images/Sheet-h.png"))
.addResource(new File("src/main/webapp/images/Sheet-s.png"), ArchivePaths.create("images/Sheet-s.png"))
.addResource(new File("src/main/webapp/images/Sheet-v.png"), ArchivePaths.create("images/Sheet-v.png"))
.addResource(new File("src/main/webapp/images/contact.jpg"), ArchivePaths.create("images/contact.jpg"))
.addResource(new File("src/main/webapp/images/link photo.txt"), ArchivePaths.create("images/link photo.txt"))
.addResource(new File("src/main/webapp/images/nav.png"), ArchivePaths.create("images/nav.png"))
.addResource(new File("src/main/webapp/images/rssIcon.png"), ArchivePaths.create("images/rssIcon.png"))
.addResource(new File("src/main/webapp/images/spacer.gif"), ArchivePaths.create("images/spacer.gif"))
.addResource(new File("src/main/webapp/images/spectacles.gif"), ArchivePaths.create("images/spectacles.gif"))
.addResource(new File("src/main/webapp/images/subitem-bg.png"), ArchivePaths.create("images/subitem-bg.png"))
.addResource(new File("src/main/webapp/resources/auction/auctionList.xhtml"), ArchivePaths.create("resources/auction/auctionList.xhtml"))
.addResource(new File("src/main/webapp/resources/auction/menuItem.xhtml"), ArchivePaths.create("resources/auction/menuItem.xhtml"))
.addResource(new File("src/main/webapp/templates/home.xhtml"), ArchivePaths.create("templates/home.xhtml"))
.addResource(new File("src/main/webapp/templates/menu.xhtml"), ArchivePaths.create("templates/menu.xhtml"))
.addResource(new File("src/main/webapp/templates/login.xhtml"), ArchivePaths.create("templates/login.xhtml"))
.addWebResource(new File("src/main/webapp/WEB-INF/beans.xml"), "beans.xml")
.addWebResource(new File("src/main/webapp/WEB-INF/faces-config.xml"), "faces-config.xml")
.addWebResource(new File("src/main/webapp/WEB-INF/jboss-scanning.xml"), "jboss-scanning.xml")
.addWebResource(new File("src/main/resources/import.sql"), ArchivePaths.create("classes/import.sql"))
.addManifestResource(new File("src/main/resources/META-INF/persistence.xml"))
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"));
This could be massively reduced using a recursive addResources() call with a filter.
(ommiting incomming API changes in SHRINKWRAP-241)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months