-
1. Re: Where find Resource Descriptor(s)
htfv Aug 5, 2011 5:33 AM (in response to toepi)1 of 1 people found this helpfulTo the second question, you may use Maven dependency resolver:
return ShrinkWrap.create(WebArchive.class)
.addAsLibraries(DependencyResolvers
.use(MavenDependencyResolver.class)
.artifact("com.example:utils:1.0.0-SNAPSHOT")
.resolveAsFiles());
If you want to use your own artifacts, you have to install them into local repository first. The trick is that artifacts are not generated by the time the tests are executed, because test phase is executed before the package phase.
-
2. Re: Where find Resource Descriptor(s)
toepi Aug 5, 2011 9:40 AM (in response to htfv)the artifact is not available in the repo and on filesystem, thats the problem, thanks for open my eyes.
the other questions: it is not possible yet (but why it is in the docu?) ... found another discussion about it.
sebastian
-
3. Re: Where find Resource Descriptor(s)
aslak Aug 5, 2011 10:22 AM (in response to toepi)1 of 1 people found this helpfulArquillian supports Descriptor deployment, the problem is there are no Descriptor..
But you can easly create your own, e.g. via a simple:
@Deployment public static Descriptor createJDBCResource() { return new Descriptor() { public String getDescriptorName() { return "my-datasource.xml"; } public String exportToString() { return "<xml....."; } } }
ish..
But only JBoss 4, 5 and 6 support it.
-
4. Re: Where find Resource Descriptor(s)
toepi Aug 5, 2011 12:25 PM (in response to aslak)okay "not possible" is wrong, but must wrote all by my self ... and my target container do not support this stuff! More fun for me
if I add a ResourceDescriptor (e.g. set/get jndi name) and this must impl. by container it is a way that can go to upstream? and must the result realy xml? I not kow If I found the schema for my target container or can use it to deploy it on this *** ...
thanks for all your work and support
-
5. Re: Where find Resource Descriptor(s)
aslak Aug 5, 2011 1:25 PM (in response to toepi)which container?
-
6. Re: Where find Resource Descriptor(s)
toepi Aug 6, 2011 4:44 AM (in response to aslak)ibm webshpere 7. you think the support a genric way?
I try to create a ejb-jar.xml desriptor first (as warmup). And what you think about vendor binding and extensions? e.g. ibm-ejb-jar-bnd.xmi and ibm-ejb-ext.xmi same for aplication.xml?
and another big question how add descriptor to the archive?
-
7. Re: Where find Resource Descriptor(s)
aslak Aug 6, 2011 5:38 AM (in response to toepi)Have a look at the ShrinkWrap Descriptors project, and specifically the new SHRINKDESC-54 branch.
https://github.com/shrinkwrap/descriptors/tree/SHRINKDESC-54
The attempt is to automate the api generation based on the xsd, adding the websphere provider descriptors should be easy..
https://issues.jboss.org/browse/SHRINKDESC
for adding them to a Archive you can use the StringAsset:
war.addResource(new StringAsset(Descriptors.create(WebAppDescriptor.class).exportToString()), "web.xml")
Or look at the shrinkwrap-extension-descriptors module, only adds a DescriptorAsset atm to you don't have to deal with the exportToString part, but more to come here.
-
8. Re: Where find Resource Descriptor(s)
toepi Aug 6, 2011 9:51 AM (in response to aslak)https://github.com/shrinkwrap/descriptors/tree/SHRINKDESC-54
looks great - I looked at master only, I'll try to add ibm stuff to it. But where can I found descriptor for resources (have you a hint for me?)
StringAsset is the trick thanks,
edit:
first attempt has problem with somrthink like this:
<xsd:sequence>
<xsd:choice minOccurs="0" maxOccurs="1">
<xsd:element name="authentication-alias" type="authentication-aliasType" />
<xsd:element name="custom-login-configuration" type="custom-login-configurationType" />
</xsd:choice>
<!-- Default-auth is for backward compatibility and should not be used. -->
<xsd:element name="default-auth" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:attribute name="userid" type="xsd:string"/>
<xsd:attribute name="password" type="xsd:string" />
</xsd:complexType>
</xsd:element></xsd:sequence>
it generate: public <ResourceRefType<T>> defaultAuth();
-
9. Re: Where find Resource Descriptor(s)
aslak Aug 6, 2011 10:33 AM (in response to toepi)Descriptors for Resources would be the same, if the container support deploying Resource XML files.. if not, then well.. eh.. make it ?
-
10. Re: Where find Resource Descriptor(s)
toepi Aug 6, 2011 12:22 PM (in response to aslak)sorry to waste your time.
but you 've hung me up now ...
you mean write ResourceDescriptor without the appserver in mind and than go to the container and implement a way to deploy it? That's was my first impression but than you show me SHRINKDESC-54 and I think it should be possible to find a more generic way. But I've not found any xsd for deploy a resource.
-
11. Re: Where find Resource Descriptor(s)
aslak Aug 6, 2011 1:57 PM (in response to toepi)SHRINKDESC-54 should give you the foundation to generate any XSD based type, it beeing a Reosurce Descriptor for deployment or Deployment Descriptors alla web.xml.
But the question is, does WebSphere have any form of Deployable Resource Descriptors for adding JDBC Resources etc, or is all that only API based ?
e.g. can be deployed websphere-jdbc-datasource.xml ?
-
12. Re: Where find Resource Descriptor(s)
toepi Aug 6, 2011 5:41 PM (in response to aslak)if webshpere support deployable resource descriptor? I think yes because you can put definitions of datasources into the ear and the datasource "life" with the ear. But if you look at the xml you go crazy ... and not only you ... IBM self is sometimes not able to handle this files correctly and create datasource twich or forget do delete an old definition ... but I have no file her and I do this on my private pc and this will never see RAD ...
I try to use the api to deploy the resources, have found a example for an datasource and it work like a charm and it should not be the big problem to get the needed infos from an xml.
Off-Topic:
Question about SHRINKDESC-54: is has problems with the IBM xsd's e.g. is doesn't like:
<xsd:complexType name="methodType">
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="params" type="xsd:string" />
<xsd:attribute name="type" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="UNSPECIFIED"/>
<xsd:enumeration value="REMOTE"/>
<xsd:enumeration value="HOME"/>
<xsd:enumeration value="LOCAL"/>
<xsd:enumeration value="LOCAL_HOME"/>
<xsd:enumeration value="SERVICE_ENDPOINT"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="id" type="xsd:ID" />
</xsd:complexType>is create an enum with "" as name and this more than once ... I not realy understand the current task struktur on jira for it - must I create a new task, leave a comment?
-
13. Re: Where find Resource Descriptor(s)
rbattenfeld Aug 7, 2011 8:03 AM (in response to toepi)Hi Toepi
Can you give me a location were I can find the schema you try to include in the generation process? We are working hard on pushing the official Java EE descriptors. But I am interested to analyze this schema too:-)
Thanks
Ralf
-
14. Re: Where find Resource Descriptor(s)
toepi Aug 7, 2011 8:38 AM (in response to rbattenfeld)hi ralf,
I found the schema in the install folder from websphere, have not seen it in wild and not sure if the are public ... so i'll not post it here or on bugtracker.
I can send it to you as email (123k as zip)?