Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] FW: help : A flat name can only have a single component..help asap

Hi Thomas,

 

Thanks for your quick reply. We have a javacode by which we start the jetty.

 

 

Server server = new Server();

XmlConfiguration configuration = new XmlConfiguration(new File("jetty.xml").toURI().toURL());

configuration.configure(server);

new JettyHttpServerProvider().setServer(server);

System.setProperty("com.sun.net.httpserver.HttpServerProvider", "org.eclipse.jetty.jaxws2spi.JettyHttpServerProvider");

server.start();

 

I have attached the the jetty.xml file too.

 

Please suggest ASAP!!

 

Also I have a quick question, do carol.properties file plays any role in jetty 7+ ? If yes, can you please send me the content for the same and where I have to place that file?

Best Regards,

Sandeep Arora | Software Engineer

Description: cid:image001.jpg@01CC1943.D24E45B0

- Quick, Easy, and Affordable Integration Software

- Business Process Management for Everyone

 

Office: +91-120-4274025  | Mobile: +91-9711076814

E-mail: sandeep.arora@xxxxxxxxxxx  | Link: www.adeptia.com

 

 

From: Thomas Becker [mailto:tbecker@xxxxxxxxxxx]
Sent: 24 February 2012 17:53
To: Jetty @ Eclipse developer discussion list
Cc: Sandeep Arora
Subject: Re: [jetty-dev] help : A flat name can only have a single component..help asap

 

Sandeep, could you please paste your start.ini?

On 2/26/12 1:28 PM, Sandeep Arora wrote:

Hi ,

I am using a third party web application with jetty 7.6 . That third party web

app needs a datasource so I need to configure datasource in context.xml , here

is its content :

 

<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">

 

 

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

  <!-- Required minimal context configuration :                        -->

  <!--  + contextPath                                                  -->

  <!--  + war OR resourceBase                                          -->

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

  <Array id="plusConfig" type="java.lang.String">

    <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>

    <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>

    <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>

    <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>

    <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item> <!-- add for

JNDI -->

    <Item>org.eclipse.jetty.plus.webapp.PlusConfiguration</Item>    <!-- add

for JNDI -->

    <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>

    <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>

  </Array>

 

  <Set name="contextPath">/frevvo</Set>

  <Set name="war"><SystemProperty name="jetty.home"

default="."/>/RichForms</Set>

  <Set name="configurationClasses"><Ref id="plusConfig"/></Set>

 

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

  <!-- Optional context configuration                                  -->

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

  <Set name="extractWAR">true</Set>

  <Set name="copyWebDir">false</Set>

  <Set name="defaultsDescriptor"><SystemProperty name="jetty.home"

default="."/>/web/WEB-INF/webdefault.xml</Set>

<New id="myds" class="org.eclipse.jetty.plus.jndi.Resource">

  <Arg><Ref id="wac"/></Arg>

  <Arg>jdbc/frevvoDS</Arg>

  <Arg>

   <New class="org.enhydra.jdbc.standard.StandardXADataSource">

                 <Set name="DriverName">org.hsqldb.jdbcDriver</Set>

                 <Set name="Url">jdbc:hsqldb:file:formsdb</Set>

                 <Set name="User">sa</Set>

                 <Set name="Password"></Set>

    </New>

  </Arg>

</New>

</Configure>

 

 

But when i run the server I get the error :

java.lang.reflect.InvocationTargetException

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

    at

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

    at

org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:761)

    at

org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:386)

    at

org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:338)

    at

org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:291)

    at

org.eclipse.jetty.deploy.ContextDeployer.createContext(ContextDeployer.java:456)

    at

org.eclipse.jetty.deploy.ContextDeployer.deploy(ContextDeployer.java:349)

    at

org.eclipse.jetty.deploy.ContextDeployer.access$000(ContextDeployer.java:77)

    at

org.eclipse.jetty.deploy.ContextDeployer$ScannerListener.fileAdded(ContextDeployer.java:102)

    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:604)

    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:535)

    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:398)

    at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:331)

    at

org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)

    at

org.eclipse.jetty.deploy.ContextDeployer.doStart(ContextDeployer.java:416)

    at

org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)

    at

org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(AggregateLifeCycle.java:58)

    at

org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:53)

    at

org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:91)

    at org.eclipse.jetty.server.Server.doStart(Server.java:261)

    at

org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)

    at com.adeptia.indigo.WebRunner.boot(WebRunner.java:263)

    at com.adeptia.indigo.WebRunner.main(WebRunner.java:100)

Caused by: javax.naming.InvalidNameException: A flat name can only have a

single component

    at javax.naming.NameImpl.addAll(NameImpl.java:621)

    at javax.naming.CompoundName.addAll(CompoundName.java:442)

    at

org.eclipse.jetty.plus.jndi.NamingEntryUtil.makeNamingEntryName(NamingEntryUtil.java:155)

    at org.eclipse.jetty.plus.jndi.NamingEntry.save(NamingEntry.java:184)

    at org.eclipse.jetty.plus.jndi.Resource.<init>(Resource.java:33)

    ... 26 more

 

