Linking problems of a ScalaFX project within Eclipse Juno - eclipse-juno

This seems like the Final Pain in my journey of getting ScalaFX development up with Eclipse (Juno). In short, I'm able to compile and run a code in sbt but if I want debugging (would be nice) I need Eclipse.
Unfortunately, I'm not able to produce a small project that would exhibit this pain (I bump into other issues). If the snapshot below says anything to anyone on what might be wrong, you would have helped me tremendously.
The lines in question look like this (nothing remarkable in them):
import scalafx.scene.shape.{Shape, Line, Arc}
..
new Line{
startX = p.x
startY = p.y
endX = tmp.x
endY = tmp.y
}
Here is my .classpath - in case that's where the problem is coming from:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="lib/scalafx-1.0-SNAPSHOT.jar"/>
<classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<!--
- Some reference to JavaFX seems to be needed (otherwise: "not found: object javafx")
-->
<classpathentry kind="lib" path="/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/jfxrt.jar"></classpathentry>
<classpathentry kind="output" path="build/classes"/>
</classpath>
All of this is on OS X, running Oracle Java 7u9 JDK (at least so I think!).
p.s. Eclipse is still slow and cumbersome compared to other IDE's I've worked with (Visual Studio, XCode), but is kind-of 'must' since the official ScalaIDE binding is working with it.

I am using sbt, eclipse (indigo) and scalafx and it works.
The following compiles and works:
new Line{
startX = 10
startY = 10
endX = 20
endY = 20
}
If you want i can help you setup your environment.

Related

Primefaces Showcase autocomplete countryService #inject problem (Primefaces 8.0, JSF 2.3, TomEE-wepprofile) [duplicate]

