flex.messaging.MessageException

654 views
Skip to first unread message

jozeFlex

unread,
Dec 2, 2008, 4:14:27 PM12/2/08
to Flex India Community
Hello I'm getting an Exception flex.messaging.MessageException. It
sais the following: **** MessageBrokerServlet failed to initialize due
to runtime exception: Exception: flex.messaging.MessageException:
Unable to create a new instance of type
'flex.messaging.services.RemotingService'. Types cannot be
instantiated without a public, no arguments constructor.
at flex.messaging.util.ClassUtil.createDefaultInstance(ClassUtil.java:
144)
at flex.messaging.MessageBroker.createService(MessageBroker.java:990)
at flex.messaging.config.MessagingConfiguration.createServices
(MessagingConfiguration.java:299)
at flex.messaging.config.MessagingConfiguration.configureBroker
(MessagingConfiguration.java:100)
at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:
129)
at org.apache.catalina.core.StandardWrapper.loadServlet
(StandardWrapper.java:1172)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:
992)
at org.apache.catalina.core.StandardContext.loadOnStartup
(StandardContext.java:4058)
at org.apache.catalina.core.StandardContext.start
(StandardContext.java:4371)
at org.apache.catalina.core.StandardContext.reload
(StandardContext.java:3099)
at org.apache.catalina.loader.WebappLoader.backgroundProcess
(WebappLoader.java:404)
at org.apache.catalina.core.ContainerBase.backgroundProcess
(ContainerBase.java:1309)
at org.apache.catalina.core.ContainerBase
$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase
$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase
$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase
$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:637)


any ideas what can be causing this exception?

Vinod M. Jacob

unread,
Dec 3, 2008, 5:35:32 AM12/3/08
to flex_...@googlegroups.com
How are you connecting to Java ?

Jose

unread,
Dec 3, 2008, 8:24:49 AM12/3/08
to flex_...@googlegroups.com
Hey, I'm using livecycle data services to connect to java... I found that the error child problem that we were talking in the oder thread was because I didn't defined the messageBrokerServlet. Now when I tried to define it I have trouble of configuration

my two config files looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<services-config>
 
    <services>
        <service-include file-path="remote-config.xml" />
        <default-channels>
           <channel ref="my-amf"/>
        </default-channels>
    </services>
    <security>
        <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat">
            <per-client-
authentication>false</per-client-authentication>
        </login-command>
        <security-constraint id="basic-read-access">
            <auth-method>Basic</auth-method>
            <roles>
                <role>guests</role>
                <role>accountants</role>
                <role>employees</role>
                <role>managers</role>
            </roles>
        </security-constraint>
        <security-constraint id="sample-users">
            <auth-method>Custom</auth-method>
            <roles>
                <role>sampleusers</role>
            </roles>
        </security-constraint>
    </security>
     <servers>
        <server id="my-nio-server" class="flex.messaging.socketserver.SocketServer">
         <properties>
                 
            </properties>
        </server>
    </servers>
    <channels>
        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
        <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
        </channel-definition>
    </channels>

<system>
    <manageable>false</manageable>
     <redeploy>
     <enabled>true</enabled>
            <watch-interval>20</watch-interval>
            <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
            <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file>
            <touch-file>{context.root}/WEB-INF/web.xml</touch-file>
        </redeploy>
    </system>

</services-config>



And If got a remoting-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<service id="my-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage">

<adapters>
        <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
    </adapters>

<default-channels>
        <channel ref="my-amf"/>
    </default-channels>

<destination id="mortgageService">
<properties>
            <source>flex.samples.spring.mortgage.Mortgage</source>
        </properties>
</destination>
</service>


and I get this exception:

I get an exception :
GRAVE: El Servlet /WebContent lanzï¿? excepciï¿?n de load()
javax.servlet.
UnavailableException: An unknown exception occurred while creating an instance of type 'flex.messaging.security.TomcatLoginCommand'.
at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:170)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)


If I comment the server tag I get the exception I posted on this thread before. any ideas? thanks a lot for your time


Jose

unread,
Dec 3, 2008, 12:20:31 PM12/3/08
to flex_...@googlegroups.com
Vinod thanks for your help! I manage to find the solution at the end.. I had the jars everywhere and when I tried to put them under web-inf/lib tomcat start crashed so I put all the flex jar under tomcat/lib and now it works. When I access to messabroker/amf I see that it's working but now I've got another problem, When I execute my flex application I get a message like that:

[RPC Fault faultString="Cannot create class of type 'flex.samples.spring.mortgage.Mortgage'." faultCode="Server.ResourceUnavailable" faultDetail="Type 'flex.samples.spring.mortgage.Mortgage' not found."]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:216]
    at mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49]
    at mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
    at NetConnectionMessageResponder/statusHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:523]
    at mx.messaging::MessageResponder/status()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\MessageResponder.as:222]

It's like it's not finding the class on the server but I see that the class is under web-inf/classes. the errors of configuration of flex and java doesn't give much information. I'm having a hard time to set it up, is it normal? Any help would be appreciate
Reply all
Reply to author
Forward
0 new messages