I have defined the resource in web.xml too

<resource-ref>

        <description>frevvo DB Data Source</description>

        <res-ref-name>jdbc/frevvoDS</res-ref-name>

        <res-type>javax.sql.DataSource</res-type>

        <res-auth>Container</res-auth>

      </resource-ref>

 

Can you tell me where I am doing wrong step and let me know if I have missed

any step.

 

Reproducible: Always

 

Steps to Reproduce:

1.Configure datasource in context.xml

2.Start the server.

 

 

I tried to contact jetty guys , they told me Try to not specify the scope by
removing the reference to wac:
 
Change:
<Arg><Ref id="wac"/></Arg>
 
To:
<Arg></Arg>

 

 

I tried this but this haven’t resolved the problem. I am getting the same error. Please help ASAP!!!!

 

Thanks

Sandeep

 



_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-dev

 

-- 
thomas becker
tbecker@xxxxxxxxxxx
 
http://webtide.com / http://intalio.com
(the folks behind jetty and cometd)
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd";>

<!-- =============================================================== -->
<!-- Configure the Jetty Server                                      -->
<!--                                                                 -->
<!-- Documentation of this file format can be found at:              -->
<!-- http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax        -->
<!--                                                                 -->
<!-- Additional configuration files are available in $JETTY_HOME/etc -->
<!-- and can be mixed in.  For example:                              -->
<!--   java -jar start.jar etc/jetty-ssl.xml                         -->
<!--                                                                 -->
<!-- See start.ini file for the default configuraton files           -->
<!-- =============================================================== -->


<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="setAttribute">
      <Arg>org.eclipse.jetty.server.Request.maxFormContentSize</Arg>
      <Arg>-1</Arg>
    </Call>
    <!-- =========================================================== -->
    <!-- Server Thread Pool                                          -->
    <!-- =========================================================== -->
    <Set name="ThreadPool">
      <!-- Default queued blocking threadpool -->
      <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
        <Set name="minThreads">10</Set>
        <Set name="maxThreads">200</Set>
        <Set name="detailedDump">false</Set>
      </New>
    </Set>

<!-- if NIO is not available, use org.eclipse.jetty.server.ssl.SslSocketConnector -->
  
  <New id="sslContextFactory" class="org.eclipse.jetty.http.ssl.SslContextFactory">
    <Set name="KeyStore"><Property name="jetty.home" default="." />/etc/jetty/adeptiaBPM.keystore</Set>
    <Set name="KeyStorePassword">password</Set>
    <Set name="KeyManagerPassword">password</Set>
  </New>

  <Call name="addConnector">
    <Arg>
      <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
        <Arg><Ref id="sslContextFactory" /></Arg>
        <Set name="Port">8443</Set>
        <Set name="maxIdleTime">30000</Set>
        <Set name="Acceptors">2</Set>
        <Set name="AcceptQueueSize">100</Set>
      </New>
    </Arg>
  </Call>
    <!-- =========================================================== -->
    <!-- Set connectors                                              -->
    <!-- =========================================================== -->

    <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
            <Set name="host"><Property name="jetty.host" /></Set>
            <Set name="port"><Property name="jetty.port" default="8080"/></Set>
            <Set name="maxIdleTime">300000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
            <Set name="requestBufferSize">99999</Set>
            <Set name="responseBufferSize">99999</Set>
            <Set name="useDirectBuffers">false</Set>
	    <Set name="lowResourcesConnections">20000</Set>
	    <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>

    <!-- =========================================================== -->
    <!-- Set handler Collection Structure                            --> 
    <!-- =========================================================== -->
    <Set name="handler">
      <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
        <Set name="handlers">
         <Array type="org.eclipse.jetty.server.Handler">
           <Item>
             <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
           </Item>
           <Item>
             <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
           </Item>
            <Item>
          <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler"/>
        </Item>
         </Array>
        </Set>
      </New>
    </Set>
 <Call name="addLifeCycle">
      <Arg>
        <New class="org.eclipse.jetty.deploy.ContextDeployer">
          <Set name="contexts"><Ref id="Contexts"/></Set>
          <Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/etc/jetty/contexts</Set>
          <Set name="scanInterval">5</Set>
        </New>
      </Arg>
    </Call>
    
     <Call name="addBean">
      <Arg>
        <New class="org.eclipse.jetty.security.HashLoginService">
          <Set name="name">Test Realm</Set>
          <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/jetty/realm.properties</Set>
          <Set name="refreshInterval">0</Set>
        </New>
      </Arg>
    </Call>
    
    
    <!-- =========================================================== -->
    <!-- extra options                                               -->
    <!-- =========================================================== -->
    <Set name="stopAtShutdown">true</Set>
    <Set name="sendServerVersion">true</Set>
    <Set name="sendDateHeader">true</Set>
    <Set name="gracefulShutdown">1000</Set>
    <Set name="dumpAfterStart">false</Set>
    <Set name="dumpBeforeStop">false</Set>

</Configure>

Back to the top