This question already has an answer here:
TomEE CDI #Inject NullPointerException
(1 answer)
Closed 2 years ago.
Trying to get "Primefaces Showcase autocomplete" running I'm facing a problem that "CountryService.java" won't load. I copied it from (https://www.primefaces.org/showcase/ui/input/autoComplete.xhtml?jfwid=52f7c). It looks like it's caused by the "#Inject private CountryService countryService;" not functioning.
In autoCompleteView.java I added a printline to the method completeText:
public List completeText(String query) {
System.out.println(thisClassName + ": completeText (1) - " + query + " / " + countryService);}
When running it shows this: "AutoCompleteView: completeText (1) - ned / null", meaning 'countryService' has not been initialized. Could it be an CDI issue? I'm using 'tomee-8.0.6-webprofile' that according to documentation should support CDI! Or must I install CDI2.0 seperately into my java library lists?
I tried the #BalusC solution of: How to inject FacesContext with JSF 2.3 and TomEE?
Maybe something is missing in my installation? :
Eclipse 18-12;
Apache Tomcat (TomEE)/9.0.41 (8.0.6);
JSF2.3;
myfaces2.3;
Primefaces 8.0;
Could anyone help me please? I would appreciate that very much!
Found the right answer in this answer
I added "beans.xml" to my WEB-INF directory:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
version="1.1" bean-discovery-mode="all">
</beans>

CAstle Windsor: How to reference a second xml config file that is an embedded resource?

We have one xml configuration file that we use in production. We also have a little test app that has a couple of additional needs. What I'd like to do is create a second, testing-only xml config file that references the embedded production configuration file. Is there any way to do this?
I'm aware of the "include" element, but am not sure where in the file it is supposed to be placed--in the castle node? The components node?
I feel like the answer is here but I'm too dense to figure it out.
Thanks for any help you can provide.
UPDATE
This is how our production config file is set up:
<?xml version="1.0" encoding="utf-8"?>
<OurCompany>
<Framework>
<castle>
<installers>
<!-- some installers-->
<installers>
<components>
<!--some components-->
<components>
<castle>
<Framework>
<OurCompany>
My most recent attempt at a non-production config file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<OurCompany>
<Framework>
<castle>
<include uri="assembly://AssemblyContainingEmbeddedXml/MyEmbeddedConfig.xml" />
<components>
<!--components I only want registered with container when running in non-production environment-->
<components>
<castle>
<Framework>
<OurCompany>
The exception I get reads:
Configuration parser encountered Framework, but it was expecting to find installers, facilities or components. There might be either a typo on or you might have forgotten to nest it properly.
(In the actual message, "Framework," "installers," "facilities," and "components" are enclosed in angle brackets.)
The bottom of the page you reference has an example of loading from an embedded resourced:
IResource resource = new AssemblyResource("assembly://Acme.Crm.Data/Configuration/services.xml");
container = new WindsorContainer(new XmlInterpreter(resource));

Flex Conditional Compile Error

I'm doing the following:
CONFIG::TEST{
rootURL = "myTestURL";
}
CONFIG::PROD{
rootURL = "myProdURL";
}
In compiler arguments I have this:
-locale en_US -define+=CONFIG::AIR,true -define+=CONFIG::WEB,false
-show-unused-type-selector-warnings=false
-define+=CONFIG::PROD,false -define+=CONFIG::TEST,true
But I'm getting errors for them both:
Access of undefined property PROD.
Access of undefined property TEST.
What is extremely odd is that this code works on my windows machine, but not on my mac. I've tried various things -- doing a clean checkout of code, cleaning the project, reinstalling Flash Builder. I also tried changing the order of the arguments, placing the last two in front of the selector warnings. That didn't help either.
Has anyone seen this before?
Try to set first -define=CONFIG::AIR,true without += or use -load-config+=configs.xml
<?xml version="1.0" encoding="utf-8"?>
<flex-config>
<compiler>
<define append="true">
<name>CONFIG::AIR</name>
<value>true</value>
</define>
...
</compiler>
</flex-config>

Quartz.net Setup Throwing Error: "onfiguration parser encountered <job>"

I have a Asp.net C# MVC 3 application implementing the Sharp Architecture. I have been trying to get Quartz.net to setup and work nicely with Castle Windsor for a few days without any luck. Based on what I know, I have setup everything correctly, but continue to have issues.
In my Global.cs file, creating my Container and trying to register quartz jobs:
var container = new WindsorContainer(new XmlInterpreter("quartz_jobs.xml"));
container.AddFacility("quartznet", new QuartzFacility());
In my quartz_jobs.xml file I have the following contents:
<?xml version="1.0" encoding="utf-8" ?>
<quartz xmlns="http://quartznet.sourceforge.net/JobSchedulingData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0"
overwrite-existing-jobs="true">
<job>
<job-detail>
<name>DeleteLoansWithoutClientsJob</name>
<job-type>EasyOptions.Web.Mvc.Code.Jobs.DeleteLoansWithoutClientsJob, EasyOptions.Web.Mvc</job-type>
<durable>true</durable>
</job-detail>
<trigger>
<cron>
<name>DeleteLoansWithoutClientsJobTrigger</name>
<group>MyJobs</group>
<description>A description</description>
<job-name>DeleteLoansWithoutClientsJob</job-name>
<job-group>MyJobs</job-group>
<cron-expression>0 0/1 * * * ?</cron-expression>
</cron>
</trigger>
</job>
Problem is, you're pointing Windsor to the Quartz.NET config file.
There are two separate configurations: Windsor's and Quartz.NET's. Windsor is usually configured with code nowadays (i.e. fluent config), though it still supports XML configuration. However the Quartz.NET facility doesn't currently support code config, you have to use Windsor's XML config (at least for this, other components/facilities may still be configured via code). Then there's Quartz.NET, usually configured via an external quartz_jobs.xml file.
I recommend using the Quartz.NET facility sample app as reference. In particular, here's the sample Windsor config and the sample Quartz.NET config.
EDIT: if Quartz.NET says it can't find quartz_jobs.xml in a web application you need to include the web root in the configuration path: "~/quartz_jobs.xml" (instead of plain "quartz_jobs.xml")
I've written a blog post on how to integrate Quartz.NET with an IoC container. My example code uses Castle Windsor.
The blog post can be found here: http://thecodesaysitall.blogspot.com/2012/02/integrate-quartznet-with-your-favourite.html

STS + gwt + spring-config files + tx:annotation namespace

I have been stuck at this for a while. I have been developing a gwt + spring backend java project. My project is structure with a GWT project and another java project for spring services and so on. Each project contains their respective spring-config files. while trying to load the spring configs if i were to use
tx:annotation-driven
i get the following continuously.
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/tx/spring-tx-3.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:annotation-driven'.
should mention i am deploying in the gwt container inside sts using google plugin for eclipse.
my spring-servlet namespace begins as so
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="h ttp://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="h ttp://www.springframework.org/schema/aop"
xmlns:context="h ttp://www.springframework.org/schema/context"
xmlns:p="h ttp://www.springframework.org/schema/p"
xmlns:util="h ttp://www.springframework.org/schema/util"
xmlns:tx="h ttp://www.springframework.org/schema/tx"
xsi:schemaLocation="h ttp://www.springframework.org/schema/aop h ttp://www.springframework.org/schema/aop/spring-aop-3.0.xsd
h ttp://www.springframework.org/schema/beans h ttp://www.springframework.org/schema/beans/spring-beans-3.0.xsd
h ttp://www.springframework.org/schema/util h ttp://www.springframework.org/schema/util/spring-util-3.0.xsd
h ttp://www.springframework.org/schema/tx h ttp://www.springframework.org/schema/tx/spring-tx-3.0.xsd
h ttp://www.springframework.org/schema/context h ttp://www.springframework.org/schema/context/spring-context-3.0.xsd">
<tx:annotation-driven transaction-manager="transactionManager"/>
I have gone through a lot of posts to understand it but have not been able to solve the issue.
a) Tried to import the schema into the xml-catalog
using :
jar:file:path/to/spring-framework-3.0.5.RELEASE/dist/org.springframework.transaction-3.0.5.RELEASE.jar!/org/springframework/transaction/config/spring-tx-3.0.xsd
with key as http://www.springframework.org/schema/context/spring-context-3.0.xsd and type as schema location.
Appreciate any help or pointers !
For others who face similar problems in an environment which includes STS and maven. Make sure you have the correct jar added to your pom.xml and then either update ur dependencies ; refresh your workspace ; close your project and reopen or restart STS with -clean option. One of the above will make it work for you.
HTH