Flex + JPA / Hibernate + BlazeDS + MySQL how to debug this monster?

Ok, so I am making a “simple” web application using the technologies from this topic, I recently found http://www.adobe.com/devnet/flex/articles/flex_hibernate.html so that I follow it and I I'm trying to apply it to my application, with the only difference being that I work on a Mac and I use MAMP for the database (so there is no command line for me).

The fact is that I am having problems getting / connecting to the database.

I have remoting-config.xml, persistance.xml, the News.java class (my Entity), the NewsService.java class, the News.as class - all the same as in the tutorial. I, of course, have this line in one of my .mxmls:

<mx:RemoteObject id="loaderService" destination="newsService" result="handleLoadResult(event)" fault="handleFault(event)" showBusyCursor="true" />

And my remoting-config.xml looks like this (part of it):

<destination id="newsService">

    <properties><source>com.gamelist.news.NewsService</source></properties>

</destination>

NewsService :

    public List<News> getLatestNews() {
    EntityManagerFactory emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT);
    EntityManager em = emf.createEntityManager();
    Query findLatestQuery = em.createNamedQuery("news.findLatest");
    List<News> news = findLatestQuery.getResultList();
    return news;
}

News:

@Entity
@Table(name="GLT_NEWS")
@NamedQueries({
@NamedQuery(name="news.findLatest", query="from GLT_NEWS order by new_date_added limit 5 ") 
})

HandledLoadResult :

    private function handleLoadResult(ev:ResultEvent):void {
        newsList = ev.result as ArrayCollection;
        newsRecords = newsList.length;
    }

:

[Bindable]
private var newsList:ArrayCollection = new ArrayCollection();

:

loaderService.getLatestNews();

, newsList .

, : 1) , mysql , MAMP (, ), ? 2) "", "GLT_NEWS" , ?

, , , ? , loadData() ( trace()), , loaderService.getLatestNews()...

@EDIT: , , " ",

"Error: Client.Error.MessageSend - Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/WebContent/messagebroker/amf' - "

@EDIT2: , , , ContextRoot , , , Project- > Flex Server, ! .flexProject (, Flex Navigator , , ).

+3
2

, , , ... .

  • Java-

  • Java JVM (, -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n)

  • Eclipse 8000. Java , .

  • Flex ( ).

  • Eclipse ( Flash Builder) Flex. Flex .

, . , :

a) - , , ,

b) Charles Proxy ( ) AMF ..

, .

+3

, . - , url web.config BlazeDS.

0

Source: https://habr.com/ru/post/1749763/


All Articles