[jbosstools-issues] [JBoss JIRA] (JBIDE-10743) Knowledge Base and CDI Builder not compatible with Scala project

Hendy Irawan (JIRA) jira-events at lists.jboss.org
Tue Jan 31 00:38:48 EST 2012


    [ https://issues.jboss.org/browse/JBIDE-10743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662937#comment-12662937 ] 

Hendy Irawan commented on JBIDE-10743:
--------------------------------------

@Alexey : You are absolutely correct.

Scala projects may contain Java and Scala sources mixed freely, and may contain inter-references between them. The Scala builder replaces the Java builder and compiles both sources. In other words, Scala builder is a superset of Java builder.

Java EE does not require Java programming language, only the JVM platform (which Scala, Groovy, Clojure, etc. run on). I have no problems at all using Scala with Java EE tech including CDI (JBoss Weld/AS7.1 works excellent!). It's much better and more convenient than Java.

Here's a snippet of a CDI Bean in Scala:

{code}
package com.satukancinta.ui
import collection.JavaConversions._
import javax.enterprise.context.RequestScoped
import javax.inject.Named
import com.satukancinta.annotation.Person
import javax.inject.Inject
import com.satukancinta.domain.User
import scala.reflect.BeanProperty
import com.soluvas.social.story.StoryRepository
import com.soluvas.social.story.Story
import com.soluvas.social.story.BasicTarget
import com.soluvas.social.story.SocialTarget

@RequestScoped @Named
class HomeView {
  
  @Inject @Person private var storyRepo: StoryRepository = _
  @Inject @Named("currentUser") private var user: User = _
  
  private lazy val stories: java.util.List[Story] = storyRepo.findByTarget(user)
  def getStories = stories
  
  implicit def user2SocialTarget(user: User): SocialTarget = BasicTarget(user.getNodeId)

}
{code}

This should result in 'homeView' named bean accessible via JSF (which it is in runtime) but JBoss Tools/JSF Visual Editor does not recognize it.
                
> Knowledge Base and CDI Builder not compatible with Scala project
> ----------------------------------------------------------------
>
>                 Key: JBIDE-10743
>                 URL: https://issues.jboss.org/browse/JBIDE-10743
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: CDI
>    Affects Versions: 3.3.0.M5
>            Reporter: Hendy Irawan
>            Assignee: Alexey Kazakov
>
> Create a Scala web project using Scala IDE.
> A Scala project removes the Java builder because it also compiles the Java sources. However, a project without Java builder is not supported by JBoss Tools:
> {code}
> ./.bak_1.log:!MESSAGE Can't enable org.jboss.tools.jst.web.kb.kbbuilder support on the project satukancinta-data without Java builder.
> ./.bak_1.log:!MESSAGE Can't enable org.jboss.tools.cdi.core.cdibuilder support on the project satukancinta-data without Java builder.
> {code}
> Alternative builders should be supported by JBoss Tools, as long as it is compatible with Java builder.
> Similar issue might also apply to Groovy projects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list