分享

java.net.MalformedURLException: unknown protocol: dummy异常

 pengx 2009-04-23

JBoss中,启动Applet连接EJB,出现java.net.MalformedURLException: unknown protocol: dummy异常

(其实还有一个Log4j的异常:

[java] log4j:WARN No appenders could be found for logger (org.jboss.security.SecurityAssociation).
[java] log4j:WARN Please initialize the log4j system properly.

解决:

查找您系统下是否有一个gnujaxp.jar文件,并删除它。

The gnujaxp.jar file is most easily installed in $JAVA_HOME/jre/lib/ext; otherwise you may prefer to modify your CLASSPATH. If you have other JAXP parsers installed you may also wish to set up $JAVA_HOME/jre/lib/jaxp.properties so the GNU JAXP drivers are used by default:

# make JAXP clients prefer the GNU implementations
javax.xml.parsers.SAXParserFactory=gnu.xml.aelfred2.JAXPFactory
javax.xml.parsers.DocumentBuilderFactory=gnu.xml.dom.DomDocumentBuilderFactory
javax.xml.transform.TransformerFactory=gnu.xml.transform.TransformerFactoryImpl
javax.xml.xpath.XPathFactory=gnu.xml.xpath.XPathFactoryImpl
Alternatively, you may specify the use of the experimental libxmlj implementations, as follows:

javax.xml.parsers.SAXParserFactory=gnu.xml.libxmlj.sax.GnomeSAXParserFactory
javax.xml.parsers.DocumentBuilderFactory=gnu.xml.libxmlj.dom.GnomeDocumentBuilderFactory
javax.xml.transform.TransformerFactory=gnu.xml.libxmlj.transform.GnomeTransformerFactory
If you are using the portable SAX2 bootstrapping APIs, you may want to set the org.xml.sax.driver system property on each JVM invocation to be gnu.xml.aelfred2.SAXDriver (non-validating) or gnu.xml.aelfred2.XmlReader (optionally validating). Otherwise the org.xml.sax.helpers.XMLReaderFactory may not return the parser you expect.

If using GNU JAXP as part of GNU Classpath, no configuration should be necessary.

附一些Log4j问题解决数参考的资料:

解决jboss和log4j的冲突问题

方案1:

你先將你程式內部的 log4j.properties or log4j.xml 全部拿掉,再 deploy
看看。如果没问题再逐一将 自己的 config 一项一项放进

\jboss\server\default\conf\log4j.xml 测试。


方案2:

application若有自己的log4j war及设定项,而导致JBoss启动时出现 "ERROR: invalid console appender config detected, console stream is looping." 错误信息时,只要去JBoss server里的conf资料夹中的jboss-service.xml中的org.jboss.logging.Log4jService的设定区段中 加个参数:<attribute name="CatchSystemOut">false</attribute>即可,如:

<mbean code="org.jboss.logging.Log4jService" name="jboss.system:type=Log4jService,service=Logging"><attribute name="ConfigurationURL">resource:log4j.xml</attribute><attribute name="CatchSystemOut">false</attribute><attribute name="Log4jQuietMode">true</attribute></mbean>


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多