support for nested classes.
by Rudy De Busscher
Hi All,
Seems that nested classes aren't handled correctly by forge.
If you have a java source file like this
public class CustomProjectStageHolder implements ProjectStageHolder
{
public static final class CustomProjectStage extends ProjectStage
{
private static final long serialVersionUID = 1029094387976167179L;
}
public static final CustomProjectStage CustomProjectStage = new
CustomProjectStage();
}
And consider then following statements:
JavaResource javaResource = factory.getResourceFrom(new
File("/path/to/file/RudyHolder.java")).reify(JavaResource.class);
javaResource.getJavaSource().getQualifiedName();
The javaResource is indeed pointing to the file, you can verify with
javaResource.getFullyQualifiedName()
But if you ask for the javaSource, as in the second statement, you get
the nested class, CustomProjectStage in our example.
Relation between JavaResource and JavaSource indicates that multiple
classes per java file wasn't considered. And isn't common for entity
classes etc that have to be handled by Forge.
So when there are no plans in supporting this in Forge, isn't it logic
to return the main class, instead of the nested class?
Thx for the clarification.
Regards
Rudy
--
Rudy De Busscher
http://www.c4j.be
12 years, 10 months
Get a list of all classes extending a specific class
by Rudy De Busscher
Hi all,
For a plugin, I could use some functionality that scans the source
directories and report me all the java classes that extend a certain class.
But I couldn't find anything for that in Forge.
Is there some way of getting the parent class ? (or do I have the 'parse'
the source myself (find extend clause and see what come next))
Thx
Best regards
--
Rudy De Busscher
http://www.c4j.be
12 years, 10 months
forge error redirect
by Kelly Goedert
Hi,
I just created a project with forge 1.0.0(b5) following the
documentation. It seems to be working fine, except when I type an
address for a page that doesnt exist in the project. In this project I
am using jboss 6.1.0 final. I get the following error:
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/forge2].[FacesServlet]]
Servlet.service() for servlet FacesServlet threw exception:
com.sun.faces.context.FacesFileNotFoundException: /lala.xhtml Not
Found in ExternalContext as a Resource
at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:232)
[:2.1.6-SNAPSHOT]
at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:273)
[:2.1.6-SNAPSHOT]
at com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:209)
[:2.1.6-SNAPSHOT]
at com.sun.faces.application.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:114)
[:2.1.6-SNAPSHOT]
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:233)
[:2.1.6-SNAPSHOT]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [:2.1.6-SNAPSHOT]
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
[:2.1.6-SNAPSHOT]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
[:2.1.6-SNAPSHOT]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
[:2.1.6-SNAPSHOT]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
[:6.1.0.Final]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
[:6.1.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
[:6.1.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
[:6.1.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
[:6.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
[:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
[:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
[:6.1.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
[:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
[:6.1.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[:6.1.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
[:6.1.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[:6.1.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
[:6.1.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
[:6.1.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[:6.1.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
[:6.1.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
[:6.1.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
09:58:48,596 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/forge2].[FacesServlet]]
Servlet.service() for servlet FacesServlet threw exception:
java.lang.IllegalStateException: Must call associate() before calling
activate()
at org.jboss.weld.context.AbstractConversationContext.activate(AbstractConversationContext.java:277)
[:6.1.0.Final]
at org.jboss.weld.jsf.WeldPhaseListener.activateConversations(WeldPhaseListener.java:114)
[:6.1.0.Final]
at org.jboss.weld.jsf.WeldPhaseListener.beforePhase(WeldPhaseListener.java:88)
[:6.1.0.Final]
at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
[:2.1.6-SNAPSHOT]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99) [:2.1.6-SNAPSHOT]
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
[:2.1.6-SNAPSHOT]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
[:2.1.6-SNAPSHOT]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
[:2.1.6-SNAPSHOT]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:543)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407)
[:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:529)
[:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:455)
[:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:399)
[:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:194)
[:6.1.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[:6.1.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
[:6.1.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[:6.1.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
[:6.1.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
[:6.1.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[:6.1.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
[:6.1.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
[:6.1.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
09:58:48,599 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]]
Exception Processing ErrorPage[errorCode=500,
location=/faces/error.xhtml]: javax.servlet.ServletException: Must
call associate() before calling activate()
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
[:2.1.6-SNAPSHOT]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:543)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479)
[:6.1.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407)
[:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:529)
[:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:455)
[:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:399)
[:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:194)
[:6.1.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[:6.1.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
[:6.1.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[:6.1.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
[:6.1.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
[:6.1.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[:6.1.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
[:6.1.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
[:6.1.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
Caused by: java.lang.IllegalStateException: Must call associate()
before calling activate()
at org.jboss.weld.context.AbstractConversationContext.activate(AbstractConversationContext.java:277)
[:6.1.0.Final]
at org.jboss.weld.jsf.WeldPhaseListener.activateConversations(WeldPhaseListener.java:114)
[:6.1.0.Final]
at org.jboss.weld.jsf.WeldPhaseListener.beforePhase(WeldPhaseListener.java:88)
[:6.1.0.Final]
at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
[:2.1.6-SNAPSHOT]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99) [:2.1.6-SNAPSHOT]
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
[:2.1.6-SNAPSHOT]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
[:2.1.6-SNAPSHOT]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
[:2.1.6-SNAPSHOT]
... 19 more
Can somebody help?
Thanks
Kelly
12 years, 10 months
Plugin Problems when using Class.forName()
by Max Schwaab
Hey there,
I try to get my plugin working and now I have the problem that my plugin
can't find one of its classes when I try to invoke the default command.
The plugin does some stuff an finally a
Class.forName("org.hibersap.forge.plugin.FunctionModuleSearch")
Do you have any hints why Class.forName() can't find the class?
The message is
***ERROR*** [generate-sap-entities] Cannot find class
org.hibersap.forge.plugin.FunctionModuleSearch in classpath
The funny thing about this is, with Forge Beta 5 everything is working
fine, with the latest Forge snapshot I miss my class :\
This is all within the same Maven JAR plugin project. I'm using a
framework which is using the Class.forName() method. So there's no way
out of this :)
Must be something to do with the latest changes since Beta 5 is published.
Thanks for your help,
best regards,
Max
12 years, 10 months
ERROR [scaffold from-entity] Error generating default scaffolding
by Christopher Britz
I've been getting this error *ERROR* [scaffold from-entity] Error
generating default scaffolding when i run the command "scaffold from-entity
~.domain.* --scaffoldType faces
--overwrite" It appears that this is a relationship error when dealing
with a manyToMany relationship. I have been using Dan Allen's "JBoss Java
EE workshop" example, found here (https://gist.github.com/1637464#comments),
however, not including openshift. To reproduce start with the topic
"Generating
an application with Forge" and instead of running a script to do all the
commands run through them manually. When issuing the first scaffolding
command listed above I get the error listed in the subject line. It looks
to me if you run all the commands for creating the entities then go on to
do the relationship part for the entities for the Customer --> Address
relation is where it jumps on the fail boat. I could not find a forge log
for a better stacktrace. If there is one I will be happy to send it. Also,
a little FYI i am using Forge inside of Eclipse with the Forge plugin
running version Beta5.
Hope this helps.
12 years, 11 months
problems loading plugins / CME
by Thomas Frühbeck
Hi,
when I tried to load plugins I downloaded from github and compiled by
"forge source-plugin" I could not load them.
I found that the API-version string of the plugins did not contain
"SNAPSHOT" and a ConcurrentModificationException was thrown in Bootstrap
class.
So I (pragmatically though) changed the lines starting from 174+ to:
thomas@happy:~/java/git/forge> git difftool -y -t ctxdiff
shell/src/main/java/org/jboss/forge/shell/Bootstrap.java
26a27
> import java.util.Iterator;
173,179c174,181
< for (PluginEntry pluginEntry : incompatible) {
< if (pluginEntry.getApiVersion().contains("SNAPSHOT"))
< {
< toLoad.add(pluginEntry);
< incompatible.remove(pluginEntry);
< }
< }
---
> Iterator<PluginEntry> incompIter = incompatible.iterator();
> while (incompIter.hasNext()) {
> PluginEntry pluginEntry = incompIter.next();
> if (pluginEntry.getApiVersion().contains("SNAPSHOT")
|| pluginEntry.getSlot().contains("SNAPSHOT")) {
> toLoad.add(pluginEntry);
> incompIter.remove();
> }
> }
Silly?
How should "forge source-plugin" work with plugins coming from HEAD?
Comments appreciated,
Thomas
12 years, 11 months
MavenDependencyFacet.hasRepository
by Max Schwaab
Hey there :)
It's me again, I have a question about the hasRepository method in the
MavenDependencyFacet.
Why do you remove the repository if its found in the project pom?
I expect the method to deliver true or false, not to manipulate the
project pom.
Is this a bug or something with another sense?
Best regards
Max
@Override
public boolean hasRepository(final String url)
{
if (url != null)
{
MavenCoreFacet maven = project.getFacet(MavenCoreFacet.class);
Model pom = maven.getPOM();
List<Repository> repositories = pom.getRepositories();
for (Repository repo : repositories)
{
if (repo.getUrl().trim().equals(url.trim()))
{
*repositories.remove(repo);
maven.setPOM(pom);*
return true;
}
}
}
return false;
}
12 years, 11 months
Adding new field to existing deployment
by Andrew Burger
Does Forge have the ability to add a new field to existing deployment?
I added a new field , did a scaffold form-entity , build, mvn clean
package, as7 undeploy and as7 deploy and the newly added field does
not show up. Am I missing a command?
12 years, 11 months
Please fix MavenCoreFacetImpl getPom()
by Max Schwaab
Hey Lincoln,
I found this while I'm looking for the reason for the warning
***WARNING*** Could not resolve dependency [some-jar:jar::${some.version}]
It appears in the installing process for my plugin from a local project after a successful build.
To avoid this warning the mentioned method should be changed, because forge is using it internally.
Best regards
Max
P.S.
I don't get mails from the list, thats why I repeat with a new email..
You can use properties. Have you tried the getEffectiveDependency() and
getDirectDependency() methods in DependencyFacet?
Chances are that you should *not* be using MavenCoreFacet. It should be
your last resort.
Does this help?
~Lincoln
On Tue, Jan 10, 2012 at 6:43 AM, Max Schwaab<max.schwaab at akquinet.de <https://lists.jboss.org/mailman/listinfo/forge-users>>wrote:
>/ Hey there,
/>/
/>/ would be cool if you fix the getPom() method in the MavenCroreFacteImpl
/>/ class.
/>/
/>/ I'm develping a plugin for forge and its not good that you can't use
/>/ properties for dependency versions in your plugin pom.
/>/
/>/ Im talking about this mehtod:
/>/
/>/ @Override
/>/ public Model getPOM()
/>/ {
/>/ try
/>/ {
/>/ Model result = new Model();
/>/
/>/ // FIXME this should/can-not use the Maven Native file writer
/>/ if we are going to abstract file APIs
/>/ MavenXpp3Reader reader = new MavenXpp3Reader();
/>/ FileInputStream stream = new
/>/ FileInputStream(getPOMFile().getUnderlyingResourceObject());
/>/ if (stream.available()> 0)
/>/ {
/>/ result = reader.read(stream);
/>/ }
/>/ stream.close();
/>/
/>/ result.setPomFile(getPOMFile().getUnderlyingResourceObject());
/>/ return result;
/>/ }
/>/ catch (IOException e)
/>/ {
/>/ throw new ProjectModelException("Could not open POM file: " +
/>/ getPOMFile(), e);
/>/ }
/>/ catch (XmlPullParserException e)
/>/ {
/>/ throw new ProjectModelException("Could not parse POM file: " +
/>/ getPOMFile(), e);
/>/ }
/>/ }
/>/
/>/ Cheers
/>/
/>/ Max
/>/ _______________________________________________
/>/ forge-users mailing list
/>/ forge-users at lists.jboss.org <https://lists.jboss.org/mailman/listinfo/forge-users>
/>/ https://lists.jboss.org/mailman/listinfo/forge-users
/>/
/
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
-------------- next part --------------
An HTML attachment was scrubbed...
URL:http://lists.jboss.org/pipermail/forge-users/attachments/20120110/3aa...
12 years, 11 months
Please fix MavenCoreFacetImpl getPom()
by Max Schwaab
Hey there,
would be cool if you fix the getPom() method in the MavenCroreFacteImpl
class.
I'm develping a plugin for forge and its not good that you can't use
properties for dependency versions in your plugin pom.
Im talking about this mehtod:
@Override
public Model getPOM()
{
try
{
Model result = new Model();
// FIXME this should/can-not use the Maven Native file writer
if we are going to abstract file APIs
MavenXpp3Reader reader = new MavenXpp3Reader();
FileInputStream stream = new
FileInputStream(getPOMFile().getUnderlyingResourceObject());
if (stream.available() > 0)
{
result = reader.read(stream);
}
stream.close();
result.setPomFile(getPOMFile().getUnderlyingResourceObject());
return result;
}
catch (IOException e)
{
throw new ProjectModelException("Could not open POM file: " +
getPOMFile(), e);
}
catch (XmlPullParserException e)
{
throw new ProjectModelException("Could not parse POM file: " +
getPOMFile(), e);
}
}
Cheers
Max
12 years, 11 months