GP: MalformedURLException

Hello all.
I m trying to do 'My First Process' in GP. In this, I ve got stuck at one point. Its when I have to create a callable object of the type 'Interactive Form'. please refer this <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/71/f0944279c0c66ae10000000a155106/frameset.htm">link</a> .
I have followed all the instructions told in ' Checking System Configuration' but still when I test this callable object I m gettin this following exception.
Technical exception
Details: Service call exception; nested exception is:
java.net.MalformedURLException: no protocol: : Service call exception; nested exception is:
java.net.MalformedURLException: no protocol: : Service call exception; nested exception is:
java.net.MalformedURLException: no protocol: 
Please help me, if any one of you has idea about this problem.
Regards
Kapil

Hi,
Did u manage to solve this. I am also getting same error.
Pls advise.
Regards
Jayesh

Similar Messages

  • Error in XML Parsing  through Schema doc.MalformedURLException

    Hi,
    I need to validate xml file before parsing it through XML schema validation. My XML file and schema files are in the same directory and I need am validation it using below code.
    Java Code_
    String rbBasePath = ConfigurationFactory.getInstance().getConfigurations("ConfigParam").get("config.rb.properties", DEFAULT_RB_PATH);
    InputSource xmlInputSource = new InputSource (rbBasePath + ConfigConstants.XML_FILE_NAME);
    File schemaFileObj = new File (rbBasePath + ConfigConstants.XML_SCHEMA_FILE_NAME);
    SAXSource source = new SAXSource (xmlInputSource);
    SchemaFactory sf = SchemaFactory.newInstance (XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = sf.newSchema (schemaFileObj);
    Validator validator = schema.newValidator ();
    validator.setErrorHandler (new ParserErrorHandler());
    validator.validate (source);
    But, I am getting following error.
    java.net.MalformedURLException: unknown protocol: c_
    After some google, I found there may be some bug which does not read the file if file path contains some space in between. But in my case schema path does not contain any space in between.
    Please help to figure out this issue.
    Edited by: Jaykishan on Jul 20, 2011 12:17 PM
    Edited by: Jaykishan on Jul 20, 2011 12:18 PM

    Error occurs at below line of code.
    validator.validate (source);
    Error message: MalformedURLException. java.net.MalformedURLException: unknown protocol: c
    My xml and xsd file is located at: C:\config\resources\AlertData.xml, C:\config\resources\AlertDataSchema.xsd.

  • Things that bug me about Java: MalformedURLException

    Anyone else think it's funny that when I call
    File f = ...
    URL url = f.toURL()
    I've got to catch a MalformedURLException? When could this exception EVER happen? Can anyone answer that?
    Why is MalformedURLException not a RuntimeException? Of all the exceptions out in java land, this is one that has almost never come up for me, and in any case should be totally preventable by the programmer just as NullPointer or ArrayOutOfBounds exceptions are

    I was under the impression that a File was not directly linked to a physical file. In effect you can create a File instance with almost any gibberish. That gibberish could possibly be invalid when converted to a URL or may not be parasble into a url. (relative file paths may be a source of this (Im not sure though). I belive you can also create an "empty" path
    File f = new File("");There may be senible ways of handling conversion of this to a URL but I don't think it does.
    Even if toURL does succed it does not necessarily produce a valid URL (It does not escape special characters)
    matfud

  • MalformedURLException on re-direct

    I open a connection to a URL, try to get the content type, and
    get a MalformedURLException.
    It appears to me that the sun.net followRedirect function really
    doesn't like the location: (redirect) field in the HTTP: header.
    The location field returned by the server is:
    location: /digits?COUNT=13893&STYLE=6&ACCOUNT=1634283RFC 2616 specifies that the location response-header consists of
    a single absolute URI, but Mozilla (for example) accepts a
    relative URI happily.
    I'm writing a polite little webcrawler, and trying to accept
    roughly the same range that your typical web-browser would accept.
    Is there a workaround? I don't want to skip the "non-conforming"
    page, and I'm loath to write my own redirect-follower.
    The URI I'm connecting to is http://fastcounter.linkexchange.com/fastcounter?1634283+3268573
    The code snippet, from ScanNode.scan:
                /* uri is a java.net.URI */
                /* urlConn is a java.net.URLConnection */
                /* contentType is a String */
             urlConn = uri.toURL().openConnection();
             contentType = urlConn.getContentType();The stack trace:
    java.net.MalformedURLException: no protocol: digits?COUNT=13890&STYLE=6&ACCOUNT=1634283
         at java.net.URL.<init>(URL.java:579)
         at java.net.URL.<init>(URL.java:476)
         at java.net.URL.<init>(URL.java:425)
         at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:1081)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:675)
         at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:1169)
         at java.net.URLConnection.getContentType(URLConnection.java:381)
         at ScanNode.scan(ScanNode.java:146)
         at Spider1.main(Spider1.java:72)And, finally, the headers of the page in question:
    urlConn.getHeaderFields().toString() = "{Connection=[close], null=[HTTP/1.1 302 Found], Date=[Fri, 24 Oct 2003 16:45:52 GMT], Server=[Apache/1.3.6 (Unix)], Content-Type=[text/html], Transfer-Encoding=[chunked], Location=[digits?COUNT=13893&STYLE=6&ACCOUNT=1634283]}"
    Michael

    HttpURLConnection.setInstanceFollowDirect and
    setFollowDirect might be used to suppress the
    automatically tried redirection. You should then have
    to do it yourself by reading the header and correcting
    it with protocol and host before "/digits."Hi,
    I got the same problem as Michael.
    Could you plz write a litte more about how to read and set the header. And once that is done - do I then have to do a connect() on the HttpURLConnection again?
    Brgds,
    \Thomas

  • MalformedURLException: Protocol not jmxmp: rmi

    Hi there,
    I'm accessing my MBeans remotely over jmxmp, and all looks fine through JConsole, but when I turn up logging on javax.management.remote I see this exception and the messages which follow, twice in succession the logs:
    threadId=10 2009-02-10 Tue 15:49:52.375 JMXConnectorServerFactory getConnectorAsService: FINER: URL[service:jmx:rmi://<mymachinename>] Service provider exception java.net.MalformedURLException: Protocol not jmxmp: rmi
    threadId=10 2009-02-10 Tue 15:49:52.375 RMIConnectorServer start: FINER: setting default class loader
    threadId=10 2009-02-10 Tue 15:49:52.375 RMIConnectorServer start: FINER: setting RMIServer object
    threadId=10 2009-02-10 Tue 15:49:52.390 RMIServerImpl RMIServerImpl: FINER: class=javax.management.remote.rmi.RMIJRMPServerImpl
    threadId=10 2009-02-10 Tue 15:49:52.437 RMIConnectorServer start: FINER: getting RMIServer object to export
    threadId=10 2009-02-10 Tue 15:49:52.437 RMIConnectorServer start: FINER: Encoding URL
    threadId=10 2009-02-10 Tue 15:49:52.453 RMIConnectorServer start: FINER: Encoded URL: service:jmx:rmi://<mymachinename>/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc2AApVbmljYXN0UmVmAA0xMC4xODMuMjUyLjc1AAAKY8JOWi3aJmq+9lY4KgAAAR9fKdqGgAAAeA==
    threadId=10 2009-02-10 Tue 15:49:52.453 RMIConnectorServer start: FINER: Connector Server Address = service:jmx:rmi://<mymachinename>/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc2AApVbmljYXN0UmVmAA0xMC4xODMuMjUyLjc1AAAKY8JOWi3aJmq+9lY4KgAAAR9fKdqGgAAAeA==
    threadId=10 2009-02-10 Tue 15:49:52.453 RMIConnectorServer start: FINER: started.I did find this thread: http://forums.sun.com/thread.jspa?forumID=537&threadID=5137348 but placing the service provider's class name under META-INF/services didn't resolve it.
    I also tried setting the environment property of my connector server bean in Spring but to no avail...
         <bean id="jmxServerConnector" class="org.springframework.jmx.support.ConnectorServerFactoryBean"
              lazy-init="default" autowire="default" dependency-check="default">
              <property name="serviceUrl" value="service:jmx:jmxmp://localhost:4567/" />
              <property name="threaded" value="true" />
              <property name="daemon" value="true" />
              <property name="server" ref="jmxMBeanServer" />
              <property name="environment">
                   <props>
                        <prop key="jmx.remote.protocol.provider.pkgs">com.sun.jmx.remote.protocol.jmxmp</prop>
                   </props>
              </property>
         </bean>(I tried with the value of the prop as com.sun.jmx.remote.protocol also..maybe I’m missing something here)
    While the MalformedURLException doesn't seem to affect the functionality, I would like to get it resolved or at least know why it happens/if it can be ignored.
    I have jmxremote_optional.jar on my classpath and can access the mbeans by connecting to jconsole with my service url.
    Any insight as to how I can resolve this would be much appreciated.
    Many thanks!
    - Edel

    When executing an operation via JMX using JConsole, I get the following error:
    Problem invoking getManifest : java.rmi.UnmarshallException: Error unmarshalling return: nested is: java.lang.ClassNotFoundException: foo.bar.InernalServiceException (no security manager: RMI class loader disabled)
    Code snippet:
    public ArrayList getManifest(String s) throws InternalServiceException, MBeanException{
    String path = ".\\foo_services.jar"; // Invalid path on purpose to test exception...
    File file = new File(path);
    FileInputStream fileInput;
    try {
    fileInput = new FileInputStream(file);
    } catch (FileNotFoundException e) {
    String msg = "The manifest file is not found in the given path";
    if (logger.isErrorEnabled()) logger.error(msg);
    throw new InternalServiceException(msg, ErrorConstants.JMX_FILE_NOT_FOUND);
    If I throw new RuntimeException(msg, e) instead of InternalServiceException(msg, ErrorConstants.JMX_FILE_NOT_FOUND), it works and I get the appropriate exception.
    What is the reason for this?

  • XSLT ransform MalformedURLException: no protocol: XMLEntities.res

    I have an unsigned WebStart application that is trying to transform a simple XML document using the version of Xalan bundled with with JDK 1.4.2_02. When I try to invoke the transformer, I get the following exception:
    java.lang.ExceptionInInitializerError
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at org.apache.xalan.serialize.SerializerFactory.getSerializer(Unknown Source)
         at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(Unknown Source)
         at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Unknown Source)
         at com.ofc.jc.SmeClient.main(SmeClient.java:146)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.RuntimeException: &#28961;&#27861;&#36617;&#20837;&#36039;&#28304; [ XMLEntities.res ]&#65306;java.net.MalformedURLException: no protocol: XMLEntities.res
    XMLEntities.res      java.net.MalformedURLException: no protocol: XMLEntities.res
         at org.apache.xalan.serialize.CharInfo.<init>(Unknown Source)
         at org.apache.xalan.serialize.SerializerToXML.<clinit>(Unknown Source)
         ... 17 more
    My code is simply this:
            java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(512);
            try
                String xml = "<html><body><h1>works</h1></body></html>";
                javax.xml.transform.Transformer t =
                    javax.xml.transform.TransformerFactory.newInstance().newTransformer();
                t.transform(new javax.xml.transform.stream.StreamSource(new java.io.StringReader(xml)),
                            new javax.xml.transform.stream.StreamResult(baos));
                log.info(baos.toString());
            catch (Exception e)
                log.error("Unable to transform", e);
            }

    Seems that this is only broken under Windows. It works as expected under Linux.

  • MalformedURLException - Oracle not support?

    Dear all,
    I'm trying to use a standalone java client to talk to ALBPM via PAPI. I get it compiled (the Fuego55-APIsGuide is a bit out dated in terms of jar file list, btw). However, when I try to get it run, I got the following error:
    W:\savaria_1\server_1_0\src>java -Dfuego.je22.initialctx.file=C:\bea\TestApp\Properties\tomcatProperties.jndi -classpath . -Djava.ext.dirs=W:\savaria_1\server_1_0\lib com.tradebeam.workflow.gateway.WFRequestHandler
    fuego.papi.exception.ProtocolNotSupportedException: Protocol not supported for URL: 'oracle://grendel.sftech.corp.biz:1521/schema=beaaqualogic,sid=DEV'.
    at fuego.papi.impl.ProcessServiceFactoryImpl.create(ProcessServiceFactoryImpl.java:72)
    at fuego.papi.impl.ProcessServiceFactoryImpl.create(ProcessServiceFactoryImpl.java:155)
    at fuego.papi.impl.ProcessServiceFactoryImpl.create(ProcessServiceFactoryImpl.java:132)
    at fuego.papi.ProcessService.create(ProcessService.java:426)
    at com.tradebeam.workflow.gateway.WFRequestHandler.firstTest(WFRequestHandler.java:46)
    at com.tradebeam.workflow.gateway.WFRequestHandler.main(WFRequestHandler.java:94)
    Caused by: fuego.directory.exception.ProtocolNotSupportedException: Invalid URL: [oracle://grendel.sftech.corp.biz:1521/schema=beaaqualogic,sid=DEV].
    at fuego.directory.exception.ProtocolNotSupportedException.malformedUrlWithException(ProtocolNotSupportedException.java:45)
    at fuego.directory.provider.Factory.getFactoryFromPassport(Factory.java:209)
    at fuego.directory.Directory.startAnonymousSession(Directory.java:616)
    at fuego.papi.impl.ProcessServiceFactoryImpl.create(ProcessServiceFactoryImpl.java:68)
    ... 5 more
    Caused by: fuego.directory.exception.MalformedURLException: Protocol [oracle] not supported.
    Technical detail:Verify that the needed plug-in supporting files are present in your system and that the provider name is not misspelled.
    at fuego.directory.exception.MalformedURLException.protocolNotSupported(MalformedURLException.java:64)
    at fuego.directory.URLParser.createStrategy(URLParser.java:202)
    at fuego.directory.URLParser.createURLParser(URLParser.java:79)
    at fuego.directory.provider.Factory.getFactoryFromPassport(Factory.java:205)
    ======================================
    In my directory.properties, I have:
    # Directory configuration
    # The following properties define the configuration for a directory provider.
    # Do not modify the prefix of the properties. Always leave "directory.default."
    directory.default.url=oracle://grendel.sftech.corp.biz:1521/schema=beaaqualogic,sid=DEV
    # Presets are used to provide properties to the directory with an specific name
    # If a preset is anonymous (no Fuego participant), then comment the participant line
    # nevertheless, connection properties can be defined
    directory.default.preset.xobjects.participant=beaaqualogic
    directory.default.preset.xobjects.participant_password=123456#
    directory.default.preset.portal-anonymous.participant=beaaqualogic
    directory.default.preset.portal-anonymous.participant_password=123456
    directory.default.preset.datawarehouse.participant=beaaqualogic
    directory.default.preset.datawarehouse.participant_password=123456
    directory.default.preset.engine.participant=beaaqualogic
    directory.default.preset.engine.participant_password=123456#
    # oracle FDI implementation
    # Single connection properties (used when FDI handles the authentication)
    directory.default.jdbc-user=beaaqualogic
    directory.default.jdbc-password=123456
    provider.oracle.anonymous-user=beaaqualogic
    provider.oracle.anonymous-password=123456
    =================================
    Finally, this is my TomcatProperties.jndi:
    #TOMCAT jndi config
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.provider.url=localhost:1099
    Any idea what I've done wrong or missed? Thanks in advance!!
    Regards,
    Matthew

    I've found why - turns out it was mentioned in the older APIs guide (ver 5.1). I need fuegofdi-oracle.jar.
    Now I just hit another error - CachedRowSet NoClassDefFoundError. This is easy cause I just need to get rowset.jar from sun's j2ee library (or if I were using Java 1.5 it would have already bundled inside).
    Regards,
    Matthew

  • MalformedURLException in JBOSS 5.1.0 GA

    I am trying to deploy my product in JBOSS 5.1.0 GA.
    Where i am using eclipselink, jpa 1.0, struts 2.1 and spring 1.2 (acegi security)
    (Recently i had upgrade from toplink-essentials to eclipselink 2.4)
    I had faced many issue while in deployment. I had resolved all.
    In my application my project statup page is user login page.
    After deployment, it is showing my app login page, after enter the username and password and when i am clicking on login button, it is showing below error.
    17:38:02,378 ERROR [[default]] Servlet.service() for servlet default threw exception
    java.net.MalformedURLException
         at java.net.URL.<init>(URL.java:601)
         at java.net.URL.<init>(URL.java:464)
         at java.net.URL.<init>(URL.java:413)
         at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
         at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
         at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processPersistenceXML(PersistenceUnitProcessor.java:136)
         at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processPersistenceArchive(PersistenceUnitProcessor.java:84)
         at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.getPersistenceUnits(PersistenceUnitProcessor.java:74)
         at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:223)
         at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:242)
         at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initializeFromMain(JavaSECMPInitializer.java:278)
         at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.getJavaSECMPInitializer(JavaSECMPInitializer.java:81)
         at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:119)
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
         at entity.jpa.EntityManagerHelper.<clinit>(EntityManagerHelper.java:21)
         at entity.generic.GenericDaoImpl.<init>(GenericDaoImpl.java:30)
         at env.authorization.approverslist.IptWorkflowApproverlistDAO.<init>(IptWorkflowApproverlistDAO.java:24)
         at env.authorization.workflowapprover.ApproveDocHelper.<init>(ApproveDocHelper.java:36)
         at env.jspreports.kpis.KpiAction.<init>(KpiAction.java:166)
         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 java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:119)
         at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)
         at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:139)
         at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:109)
         at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:288)
         at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:388)
         at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:187)
         at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
         at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
         at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
         at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)
         at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
         at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.concurrent.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:95)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
         at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
         at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
         at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:662)
    17:38:02,475 INFO [STDOUT] the value of url/Env/Env/css/header.css
    17:38:02,475 INFO [STDOUT] null
    17:38:02,486 INFO [STDOUT] the value of url/Env/Env/css/i-portman.css
    17:38:02,486 INFO [STDOUT] null
    17:38:02,488 INFO [STDOUT] the value of url/Env/Env/images/loginbutton.png
    17:38:02,488 INFO [STDOUT] null
    17:38:02,490 INFO [STDOUT] the value of url/Env/favicon.ico
    17:38:02,491 INFO [STDOUT] null
    17:38:07,432 INFO [STDOUT] Inside the UserDetailsADMIN
    17:38:07,435 ERROR [[default]] Servlet.service() for servlet default threw exception
    java.lang.NoClassDefFoundError: Could not initialize class entity.jpa.EntityManagerHelper
         at env.acegi.users.IptUsersDAO.findByProperty(IptUsersDAO.java:164)
         at env.acegi.users.IptUsersDAO.findByUserCode(IptUsersDAO.java:180)
         at env.acegi.security.AcegiAuthentication.loadUserByUsername(AcegiAuthentication.java:45)
         at org.acegisecurity.providers.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:99)
         at org.acegisecurity.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:122)
         at org.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:200)
         at org.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:47)
         at org.acegisecurity.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:74)
         at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:252)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.concurrent.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:95)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
         at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
         at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
         at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:662)I am using acegi-security for my user login.
    when i will click on login button, control will go to `applicationContext-acegi-security.xml` and there it will process all security related task, and finally it will login me.
    I dont know whether it is acegi problem, or EntityManagerHelper problem...
    Please help me to slove the problem.

    Looks like you have TopLink essentials on the classpath, and it is having problems parsing the persistence.xml. If you are using EclipseLink, you probably should remove TopLink Essentials from the classpath unless it is used elsewhere.
    Best Regards,
    Chris

  • Unhandled exception type MalformedURLException

    Anyway, so I've been trying to create a log in form here, quite succesfull, until I got the error:
    Unhandled exception type MalformedURLException
    And in my eyes, that url isn't malformed... (I even tried: "http://www.google.com/index.html", but giving the same error)
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.net.*;
    public class login extends Applet implements ActionListener
         private static final long serialVersionUID = 1L;
         JTextField username;
         JPasswordField password;
         JButton submit;
         Label l_user, l_pass, empty;
         URL url;
         public void init ()
              setSize(200, 80);
              setBackground(Color.BLACK);
              setLayout(new GridLayout(3,2));
              l_user = new Label("Username:");
                   l_user.setForeground(Color.WHITE);
                   add(l_user);
              username = new JTextField(25);
                   add(username);
              l_pass = new Label("Password:");
                   l_pass.setForeground(Color.WHITE);
                   add(l_pass);
              password = new JPasswordField(25);
                   add(password);
              empty = new Label("");
                   add(empty);
              submit = new JButton("Log In");
                   submit.addActionListener(this);
                   add(submit);
         public void actionPerformed(ActionEvent e)
              url = new URL("http://www.mywebsite.com/logincheck.php?user=" + l_user.getText() + "&pass=" + l_pass.getText());
    }

    When the compiler tells you that, it is not telling you that the URL is malformed. Indeed, it does not have a way of knowing that. What it is telling you is that the URL constructor throws exception MalformedURLException, and you have to catch it. You have to catch it even if you are sure that the argument you supply to URL() will always be fine.
    I would just tell you how simple the fix is and show you, but you should probably check out the java exceptions tutorial instead so that you understand it yourself for future reference. You need to know how to handle exceptions anyway since they are an integral part of Java. You need to use them if you do anything beyond the very basics.

  • Java MalformedURLException (LiveConnect)

    Using Safari 5 on Windows OS
    Browsing any website with Java Applet embedded, couples of "MalformedURLException" occurs when javascript calls a java applet method (LiveConnect)
    java.net.MalformedURLException: no protocol:
              at java.net.URL.<init>(Unknown Source)
              at java.net.URL.<init>(Unknown Source)
              at java.net.URL.<init>(Unknown Source)
              at sun.plugin.liveconnect.SecureInvocation.checkLiveConnectCaller(Unknown Source)
              at sun.plugin.liveconnect.SecureInvocation.access$000(Unknown Source)
              at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)
    Any solution to solve this or it's a kwnon issue with Windows version of Safari??
    Thanks

    Hi,
    today the error is gone. I did not changed anything on my system! Did not installed 10.4.3 so far. Scary!!!
    Regards,
    Marc

  • Java MalformedURLException on using feeds

    Hi,
    since two days (no update was done) Safari throws an java.net.MalformedURLException on displaying my RSS feeds page. Here is the full exception:
    java.net.MalformedURLException: unknown protocol: feeds
         at java.net.URL.<init>(URL.java:574)
         at java.net.URL.<init>(URL.java:464)
         at java.net.URL.<init>(URL.java:413)
         at sun.plugin.AppletViewer.setDocumentBase(AppletViewer.java:894)
         at sun.plugin.viewer.WebKitPluginObject.setDocumentURL(WebKitPluginObject.java:692 )
         at sun.plugin.viewer.WebKitPluginContext.createPluginObject(WebKitPluginContext.ja va:47)
    java.lang.NullPointerException
         at sun.plugin.viewer.WebKitPluginObject.createFrame(WebKitPluginObject.java:338)
         at sun.plugin.viewer.WebKitPluginObject.setWindow(WebKitPluginObject.java:482)
    As i said, I did not changed anything! How may I fix this?
    Regards,
    Marc

    Hi,
    today the error is gone. I did not changed anything on my system! Did not installed 10.4.3 so far. Scary!!!
    Regards,
    Marc

  • 8350 MalformedURLException

    I am attempting to setup the PushRegistration on a Nextel 8350i and continue to receive errors relating to the registration that I have not received on other devices? The following example is taken from the JDE API:
    // Request a dynamic port for out-of-band notices.
                // (Omitting the port number let's the system allocate
                //  an available port number.)
                try {
                    dconn = (UDPDatagramConnection)Connector.open("datagram://" );
                    String dport = "datagram://:"  + dconn.getLocalPort();
                    // Register the port so the MIDlet will wake up, if messages
                    // are posted after the MIDlet exits.
                    PushRegistry.registerConnection(dport, myName, "*" );
    The call that opens the UDPDatagramConnection passes a parameter omitting the port number, specifically,
    dconn = (UDPDatagramConnection)Connector.open("datagram://" );
    when I attempt to run this same line of code on the actual 8350i device I receive a error stating "MalformedURLException: missing everything past initial '//' ". Can someone explain why this is occurring on this device only and how to correct the problem?

    you can't do that. It's a new feature of the OS 4.5 that was shipped with your device. It is seen by RIM as a visual enhancement from previous OS versions.
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • MalformedURLException with xmlParser.parse(inputSource)

    Hiya,
    Can anyone tell me why I'm getting a MalformedURLException from this code? It is because of the URL in the htmlContent String / what can I do about it?
    This problem doesn't happen when I test locally (jdk1.6.0_23) but does happen when I upload to our host (jdk1.6.0_26).
    String htmlContent = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.1//EN\" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd\"><html><head><title></title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/></head><body><div>TODO write content</div></body></html>"; 
    final XHTMLValidationErrorHandler errorHandler = new XHTMLValidationErrorHandler(); 
    final SAXParserFactory parserFactory = SAXParserFactory.newInstance(); 
    parserFactory.setNamespaceAware(true); 
    parserFactory.setValidating(true); 
    final SAXParser saxParser = parserFactory.newSAXParser(); 
    final XMLReader xmlReader = saxParser.getXMLReader(); 
    xmlReader.setEntityResolver(new ExtendedCatalogResolver(new XHTMLBasicCatalogResolver())); 
    xmlReader.setErrorHandler(errorHandler); 
    StringReader stringReader = new StringReader(htmlContent); 
    InputSource inputSource = new InputSource(stringReader); //I've already tried using (htmlContent) and (new ByteArrayInputStream(htmlContent.getBytes("utf-8"))) as the argument here, but the result is the same 
    xmlReader.parse(inputSource); // ** The problem is here! This line throws a MalformedURLException. ** 
    ...StackTrace:
    java.net.MalformedURLException: no protocol: %
         at java.net.URL.<init>(URL.java:567)
         at java.net.URL.<init>(URL.java:464)
         at java.net.URL.<init>(URL.java:413)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:650)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1282)
         at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:283)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1194)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1090)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1003)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
         at org.w3c.mwi.mobileok.basic.XhtmlContent6.validateMobile(XhtmlContent6.java:950)
         at org.w3c.mwi.mobileok.basic.XhtmlContent6.<init>(XhtmlContent6.java:211)
         at org.w3c.mwi.mobileok.basic.MobileOKDecodedContentFactory.decodeContent(MobileOKDecodedContentFactory.java:64)
         at org.w3c.mwi.mobileok.basic.Resource.decode(Resource.java:243)
         at org.w3c.mwi.mobileok.basic.Preprocessor.processResource(Preprocessor.java:484)
         at org.w3c.mwi.mobileok.basic.Preprocessor.access$000(Preprocessor.java:33)
         at org.w3c.mwi.mobileok.basic.Preprocessor$2.run(Preprocessor.java:529)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
         at java.lang.Thread.run(Thread.java:662)
    Thanks in advance,
    James
    Edited by: 907167 on 10-Jan-2012 12:04
    Edited by: 907167 on 10-Jan-2012 13:57 - updated with more informative stack trace
    Edited by: 907167 on 10-Jan-2012 15:55 - code corrected

    Sorry, I did a bad job renaming the 'body' variable to 'htmlContent'.
    I've actually solved the old problem with the DTD by adding this code...
    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    javax.xml.validation.Schema schema = schemaFactory.newSchema(new URL(dtdURL));
    parserFactory.setSchema(schema);...before I create saxParser.
    But now I have this MalforumedURLException...
    net.sf.saxon.trans.XPathException: java.net.MalformedURLException: no protocol: %
         at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:424)
         at net.sf.saxon.event.Sender.send(Sender.java:193)
         at net.sf.saxon.event.Sender.send(Sender.java:50)
         at net.sf.saxon.Configuration.buildDocument(Configuration.java:2973)
         at org.w3c.mwi.mobileok.basic.XhtmlContent10.parseDOM(XhtmlContent10.java:334)
         at org.w3c.mwi.mobileok.basic.XhtmlContent10.<init>(XhtmlContent10.java:226)
         at org.w3c.mwi.mobileok.basic.MobileOKDecodedContentFactory.decodeContent(MobileOKDecodedContentFactory.java:64)
         at org.w3c.mwi.mobileok.basic.Resource.decode(Resource.java:243)
         at org.w3c.mwi.mobileok.basic.Preprocessor.processResource(Preprocessor.java:484)
         at org.w3c.mwi.mobileok.basic.Preprocessor.access$000(Preprocessor.java:33)
         at org.w3c.mwi.mobileok.basic.Preprocessor$2.run(Preprocessor.java:529)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
         at java.lang.Thread.run(Thread.java:662)
    Caused by: java.net.MalformedURLException: no protocol: %
         at java.net.URL.<init>(URL.java:567)
         at java.net.URL.<init>(URL.java:464)
         at java.net.URL.<init>(URL.java:413)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:650)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1282)
         at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:283)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1194)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1090)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1003)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
         at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:404)
         ... 13 more
    ...being create by this code...
                            //PARSE DOM
                   final Configuration config = new Configuration();
                   config.setLineNumbering(true);
                   config.setStripsWhiteSpace(Whitespace.NONE);
                   // Force local resolution of entities in the document
                   final XMLReader xmlReader = config.getSourceParser();
                   final EntityResolver resolver = new ExtendedCatalogResolver(new XHTMLCatalogResolver());
                   xmlReader.setEntityResolver(resolver);
                   // Create source
                   final InputSource stringSource = new InputSource(new StringReader(htmlContent));
                   final SAXSource saxSource = new SAXSource(xmlReader, stringSource);
                   // Parse document and wrap it into a DOM document
                   final DocumentInfo docInfo = config.buildDocument(saxSource); // ** This line throws the MalformedURLException

  • MalformedURLException when creating URL?

    Hi. Does anyone know why Netbeans 5.5 gives me a MalformedURLException EVERY time I write code to create a URL??
    It red-underlines my code and says "unreported exception java.net.MalformedURLException; must be caught or declared to be thrown".
    I haven't even run my code yet... There is nothing wrong with the URL or the String object (if applicable) I am using. It doesn't matter whether I use a valid URI's .toURL() method, or if I use a new URL(anotherURL.toString()).
    If I enclose the whole thing in a try...catch, it takes away the red-underline and it works just fine when I run it... even though it never catches the exception.
    Is this a NetBeans bug, a Java bug, or should I just be doing something differently?
    Thanks for any feedback...
    -RN

    MalformedURLException is totally miscategoized. It should be a subclass of RuntimeException but instead it got released in the first version of java that there ever was as a checked exception... so you have to catch it. This is actually one of my biggest annoyances in Java. Not only is it stupid to have to catch MalformedURLException every time you create a URL from a String, but even stupider is that because there's no way to construct a URL without catching that exception, you now also have to catch it on File.toURL() When is File.toURL() going to throw an exception? Answer: Never. But still you need to catch it.

  • MalformedURLException?

    I keep getting a MalformedURLException error when all Im trying to do is take a string I grab from the command-line in my main class and pass it to another class and use that string to open a url.
    Here is a small snippet of the code:
    public static void URLGrab(String urlString)
    URL u = new URL(urlString);
    And I get the error on this line. Any ideas what it could be?

    Most probably the URL is "malformed" --- it's missing some necessary part or is otherwise not valid.
    Print the string out before creating the URL so you'll see what you are passing in.

Maybe you are looking for