Control Weld classpath scanning during Arquillian unit tests?
by Richard Kennard
Hi guys,
I've hit a problem related to an interaction of Arquillian, Weld and Metawidget. It could probably be fixed in any one of those, and I will endaveour to
fix it in Metawidget in the future, but for now I need a workaround.
Basically, I need to exclude 'org.jboss.forge.scaffold.faces.metawidget' from the Weld scanning during Arquillian unit testing. Where should I do that? I
tried modifying /forge/scaffold-faces/src/main/resources/META-INF/beans.xml but I think that's the beans.xml that gets built into the app that Forge
generates, *not* the beans.xml that controls the Arquillian unit testing?
Regards,
Richard.
13 years
Re: [forge-dev] Switchyard Module
by Lincoln Baxter, III
Ok, I think I have tracked down the issue here.
For some reason, dependencies that are required at runtime are not being
included when the module is built.
I manually added, for instance:
commons-management-1.0.jar, and the NoClassDefFoundError on *
org/fusesource/commons/management/ManagementStrategy* was resolved,
however, a new error came up now asking for *
org/osgi/framework/BundleActivator*
So it seems like this is just a matter of adding these items to the pom.xml
of your module. Sorry it took so long to check this out.
~Lincoln
On Fri, Oct 28, 2011 at 11:33 PM, Lincoln Baxter, III <
lincolnbaxter(a)gmail.com> wrote:
> I am trying to get to this. Conferences are rushing up on me. I have a
> sneaking suspicion that there is a bug in jboss-modules, because failing to
> load what appears to be a perfectly valid module does not seem right.
>
> ~Lincoln
>
>
> On Thu, Oct 27, 2011 at 3:07 PM, Lincoln Baxter <lbaxter(a)redhat.com>wrote:
>
>>
>>
>> ----- Forwarded Message -----
>> From: "Tom Cunningham" <tcunning(a)redhat.com>
>> To: "Lincoln Baxter" <lbaxter(a)redhat.com>
>> Sent: Thursday, October 27, 2011 2:50:49 PM
>> Subject: module
>>
>> cd ~/.forge/plugins
>> tar zxvf switchyard-forge-plugin.tar.gz
>>
>> installed.xml entry :
>>
>> <plugin name="org.switchyard.switchyard-forge-plugin"
>> slot="0.3.0-SNAPSHOT-7edd2023-3f06-45fa-812b-6ddd64406f79"/>
>>
>>
>
>
> --
> Lincoln Baxter, III
> http://ocpsoft.com
> http://scrumshark.com
> "Keep it Simple"
>
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
13 years
Re: [forge-dev] Forge Plugin
by Lincoln Baxter
Hi Torben,
Our trip fron Stuttgart was great :) lots of speed.
That's fantastic! Another win over Archetypes ;) I will take a look at your
code. We could definitely figure out where to put this. Just so I know what
you are thinking, why do you think the entity-plugin is the right place?
Copying forge-dev,
~Lincoln
On Fri, Nov 11, 2011 at 1:28 PM, Torben Jaeger <torben(a)jit-central.com>wrote:
> Hey Lincoln,
>
> how was your trip to Munich? Devoxx next?
>
> I've made some first steps with forge plugins. I've convinced my team to
> use forge for code generation and my colleague told me that he wants to use
> forge instead of the already self-written, existing maven archetypes!
> Mission accomplished ;)
>
> If u have time maybe u can have a look at
> https://github.com/jicken/entity-service-forge-plugin
> Maybe this could be done using the entity plugin with an additional
> option: --create-service-facade.
>
> I was wondering why it doesn't already exist ...
>
> Say hi to Dan and ALR ... if u're still traveling together.
>
> Cheers,
>
> Torben
>
>
> Torben Jäger
> Geschäftsführer
>
> JIT Consulting GmbH
> Obere Schlossgartenstr. 10
> D-74196 Neuenstadt a. Kocher
>
> Handelsregister Amtsgericht Heilbronn, HRB 8567
> Geschäftsführer Torben Jäger
> Ust-IdNr. DE234692437
>
> Tel. +49 - (0) 152 3357 9096
> Fax +49 - (0) 71 39 45 46 40
>
> mailto:torben.jaeger@jit-consulting.eu
> http://www.jit-consulting.eu
>
> public key available via keyserver hkp://subkeys.pgp.net
>
> "it's jit, not shit."
>
>
>
>
>
>
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
13 years
Re: [forge-dev] Arquillian Integration in Forge
by Lincoln Baxter, III
Hey Daniel,
You are correct. The remote container should not need to know the location
of the JBoss Home environment variable. You mentioned you might try to
update this yourself.
You can find the code for this plugin here:
https://github.com/forge/plugin-arquillian
Please feel free to join the forge-dev list! (copied on this email)
Need anything else?
Cheers!
~Lincoln
On Thu, Nov 10, 2011 at 9:51 PM, Daniel Sachse
<sachsedaniel(a)googlemail.com>wrote:
> Hey Lincoln,
>
> I just again tried the Forge wizard and I also added Arquillian to my
> new project.
> I saw something, that I am not quite shure if its correct this way: I
> added the AS 7 Remote Connector in the wizard and it asked me for the
> JBoss Home directory. Is this correct? Because the remote connection
> should go via IP and Port.
> I thought that only the managed adapter needs this information.
>
> Thanks for looking into this.
>
> Cheers,
>
> Daniel
>
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
13 years
Test testFindPlugin fails
by Ivan St. Ivanov
Hi folks,
I just fetched the latest version of forge. I launched maven build and it
failed while building the forge shell project. One of the tests
(ForgePluginTest::testFindPlugin) failed with the following exception:
java.lang.RuntimeException: no default repository set: (to set, type: set
DEFAULT_PLUGIN_REPO <repository>)
at org.jboss.forge.shell.util.PluginUtil.getDefaultRepo(PluginUtil.java:62)
at org.jboss.forge.shell.util.PluginUtil.findPlugin(PluginUtil.java:73)
at
org.jboss.forge.shell.plugins.builtin.ForgePlugin.find(ForgePlugin.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.forge.shell.command.Execution.perform(Execution.java:147)
at
org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:125)
at
org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:63)
at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:716)
at
org.jboss.forge.shell.ShellImpl$Proxy$_$$_WeldClientProxy.execute(ShellImpl$Proxy$_$$_WeldClientProxy.java)
at
org.jboss.forge.shell.test.plugins.builtin.ForgePluginTest.testFindPlugin(ForgePluginTest.java:41)
I did a quick debug (the test failed in the IDE as well) and found that the
ForgePlugin class under test is initialized with an Environment object that
has an empty properties map. I tried to find out how the plugin gets
initialized, but I got lost somewhere in the calls of the Weld library:
from Execution::perform:90
Class<? extends Plugin> pluginType = command.getParent().getType();
Set<Bean<?>> beans = manager.getBeans(pluginType);
Bean<?> bean = manager.resolve(beans);
However, I checked the CI server logs from today (
http://ci.jboss.org/jenkins/view/Forge/job/Forge-CI/366/console). The build
is broken, but the Forge shell project is built successfully.
Is there anything wrong with my setup? Just for your information, I'm using
Windows.
Thanks and regards,
Ivan
P.S. BTW I get the same compilation error as Jenkins when I run the build
with -DskipTests:
[ERROR] COMPILATION ERROR : [INFO]
-------------------------------------------------------------[ERROR]
/mnt/hudson_workspace/workspace/Forge-CI/scaffold-faces/src/main/java/org/jboss/forge/scaffold/faces/metawidget/inspector/propertystyle/ForgePropertyStyle.java:[529,59]
type parameters of <T>T cannot be determined; no unique maximal
instance exists for type variable T with upper bounds
T,java.lang.annotation.Annotation
13 years
Auto instantiate properties of custom type
by Richard Kennard
Hi guys,
As you're probably aware, in JSF if I do...
#{customer}
...then a Customer object will get instantiated 'just in time'. But if I do...
#{customer.address.street}
...then 'address' will *not* get instantiated just in time. So if you use Forge to do...
entity --named Customer
field custom --named address
[what custom type m'lord?] com.test.domain.Address
Then although you'll get a UI that includes a Customer with an embedded Address, it'll fail as soon as you try to save. There isn't a very good solution to
this, so can I suggest the simplest?
When Forge generates field/getter/setter for a custom type (possibly limited to the project's domain package), could it do:
@Column
private Address address *=new Address();*
public Address getAddress() {
return this.address;
}
public void setAddress(final Address address) {
this.address = address;
} }
13 years
Is this correct?
by Doychin Bondzhev
Hi guys,
While looking at forge code I found this:
/*
* Make sure we have all the features we need for this to work.
*/
if (!project.hasAllFacets(Arrays.asList(CDIFacet.class,
PersistenceFacet.class)))
{
request.fire(new InstallFacets(true, EJBFacet.class,
PersistenceFacet.class));
}
On first look it is OK but then I noticed that Facets checked in if are
not the same that are installed after that. More specifically there is
check for CDIFacet but then EJBFacet is installed.
Is that supposed to be this way or there is something wrong here?
This is RestPlugin.java
--
Doychin Bondzhev
dSoft-Bulgaria Ltd.
PowerPro - billing & provisioning solution for Service providers
PowerStor - Warehouse & POS
http://www.dsoft-bg.com/
Mobile: +359888243116
13 years
Metawidget question (stack trace included)
by Lincoln Baxter, III
Hey Richard,
I feel like I am doing something wrong here, but do you know why I might be
getting this exception when attempting to view a page using an editable
metawidget tag in scaffolded forge apps on AS7?
I just changed a few things around and broke this, but I'm not exactly sure
how or why.
This can be reproduced by doing the following (using latest SNAPSHOT build):
- new-project --named scaffold --topLevelPackage com.scaffold
- scaffold setup
- persistence setup --provider HIBERNATE --container JBOSS_AS7
- entity --named Customer
- scaffold from-entity
- build
- as7 deploy
- (go to the Create Customer page)
Much appreciated!!
~Lincoln
java.io.IOException: No such class
org.jboss.faces.component.html.HtmlMetawidget or supported tag
<htmlMetawidget>
org.metawidget.faces.component.UIMetawidget$EncodeBeginSupport.encodeBegin(UIMetawidget.java:1396)
org.metawidget.faces.component.UIMetawidget.encodeBegin(UIMetawidget.java:675)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1754)
javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
com.ocpsoft.rewrite.faces.RewriteViewHandler.renderView(RewriteViewHandler.java:154)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
13 years