Setting the context root

34 views
Skip to first unread message

Sébastien

unread,
Mar 2, 2008, 5:30:05 PM3/2/08
to Israfil Mojo User Discussions
I'm trying to integrate this plugin with BlazeDS but I don't find how
to specify the context-root mxmlc parameter.
Is there a way to do so?

Christian Edward Gruber

unread,
Mar 2, 2008, 5:33:53 PM3/2/08
to israfil-m...@googlegroups.com
I'd have to check about a specific parameter, but if you can't find
one in the plugin docs, you can always use the generic workaround
parameter configuration in <extraParams> You can pretty much set any
parameters that aren't "natively supported" by the plugin in that
section.

Christian.

Sebastien ARBOGAST

unread,
Mar 2, 2008, 5:41:02 PM3/2/08
to israfil-m...@googlegroups.com
Thanks. Could you give me an example of the syntax?

2008/3/2, Christian Edward Gruber <christiane...@gmail.com>:



--
Sébastien Arbogast

http://sebastien-arbogast.com

Sudhan

unread,
Mar 5, 2008, 2:10:47 PM3/5/08
to Israfil Mojo User Discussions
Hi Christian,

The problem with <extraParams> is that, the value is not not read
before <main> and as such the build fails because it cannot find the
path specified in <extraParams>. The issues was also raised here in
the groups : http://groups.google.com/group/israfil-mojo-users/browse_thread/thread/828954652ce1a3c9

Do you have any workaround to add the context-root param ?

thanks,

Sudhan

On Mar 2, 2:33 pm, Christian Edward Gruber
> > Is there a way to do so?- Hide quoted text -
>
> - Show quoted text -

Christian Edward Gruber

unread,
Mar 5, 2008, 7:44:35 PM3/5/08
to israfil-m...@googlegroups.com
Hmm. I thought main was the last thing given to the compiler. What
version of hte plugin are you using? And would you send your output
of the command-line from the maven build log? It'd help to see what's
happening.

Christian.

Message has been deleted

Sudhan

unread,
Mar 6, 2008, 11:49:23 AM3/6/08
to Israfil Mojo User Discussions
Just for a workaround i had to add context-root tag in flex-config.xml
in the framework/sdk and then everything works fine. But i should be
able to add extraParam through Maven. Below is my Error log :


[INFO] Error: The services configuration includes a channel-definition
'my-http'
that has an endpoint with a context.root token but a context root has
not been
defined. Please specify a context-root compiler argument.
[INFO]
[INFO] flex.messaging.config.ConfigurationException: The services
configuration
includes a channel-definition 'my-http' that has an endpoint with a
context.root
token but a context root has not been defined. Please specify a
context-root co
mpiler argument.
[INFO] at
flex.messaging.config.ChannelSettings.parseClientUri(ChannelSettings.
java:170)
[INFO] at
flex.messaging.config.ChannelSettings.getClientParsedUri(ChannelSetti
ngs.java:129)
[INFO] at
flex.messaging.config.ServicesDependencies.codegenXmlInit(ServicesDep
endencies.java:464)
[INFO] at
flex.messaging.config.ServicesDependencies.<init>(ServicesDependencie
s.java:46)
[INFO] at
flex2.compiler.common.CompilerConfiguration.getServicesDependencies(C
ompilerConfiguration.java:1190)
[INFO] at
flex2.tools.Compiler.calculateServicesChecksum(Compiler.java:624)
[INFO] at flex2.tools.Compiler.processConfiguration(Compiler.java:
561)
[INFO] at flex2.tools.Compiler.processConfiguration(Compiler.java:
417)
[INFO] at flex2.tools.Compiler.mxmlc(Compiler.java:71)
[INFO] at flex2.tools.Compiler.main(Compiler.java:42)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------

............................................
.....
Adobe\Flex Builder 3\sdks\3.0.0\frameworks\libs\framework.swc" -
compiler.debug=f
alse -source-path ......\src\main\flex -- index.mxml e
xecution is: '1'.
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:480)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:459)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:
334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:
125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Result of
java -Xms12
8m -Xmx256m -classpath "C:\Program Files\Adobe\Flex Builder 3\sdks
\3.0.0\lib\adt

........................................

.................

g=false -source-path ...\src\main\flex -- index.mxm
l execution is: '1'.
at
net.israfil.mojo.flex2.AbstractFlexMojo.execute(AbstractFlexMojo.java
:547)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:443)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
... 16 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 15 seconds
[INFO] Finished at: Wed Mar 05 17:19:27 PST 2008
[INFO] Final Memory: 14M/1016M
[INFO]
------------------------------------------------------------------------

thanks,

Sudhan

Sudhan

unread,
Mar 6, 2008, 2:20:59 PM3/6/08
to Israfil Mojo User Discussions
Hi,

I am adding the code snippet i added to Israfil pluggin (custom
modification), which allowed me to add context root param for the
compilers. The file being modified was : AbstractFlexMojo.java

Step: 1 : Add contextRoot param to AbstractFlexMojo.java as a member
variable.

/**
* contextRoot to add to compiler at runtime. This param will be used
in
* with dataServicesConfig.
*
* @parameter
*/
protected String contextRoot;

Step : 2 : Adding following code in AbstractFlexMojo.java, just before
this line - if (dataServicesConfig != null) {


if (contextRoot != null){
if (contextRoot.trim().length() > 0){
try{
javaParms.add("-compiler.context-root");
javaParms.add(contextRoot.trim());
}catch(Exception e){
throw new MojoExecutionException("Exception attempting to set
contextRoot: " + contextRoot, e);
}
}
}

Step : 3 : Lastly add contextRoot to your Maven pom

<plugin>
<groupId>net.israfil.mojo</groupId>
<artifactId>maven-flex2-plugin</artifactId>
<version>2.1.1-SNAPSHOT</version>
<extensions>true</extensions>
<configuration>
<flexHome>${flex.home}</flexHome>
<useNetwork>true</useNetwork>
<contextRoot>/samples</contextRoot>
<dataServicesConfig>
C:\jboss-4.0.5.GA\server\default\deploy
\samples.war\WEB-INF\flex\services-config.xml
</dataServicesConfig>
<strict>true</strict>
<warning>true</warning>
<main>index.mxml</main>
</configuration>
</plugin>

Hope this will help.

thanks

Sudhan

VELO

unread,
Mar 6, 2008, 3:03:25 PM3/6/08
to israfil-m...@googlegroups.com
best solution.

I need something like this too.


VELO

Christian Edward Gruber

unread,
Mar 6, 2008, 6:42:46 PM3/6/08
to israfil-m...@googlegroups.com
I'll include this in the next release, Thanks.

Christian.

Reply all
Reply to author
Forward
0 new messages